Good Everyone.

I have added 2 more column for supervisor and manager for verified.Once engineer done the work he will select done from dropdown column.supervisor verified engineer's "done" work.

ALTER TABLE [dbo].[Record] ADD  CONSTRAINT [verify]  DEFAULT ((0)) FOR [VerifiedbySupervisor]

ALTER TABLE [dbo].[Record] ADD  CONSTRAINT [mgr]  DEFAULT ((0)) FOR [VerifiedbyManager]
GO

Now my problem is how to set the query?I really dont understand the logic could anyone please advice.

                from d in sdc.Records.Where(d => d.Date_Done != null && d.VerifiedbySupervior == null)
                 select new { Date_Done = d.Date_Done, Date_Due = d.Date_Due, SME = d.SME, status = d.Status });

Recommended Answers

All 6 Replies

What? Are you asking how to update one column to indicate that a particular task is 'done'?
Assuming the task has some ID value associated with it you can use:

UPDATE table_name SET column_name = value WHERE id_value = task_id;

Obviously I have used made up names as your table definition hasn't been provided.

Sorry, i really dont understand the logic here.There is 2 person need to verified the work done by workers, one is supervisor and then another one is manager. i have added two column which is one for verified by supervisor n manager which in database as per below:
.verifiedsupervisor bit 1/0 default 0
verifiedManager bit 1/0 default 0

now i need to do the query for the above.
Could you please guide me.

OK but to record that kind of change to a task your are simply updating the record for the particular task. I'm not sure what you expect the code you included in your first post to do.
For example you are SELECTing the work record out of the database for the supervisor and manager to view and change. If the supervisor signs of on the work then the record is updated to reflect the change and probably the date signed off.

Yes your correct .For example. once supervisor login in saw the "Done" status which updated my workers then the supervisor need verified the task "done" by the workers.

Anyone..

I would not filter out records set "done" by the supervisor or manager because (seemingly) they would need to see if those records were marked. They should also need to ONLY see the "done" records so they know what to go verify.

With that said, if you are asking how to modify the Linq-to-SQL query to select the status, it's really hard to tell without seeing the structure of the database, but it should be something like:

//...previous from d in sdc.Records ... 
select new {
 Date_Done = d.Date_Done,
 Date_Due = d.Date_Due,
 SME = d.SME,
 status = d.Status
 SUPV_Verified = d.VerifiedBySupervisor,
 MGR_Verified = d.VerifiedByManager
 }
//... code continues

...then, of course, the rest of your code will need to use the new columns
...unless you're feeding this to some type of GridView, then the columns will name themselves based on the anonymous-type column names inside that select.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.