|
Just thinking that a POS that actually needs a distributed system is also going to need to accept some card payment system anyways. And if the creator doesn't know what connectivity is that means they have not even attempted to put that in play.
So this is homework - not real.
|
|
|
|
|
Your POS talks to the database via a "Protocol" (look it up you need to learn what it means.)
There are a couple of ways to do that but the primary one for a distributed system these days for everything is via TCP/IP. That is what you are generically referring to as the "network". You should try to read something, just a little bit, on how TCP/IP works since that is also something you need to know.
Your POS is a "client". The SQL Server is a "Server". Those terms are relevant in TCP/IP.
There is a "connection string" which is defined in a configuration source, which will almost always be a file. So you need to learn about that "connection string" and how to configure it.
To create the correct connection string you will need to know either the "host name" or the "IP Address" (which is something you learn about in TCP/IP) to specify how your "Client" will find the "Server".
You can google for examples of SQL Server connection strings and also examples about how you set it up.
|
|
|
|
|
I am working with a checklistbox that is populated by a SQL table using Entity Framework. I need to have the selected items posted back to a different Table and Column. My current code only posts back the number of Items that are selected but not the item name.
Data Populated method
CheckListToxidrome.DataSource = db.Toxidromes.ToList();
CheckListToxidrome.ValueMember = "ToxidromeID"
CheckListToxidrome.DisplayMember = "ToxidromeName";
Data posting back to same Table
patient.ToxidromeName = CheckListToxidrome.SelectedValue.ToString();
{
var selectedToxidromeName = new List<string>();
foreach (var ToxidromeName in ChecklistAntidote.CheckedItems)
{
selectedToxidromeName.Add(ToxidromeName.ToString());
|
|
|
|
|
For a start your table structure is incorrect. Toxidrome with an ID and name is correct but your selected antidote should only store the ID and REFERENCE the toxidrome table to get the name.
You need to work with the ID's not the text of the name.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Thanks for the feed back, but this is my first project and I an having to lean along the way. this is all new to me. I have had to piece together what I can from YouTube vids and web searches. Can you elaborate a little more for me please.
Thanks
|
|
|
|
|
You have 2 major areas to learn about (each takes substantial time and effort to get the basics of) c# and database design. I suggest you get a couple of books and work your way through them, The way you are going about it is probably the worst method of learning this stuff, youtube and web searches are going to take you down a range of wrong paths.
If your goal is only to get the excel converted to an application then I highly recommend you get a professional to do the job, attempting to do it without a reasonable level of skill will only lead to years of angst (and lousy business practices).
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Hi I’m a newbie, 50 with a bad memory, so pls be toleraterant
I want my web app to allow a user, within a view, to navigate to a file of a document they scanned with a pc, then give it a guid and copy it to a new served location. How would I go about this? Would it be done in js? How about the guids? Would the view model carry some ready for use by the view/js? Or would you do it another way?
|
|
|
|
|
You definitely can't do it in C# - that runs on the Server, not the Client, so any file system interaction involves the server file system, not the client scanned data.
Having said that, you can't do it in JS either, as the browser has no access to client files systems either for security reasons!
What you would have to do is have the user upload the file to the server, then your C# renames the file, saves it locally, and if necessary sends the GUID back to the client so he can manually rename the file.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Ok, the pc is the server (IIS), but there are several pcs in the office all of which navigate the IIS on one of them. So, i want the user to navigate to the file they just scaned onto a network location (perhaps this should be a network attached NAS)
|
|
|
|
|
I'm not sure you can do that either: you can link to a remote file and open it in the browser just with an href:
<a href="file:\\192.168.0.11\Images\MyImage.jpg">Click here</a> and provided the user has permissions set for the NAS it'll open the image in the browser. (My NASes are SBM1, which Windows 10 doesn't like any more, so I have to use IP addresses instead of the server name).
But that won't open an external application for security reasons - the user would have to download the file and then open it themselves.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
That won't work; if the web page is served via http: or https: , it can't link to a file: URI.
The user would have to right-click the link, copy the URL, open a new tab, and paste the URL into it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
C**k!
You're right, of course - it works fine as local HTML, but won't work when served from IIS ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Maybe I need to explain better what I envisioned. User finds location of the pdf they just scanned in to a local network accessible location using a file finding dialogue. The path to that pdf is posted back to the controller. The post method then finds the file, copies it and then saves it with a guid in another more secure location.
|
|
|
|
|
Lmm Cams wrote: The post method then finds the file Just use a FileUpload control instead. Let the user pick what file to upload.
|
|
|
|
|
I have a DataTable as below:
Untitled — ImgBB[^]
For rows which have the same ID and Department if there were not at least a row that its planed end date and end date (C3 and C4) is the same, detect that ID and Department as inconsistent.
For example, for the given table, the answer should be like this:
3 — ImgBB[^]
Please guide me. I need an urgent help.
modified 7-Apr-21 13:46pm.
|
|
|
|
|
We can use Join() method to join columns 1,2 and 3 as keys and set column 4 as values of a dictionary.
Dictionary has ContainKeys() method which can be used to detect the same keys. If ContainKeys() method returned true, then check if Columns 3 and 4 are the same.
I cannot translate this idea into C# code. Maybe it's not correct.
Please help me.
Thanks
modified 7-Apr-21 14:34pm.
|
|
|
|
|
Do you have access to the source data? If so, you can do this within the sql.
For example:
SELECT id, department
FROM table
GROUP BY id, department, planned_end_date, end_date
HAVING COUNT(*) > 1
This will give you a list of id and department where there are at least 2 rows where dates do not match up.
|
|
|
|
|
No, I don't use SQL server. I retrieve my data from an Excel file. Actually I'm using DevExpress tools.
|
|
|
|
|
Finally, I found my own solution:
IWorkbook workbook = spreadsheetControl.Document;
Worksheet worksheet = workbook.Worksheets["DataSet1"];
CellRange range = worksheet.GetDataRange();
int LastRow = range.BottomRowIndex;
var detected_rows = new List<string>();
var mydic1 = new Dictionary<string, string>();
var keys1 = new List<string>();
var keys2 = new List<string>();
var keys3 = new List<string>();
var my_table4 = new DataTable();
for (int i = 1; i < LastRow + 1; i++)
{
if (worksheet.Cells[i, 10].DisplayText == "خاتمه یافته")
{
keys1.Add(string.Join(",", worksheet.Cells[i, 4].DisplayText, worksheet.Cells[i, 14].DisplayText, worksheet.Cells[i, 19].DisplayText));
keys2.Add(string.Join(",", worksheet.Cells[i, 26].DisplayText));
keys3.Add(string.Join(",", worksheet.Cells[i, 28].DisplayText));
}
}
for (int i = 0; i < keys1.Count; i++)
{
if (keys2[i] == keys3[i])
{
detected_rows.Add(keys1[i]);
}
}
for (int i = 0; i < keys1.Count; i++)
{
if (!mydic1.ContainsKey(keys1[i]))
{
mydic1.Add(keys1[i], keys2[i]);
}
}
for (int i = 0; i < detected_rows.Count; i++)
{
mydic1.Remove(detected_rows[i]);
}
List<string> my_keys = new List<string>(mydic1.Keys);
my_table4.Columns.Add("شماره دستورکار");
my_table4.Columns.Add("مرکز هزینه");
my_table4.Columns.Add("سال");
for (int i = 0; i < my_keys.Count; i++)
{
string text = my_keys[i];
string[] my_list = text.Split(',');
my_table4.Rows.Add(my_list[0], my_list[1], my_list[2]);
}
spreadsheetControl.Invoke((MethodInvoker)delegate { CreateSheet("Error Detection"); });
spreadsheetControl.Invoke((MethodInvoker)delegate { ClearSheet("Error Detection"); });
spreadsheetControl.Invoke((MethodInvoker)delegate { Filldata("Error Detection", my_table4, 0, 0, true); });
|
|
|
|
|
What is the fastest way of knowing whether an integer is odd or even?
|
|
|
|
|
|
Won't compile in C#!
if ((number & 0x01) == 1)
{
...
[edit] nor would my original ... precedence rulezz[/edit]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I still tend to think in C.
|
|
|
|
|
No worries, the principle still stands
|
|
|
|
|