Example #1
0
 public void AddTimeSheetEntriesForDays(List <day> days, int Resource_id)
 {
     foreach (var h in days)
     {
         tbl_TimeSheet mytime = new tbl_TimeSheet();
         mytime.Resource_ID = Resource_id;
         mytime.Date        = new DateTime(h.Year, h.Month, h.Day);
         mytime.Hours       = (decimal)h.HoursWorked;
         db.tbl_TimeSheets.InsertOnSubmit(mytime);
     }
 }
Example #2
0
 public void AddTimeSheetEntriesForDays(List<day> days, int Resource_id)
 {
     foreach (var h in days)
     {
         tbl_TimeSheet mytime = new tbl_TimeSheet();
         mytime.Resource_ID = Resource_id;
         mytime.Date = new DateTime(h.Year, h.Month, h.Day);
         mytime.Hours = (decimal)h.HoursWorked;
         db.tbl_TimeSheets.InsertOnSubmit(mytime);
     }
 }
Example #3
0
 public void Add(tbl_TimeSheet ts)
 {
     db.tbl_TimeSheets.InsertOnSubmit(ts);
 }
Example #4
0
 partial void Deletetbl_TimeSheet(tbl_TimeSheet instance);
Example #5
0
 partial void Updatetbl_TimeSheet(tbl_TimeSheet instance);
Example #6
0
 partial void Inserttbl_TimeSheet(tbl_TimeSheet instance);
Example #7
0
		private void detach_tbl_TimeSheets(tbl_TimeSheet entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Resource = null;
		}
Example #8
0
        private void Update(int resource_id, DateTime myDate, FormCollection coll)
        {
            timedb.DeleteTimesheet(resource_id, myDate);
            List<day> myEntries = new List<day>();

            foreach (var item in coll)
            {
                if(item.ToString().Contains("r"))
                {
                    if(coll[item.ToString()] != string.Empty)

                    myEntries.Add(new day { Day = int.Parse(item.ToString().Replace("r", "")), Year = myDate.Year, Month = myDate.Month, HoursWorked = decimal.Parse(coll[item.ToString()].ToString()) });
                }
            }
            foreach (var h in myEntries)
            {
                tbl_TimeSheet mytime = new tbl_TimeSheet();
                mytime.Resource_ID = resource_id;
                mytime.Date = new DateTime(h.Year, h.Month, h.Day);
                mytime.Hours = (decimal)h.HoursWorked;
                timedb.Add(mytime);
            }
            timedb.Save();
        }
Example #9
0
 public void Add(tbl_TimeSheet ts)
 {
     db.tbl_TimeSheets.InsertOnSubmit(ts);
 }
Example #10
0
 partial void Deletetbl_TimeSheet(tbl_TimeSheet instance);
Example #11
0
 partial void Updatetbl_TimeSheet(tbl_TimeSheet instance);
Example #12
0
 partial void Inserttbl_TimeSheet(tbl_TimeSheet instance);
Example #13
0
 private void detach_tbl_TimeSheets(tbl_TimeSheet entity)
 {
     this.SendPropertyChanging();
     entity.tbl_Resource = null;
 }