public async Task <IActionResult> Edit(int id, [Bind("SeqNo,EmpId,StrDt,EndDt,HouDy,StrTm,EndTm,HouTt,LeaId,DayTt,DayBt,NotDr,BltNm,BltDt,LstNm,LstDt")] Tblleave tblleave) { if (id != tblleave.SeqNo) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tblleave); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblleaveExists(tblleave.SeqNo)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tblleave)); }
public async Task <IActionResult> Create([Bind("SeqNo,EmpId,StrDt,EndDt,HouDy,StrTm,EndTm,HouTt,LeaId,DayTt,DayBt,NotDr,BltNm,BltDt,LstNm,LstDt")] Tblleave tblleave) { if (ModelState.IsValid) { _context.Add(tblleave); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tblleave)); }
public UCLeaveViewModel(Tblleave model) { STR_DT = model.StrDt.Value; END_DT = model.EndDt.Value; STR_TM = model.StrTm == null ? "": model.StrTm.Value + ""; END_TM = model.EndTm == null ? "": model.EndTm.Value + ""; TYP_LEA = model.LeaId; FULL_DT_BT = model.DayBt.Value; SHI_ID = ""; TOTAL_HOURS = model.HouTt.Value + ""; TOTAL_DAYS = model.DayTt.Value + ""; STR_DT_O = model.StrDt.Value; END_DT_O = model.EndDt.Value; NOT = model.NotDr; }
public void LeaveDelete(Tblleave model) { try { string EMP_ID = model.EmpId; DateTime ddt1 = model.StrDt.Value; DateTime ddt2 = model.EndDt.Value; using (SqlConnection con = new SqlConnection(PublicFunction.connectionString)) { con.Open(); string sql = "delete from TBLLEAVE where EMP_ID = '" + model.EmpId + "' and SEQ_NO = '" + model.SeqNo + "'"; PublicFunction.SQL_Execute(sql, con); } Leave_Attendance_Cal(EMP_ID, ddt1, ddt2, null); } catch (Exception ex) { err = err + " " + ex.Message + " - " + ex.StackTrace; } }