SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Auto-generate of ID's in Gridview
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

taj
Starting Member

India
39 Posts

Posted - 06/26/2013 :  02:11:06  Show Profile  Reply with Quote
Hi all,

Urgent Requirement related to gridview.....


Test Name Doctor Name Doctor Date Sample Id Sample Date Select

Blood Test AAA 26/06/2013 0 26/06/2013
Urine Test BBB 26/06/2013 0 26/06/2013
Lipid Profile CCC 26/06/2013 0 26/06/2013
Sugar Test DDD 26/06/2013 0 26/06/2013
Fast Blood EEE 26/06/2013 0 26/06/2013
Blood Urea FFF 26/06/2013 0 26/06/2013
Haemoglobin GGG 26/06/2013 0 26/06/2013

Above are few lab tests of a patient which must be done before and after having food/meals and the Patient had paid the bill for all above mentioned lab tests.

In the above gridview the last column is select column ie;checkbox column.

For First visit of patient: BEFORE MEALS
The lab assistant will collect the sample and select the tests,which can be done by the collected samples for BEFORE MEALS,for those many tests i need to generate a unique sample id Eg:1(ONE),and the remaining tests Sample id should be zero.

For Second Visit of patient:AFTER MEALS
The gridview should display only the remaining tests for which samples need to be collected,Now lab assistant will collect the sample and select the tests, which can be done by the collected samples for AFTER MEALS,for those many tests i need to generate a unique sample id Eg:2(TWO) and i should not show the previously generated sample id's ie:1(one).

All these auto-generating of sample id's Should reflect in gridview.

How to fix this?

SOLUTIONS WITH CODE or SMALL EXAMPLES WILL BE APPRECIATED.

Thanks You
taj

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  02:25:24  Show Profile  Reply with Quote
Sorry your posted data doesnt have enough details

Things missing

1. there's no field currently shown which indicated which of tests are before meal and which are after. There should be ideally a field for that
2. There's no field which indicates patient info ie for which patient above tests were scheduled. Without this info there's no way in grid to just show tests for a particular patient

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

taj
Starting Member

India
39 Posts

Posted - 06/26/2013 :  02:53:45  Show Profile  Reply with Quote
sir,

I have button "Generate Sample ID" control in the gridview page, once i clicked the button, sample id value should be generated only for the checked rows(for example if i check first 2 rows in grid then i click the button for those first 2 records only sample id should be Generated as 1 because my last generated sample id is 0) for the next time when i reopen the same page the previously checked rows should not be displayed in the grid whose sample id is 1, and when i check the remaining unchecked rows of grid this time the previously generated number should be incremented by 1 and the number 2 should be generated as a sample Id.

Thank you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  02:56:28  Show Profile  Reply with Quote
You still didnt answer the questions asked. My question was not at all regarding the sample id but was more on identifying the test before and after meal and also on the patient info

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

taj
Starting Member

India
39 Posts

Posted - 06/26/2013 :  03:10:58  Show Profile  Reply with Quote
Sir,

Actually the thing is different its totally depends on the lab assistance they will decide which test to be performed before meals and after meals, their is no specific column indicating test type (before and after meals)....

Thank you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  03:13:16  Show Profile  Reply with Quote
ok...do you've a table where you store the tests selected?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

taj
Starting Member

India
39 Posts

Posted - 06/26/2013 :  03:22:27  Show Profile  Reply with Quote
Sir,

This is my table "Patient_Lab_Tests" where my selected tests gets saved with sample id.

i have one more table "Param_Config" where my latest sample id gets saved every time.

thank you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  04:04:51  Show Profile  Reply with Quote
then isnt it a matter of

SELECT MAX(sampleid) + 1 FROM Param_Config

to get next sample id value?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

taj
Starting Member

India
39 Posts

Posted - 06/26/2013 :  07:14:47  Show Profile  Reply with Quote
Ya, but i want only checked items row should have a same value, how to do this please let me know
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  09:23:29  Show Profile  Reply with Quote
that part has to be code in front end application as that where you handle checked event

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000