Hi all I am having a requirement like selecting multiple values and then to delete. I will have some list of EMployee IDs along with Dates and PayID values.
I will get all this fields in multiple. Now i would like to add this to dictionary element like for particular EmpID I have to assign Date and PayID as keys.
I thought of writing like this
public struct MyValue
{
public List<int> lst;
public List<int> lst1;
public List<DateTime> lstdt;
}
public class MyDictionary : Dictionary<int, MyValue>
{
public void Add(int key, List<int> lst1, List<int> lst2, List<DateTime> lstDt1)
{
MyValue v1=new MyValue();
v1.lst = lst1;
v1.lst1 = lst2;
v1.lstdt = lstDt1;
this.Add(key, v1);
}
}
But I am little bit confused in dealing with this so can any one give me an idea to implement as per my requirement.
This is my requirement if I have EmpID as 1 for this I will have Multiple PayIDs and Dates like 1 and System Date.
Even I will get Mutilple EmpIDs But if exists already in the dictionary as Key element I don’t want to add it again.
(using 2.0 framework)
How can I do this?
Here is what i am doing i will have a grid with check boxes to delete the records. This gridview holds EmpID PayID and Date
Now if a user select some multiple check boxes and tries to delete i would like to store the values to a Dictionary. I will get multiple EmpID from the selection in which the same EmpID may exists for multiple times. So what i need to do is i would like to store the corresponding Values to a Dictionary with EmpID as Key value and the Values to the dictionary as multiple which will be the PayID and Date.
Sample structure of my Gridview
Chkbox EmpID PayID Date
chk 123 1 8-31-2011
chk 123 2 10-31-2011
chk 1234 1 18-31-2011
chk 1234 1 19-31-2011
for EmpID 123 i would like to assign 1,2 and the 2 dates as Values
Can any one tell what’s wrong in this
I have my dictionary as follows