|
Create a UserControl, and start there.
Give it a fixed height, and add four "points": minimum, maximum, low, high.
These are probably integer values which do not relate in any way directly to hours and minutes, so the control can be flexible.
Handle the Paint event to draw the control and two "handles" that you can move.
Handle the MouseDown, MouseUp, and MouseMove events to let you move the handles.
As they move, update the low and high values.
Provide properties to read the values, and in there translate the integers to hours and minutes - perhaps return a timespan? One digit move could be your fifteen minutes.
Provide an event to indicate "slider changed" so the outside world can react to it.
"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!
|
|
|
|
|
put two System.Windows.Forms.TrackBar Controls on a form: tBarHour, tBarMinute. Configure:
this.tBarHour.LargeChange = 4;
this.tBarHour.Location = new System.Drawing.Point(280, 148);
this.tBarHour.Maximum = 23;
this.tBarHour.Name = "tBarHour";
this.tBarHour.Size = new System.Drawing.Size(375, 45);
this.tBarHour.TabIndex = 11;
this.tBarHour.Value = 12;
this.tBarHour.ValueChanged += new System.EventHandler(this.tBarHourMinute_ValueChanged);
this.tBarMinute.LargeChange = 10;
this.tBarMinute.Location = new System.Drawing.Point(280, 200);
this.tBarMinute.Maximum = 59;
this.tBarMinute.Name = "tBarMinute";
this.tBarMinute.Size = new System.Drawing.Size(375, 45);
this.tBarMinute.TabIndex = 12;
this.tBarMinute.ValueChanged += new System.EventHandler(this.tBarHourMinute_ValueChanged); The Minimum TrackBar value is #0 by default.
Set the ValueChanged event handler for both TrackBars to:
private TimeSpan tSpan;
private string tSpanStr;
private void tBarHourMinute_ValueChanged(object sender, EventArgs e)
{
tSpan = new TimeSpan(0, tBarHour.Value, tBarMinute.Value, 0);
tSpanStr = tSpan.ToString());
}
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 9-Apr-21 11:39am.
|
|
|
|
|
I have the following query.
There is a one-to-many relationship between Jobs->JobSequenceSheets.
I'm joining to JobSequenceSheets. But what I really want is just the COUNT of the JobSequenceSheets records for each Job record.
I'm not sure how to do this. Can someone help?
var datas = (from j in dc.Jobs
join p in dc.Projects on j.ProjectId equals p.Id
join cty in dc.Cities on p.CityId equals cty.Id
join cl in dc.CompanyLocations on p.LocationId equals cl.Id
let jsdr = dc.JobStartDateRevisions.Where(q => q.JobId == j.Id)
.OrderByDescending(q => q.Revision)
.Take(1)
.FirstOrDefault()
join jss in dc.JobSequenceSheets on j.Id equals jss.JobId
let lots = dc.JobSequenceSheets.Where(q => q.JobId == j.Id).Count()
where (jsdr != null && jsdr.StartDate >= startDate && jsdr.StartDate <= endDate)
select new
{
JobId = j.Id,
JobNumber = j.JobNumber,
Lots = j.Lots,
StartDate = jsdr.StartDate,
ProjectId = p.Id,
ProjectNumber = p.ProjectNumber,
ProjectName = p.ProjectName,
CityId = cty.Id,
City = cty.City1,
LocationId = cl.Id,
Location = cl.Location,
}).OrderBy(x => x.Location)
.ThenBy(x => x.ProjectName)
.ThenBy(x => x.StartDate).ToList();
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Can't you just do that with a GROUP BY?
"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!
|
|
|
|
|
Probably, but I'm not sure of the syntax
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I've no idea what your DB looks like, but if you have a table containing a foreign key to another, then it's pretty simple.
Assume a Invoices system for simplicity. It contains two tables:
Invoices
ID
InvoiceDate
CustomerID
... InvoiceLines
ID
InvoiceID
ProductID
Quantity
UnitPrice
...
So to get the number of Lines per Invoice it's simple to use a group:
SELECT InvoiceID, COUNT(ID)
FROM InvoiceLines
GROUP BY InvoiceID
So if I issue two invoices:
ID = 1, InvoiceDate = #2021-04-07#, ...
ID = 2, InvoiceDate = #2021-04-08#, ...
ID = 1, InvoiceID = 1, ...
ID = 2, InvoiceID = 1, ...
ID = 3, InvoiceID = 1, ...
ID = 4, InvoiceID = 1, ...
ID = 5, InvoiceID = 2, ...
ID = 6, InvoiceID = 2, ...
ID = 7, InvoiceID = 2, ... Then the query returns:
1, 4
2, 3 Which sounds like what you are looking for.
"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!
|
|
|
|
|
Good evening everyone, in fact I finished my Point of Sale application on C # .net and SQL server. On the development pc everything is working fine, my concern is to make the application usable in multi-workstation with an Internet connection I have tried everything but to no avail ...
Please if anyone has a solution or an idea to solve this problem.
Thanks for your help
|
|
|
|
|
What problem?
We have no idea what you have done, what you have tried, or even what you are trying to do!
"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!
|
|
|
|
|
Member 14192216 wrote: Please if anyone has a solution or an idea to solve this problem. It's very easy. The client app needs to be able to access the server app. Usually you install sql server on a machine and then change the connection string to point to that server.
Not to be too critical, but how did you build a POS system without knowing how to change a connection string?
|
|
|
|
|
This connection string can be changed by what? show me please i'm limited by that
|
|
|
|
|
Where did you put it?
It's either hard coded in your code somewhere or it's in your apps app.config file. It's just text in either case.
|
|
|
|
|
Exposing an SQL Server directly to the web is a bad idea.
You should be putting your SQL Server behind a web service that handles all transactions with the SQL database. Your application on client machines should be interacting with this web service with an authenticated and secured connection (think SSL and HTTPS).
It sounds like you have a lot more work to do and your application is indeed NOT finished.
|
|
|
|
|
Listen to what Dave said - you need to understand the structure of a distributed (internet) solution. Do NOT expose SQL Server directly to the internet.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
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!
|
|
|
|