public ActionResult Edit([Bind(Include = "DeptID,DeptName,DivID,CompanyID")] Department department) { if (department.CompanyID == null) { ModelState.AddModelError("DeptName", "Please selct a Company"); } if (department.DeptName == "") { ModelState.AddModelError("DeptName", "Please enter Department Name"); } if (department.DivID == null) { ModelState.AddModelError("DivID", "Please select Division"); } if (ModelState.IsValid) { db.Entry(department).State = EntityState.Modified; db.SaveChanges(); int _userID = Convert.ToInt32(Session["LogedUserID"].ToString()); HelperClass.MyHelper.SaveAuditLog(_userID, (byte)MyEnums.FormName.Department, (byte)MyEnums.Operation.Edit, DateTime.Now); return(RedirectToAction("Index")); } ViewBag.DivID = new SelectList(db.Divisions.OrderBy(s => s.DivisionName), "DivisionID", "DivisionName", department.DivID); return(View(department)); }
public ActionResult Edit([Bind(Include = "ID,EmailAddress,CCAddress,CompanyID,DepartmentID,SectionID,CriteriaDepSec,ReportCurrentDate,LocationID,TypID,HasTypeOrCat,HasLoc,CatID,UserID")] EmailEntryForm emailentryform) { //if (Request.Form["CriteriaComp"].ToString() == "C") //string compval = Request.Form["CriteriaComp"].ToString(); //emailentryform.CriteriaComLoc = compval; //else // emailentryform.CriteriaComLoc = compval; if (ModelState.IsValid) { EmailEntryForm _emailEmtryForm = db.EmailEntryForms.Where(aa => aa.ID == emailentryform.ID).First(); _emailEmtryForm.EmailAddress = emailentryform.EmailAddress; _emailEmtryForm.CCAddress = emailentryform.CCAddress; db.Entry(_emailEmtryForm).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.TypID = new SelectList(db.EmpTypes, "TypeID", "TypeName"); ViewBag.CompanyID = new SelectList(db.Companies, "CompID", "CompName", emailentryform.CompanyID); ViewBag.DepartmentID = new SelectList(db.Departments, "DeptID", "DeptName", emailentryform.DepartmentID); ViewBag.LocationID = new SelectList(db.Locations, "LocID", "LocName", emailentryform.LocationID); ViewBag.SectionID = new SelectList(db.Sections, "SectionID", "SectionName", emailentryform.SectionID); ViewBag.CatID = new SelectList(db.Categories, "CatID", "CatName", emailentryform.CatID); ViewBag.CriteriaComp = new SelectList(GetCriteriaComp(), "ID", "Name", emailentryform.CriteriaComLoc); ViewBag.CriteriaDepSec = new SelectList(GetCriteriaDeptSec(), "ID", "Name", emailentryform.CriteriaDepSec); ViewBag.HasTypeOrCat = new SelectList(GetCriteriaTypeCat(), "ID", "Name", emailentryform.HasTypeOrCat); return(View(emailentryform)); }
public ActionResult Edit([Bind(Include = "RdrTypeID,RdrTypeName,VendorID")] ReaderType readertype) { if (string.IsNullOrEmpty(readertype.RdrTypeName)) { ModelState.AddModelError("RdrTypeName", "Reader Type field is required!"); } if (readertype.RdrTypeName != null) { if (readertype.RdrTypeName.Length > 50) { ModelState.AddModelError("RdrTypeName", "String length exceeds!"); } if (!myClass.IsAllLetters(readertype.RdrTypeName)) { ModelState.AddModelError("RdrTypeName", "This field only contain Alphabets"); } } if (ModelState.IsValid) { db.Entry(readertype).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(readertype)); }
public ActionResult Edit([Bind(Include = "CityID,CityName,RegionID")] City city) { if (string.IsNullOrEmpty(city.CityName)) { ModelState.AddModelError("CityName", "This field is required!"); } if (city.CityName != null) { if (city.CityName.Length > 50) { ModelState.AddModelError("CityName", "String length exceeds!"); } if (!myClass.IsAllLetters(city.CityName)) { ModelState.AddModelError("CityName", "This field only contain Alphabets"); } } if (ModelState.IsValid) { db.Entry(city).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RegionID = new SelectList(db.Regions, "RegionID", "RegionName", city.RegionID); return(View(city)); }
public ActionResult Edit([Bind(Include = "LocID,LocName,CityID")] Location location) { if (string.IsNullOrEmpty(location.LocName)) { ModelState.AddModelError("LocName", "This field is required!"); } if (location.LocName != null) { if (location.LocName.Length > 50) { ModelState.AddModelError("LocName", "String length exceeds!"); } if (!myClass.IsAllLetters(location.LocName)) { ModelState.AddModelError("LocName", "This field only contain Alphabets"); } //if (CheckDuplicate(location.LocName)) // ModelState.AddModelError("SectionName", "This Type already exist in record, Please select an unique name"); } if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CityID = new SelectList(db.Cities.OrderBy(s => s.CityName), "CityID", "CityName"); //ViewBag.SiteID = new SelectList(db.Sites, "SiteID", "SiteName", location.SiteID); return(View(location)); }
public ActionResult Edit([Bind(Include = "RegionID,RegionName")] Region region) { if (string.IsNullOrEmpty(region.RegionName)) { ModelState.AddModelError("RegionName", "Required"); } if (region.RegionName != null) { if (region.RegionName.Length > 50) { ModelState.AddModelError("RegionName", "Length exceeds"); } if (!myClass.IsAllLetters(region.RegionName)) { ModelState.AddModelError("RegionName", "This field only contains Alphabets"); } if (CheckDuplicate(region.RegionName)) { ModelState.AddModelError("RegionName", "This name already exist in record"); } } if (ModelState.IsValid) { db.Entry(region).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(region)); }
public ActionResult Edit([Bind(Include = "DesignationID,DesignationName,CompanyID")] Designation designation) { ViewBag.CompanyID = new SelectList(db.Companies.OrderBy(s => s.CompName), "CompID", "CompName", designation.CompanyID); if (string.IsNullOrEmpty(designation.DesignationName)) { ModelState.AddModelError("DesignationName", "This field is required!"); } if (designation.DesignationName != null) { if (designation.DesignationName.Length > 100) { ModelState.AddModelError("DesignationName", "String length exceeds!"); } if (!myClass.IsAllLetters(designation.DesignationName)) { ModelState.AddModelError("DesignationName", "This field only contain Alphabets"); } } if (ModelState.IsValid) { db.Entry(designation).State = EntityState.Modified; db.SaveChanges(); int _userID = Convert.ToInt32(Session["LogedUserID"].ToString()); HelperClass.MyHelper.SaveAuditLog(_userID, (byte)MyEnums.FormName.Designation, (byte)MyEnums.Operation.Edit, DateTime.Now); return(RedirectToAction("Index")); } return(View(designation)); }
public ActionResult Edit([Bind(Include = "TypeID,TypeName,CatID")] EmpType emptype) { if (string.IsNullOrEmpty(emptype.TypeName)) { ModelState.AddModelError("TypeName", "This field is required!"); } if (emptype.TypeName != null) { if (emptype.TypeName.Length > 50) { ModelState.AddModelError("TypeName", "String length exceeds!"); } if (!myClass.IsAllLetters(emptype.TypeName)) { ModelState.AddModelError("TypeName", "This field only contain Alphabets"); } } if (ModelState.IsValid) { db.Entry(emptype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } //ViewBag.CatID = new SelectList(db.Categories.OrderBy(s=>s.CatName), "CatID", "CatName", emptype.CatID); return(View(emptype)); }
public ActionResult Edit([Bind(Include = "RdrID,RdrName,RdrDutyID,IpAdd,IpPort,RdrTypeID,Status,LocID,CompanyID,isSafe,EmgPool,OnlyOT")] Reader reader) { if (string.IsNullOrEmpty(reader.IpAdd)) { ModelState.AddModelError("IpAdd", "Required"); } if (string.IsNullOrEmpty(reader.RdrName)) { ModelState.AddModelError("RdrName", "Required"); } if (string.IsNullOrEmpty(reader.IpPort.ToString())) { ModelState.AddModelError("IpPort", "Required"); } if (reader.IpAdd != null) { if (reader.IpAdd.Length > 15) { ModelState.AddModelError("IpAdd", "Required"); } Match match = Regex.Match(reader.IpAdd, @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"); if (!match.Success) { ModelState.AddModelError("IpAdd", "Enter a valid IP Address"); } } if (reader.RdrName != null) { if (reader.RdrName.Length > 50) { ModelState.AddModelError("RdrName", "Required"); } } if (!string.IsNullOrEmpty(reader.IpPort.ToString())) { if (reader.IpPort.ToString().Length > 4) { ModelState.AddModelError("IpPort", "Required"); } } if (ModelState.IsValid) { reader.isSafe = false; reader.EmgPool = false; reader.OnlyOT = (bool)ValueProvider.GetValue("OnlyOT").ConvertTo(typeof(bool)); db.Entry(reader).State = EntityState.Modified; db.SaveChanges(); int _userID = Convert.ToInt32(Session["LogedUserID"].ToString()); HelperClass.MyHelper.SaveAuditLog(_userID, (byte)MyEnums.FormName.Reader, (byte)MyEnums.Operation.Edit, DateTime.Now); return(RedirectToAction("Index")); } ViewBag.LocID = new SelectList(db.Locations.OrderBy(s => s.LocName), "LocID", "LocName", reader.LocID); ViewBag.RdrDutyID = new SelectList(db.RdrDutyCodes.OrderBy(s => s.RdrDutyName), "RdrDutyID", "RdrDutyName", reader.RdrDutyID); ViewBag.RdrTypeID = new SelectList(db.ReaderTypes.OrderBy(s => s.RdrTypeName), "RdrTypeID", "RdrTypeName", reader.RdrTypeID); ViewBag.CompanyID = new SelectList(db.Companies.OrderBy(s => s.CompName), "CompID", "CompName", reader.CompanyID); return(View(reader)); }
public ActionResult Edit([Bind(Include = "CatID,CatName")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit(AttProcessorScheduler attprocessor) { if (ModelState.IsValid) { context.Entry(attprocessor).State = EntityState.Modified; context.SaveChanges(); return(RedirectToAction("Index")); } return(View(attprocessor)); }
public ActionResult Edit([Bind(Include = "JobCardID,DateCreated,DateStarted,DateEnded,CardType,UserID,JobCardCriteria,CriteriaData,Status,TimeIn,TimeOut,WorkMin")] JobCardApp jobcardapp) { if (ModelState.IsValid) { db.Entry(jobcardapp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobcardapp)); }
public ActionResult Edit([Bind(Include = "EmpDate,JobDataID,EmpID,Dated,SubmittedFrom,WrkCardID,SendTo,Approved,Rejected,DateCreated,Remarks,TimeIn,TimeOut,WorkMin")] JobCardEmp jobcardemp) { if (ModelState.IsValid) { db.Entry(jobcardemp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobcardemp)); }
public ActionResult Edit([Bind(Include = "JobID,JobTitle1")] JobTitle jobtitle) { if (ModelState.IsValid) { db.Entry(jobtitle).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(jobtitle)); }
public ActionResult Edit([Bind(Include = "HolID,HolDate,HolDesc")] Holiday holiday) { if (ModelState.IsValid) { db.Entry(holiday).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(holiday)); }
public ActionResult Edit([Bind(Include = "LvTypeID,LvDesc,FldName,HalfLeave,HalfLvCode,HalfAbCode,MaxDays,UpdateBalance,Enable,CarryForward,CarryForwardYear,CarryForwardDays,CountGZDays,CountRestDays,MaxDaysConsective,MaxDaysMonth")] LvType lvtype) { if (ModelState.IsValid) { db.Entry(lvtype).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lvtype)); }
public ActionResult Edit([Bind(Include = "EmpMonthYear,CompanyID,MonthYear,StartDate,EndDate,EmpNo,TotalDays,EarnedDays,RestDays,AbsentDays,SickLeaveDays,AnnualLeaveDays,CasualDays,OtherLeaveDays,LateInMins,OverTimeMins,EmpID,AnnualLVEncashmentDays,BadliPNo,BadliCompanyID,BadliDays,PreparedBy,PreparedDate,Approved,CreatedDate,IsEdited,TransferedToOracle,TransferedDate")] PayRollPrimary payrollprimary) { if (ModelState.IsValid) { db.Entry(payrollprimary).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(payrollprimary)); }
public ActionResult Edit([Bind(Include = "EmpDate,AttDate,Tin1,Tout1,Tin2,Tout2,Tin3,Tout3,Mins,EmpNo,EmpName,Expr1,CompName,EmpID")] ViewAttDataOT viewattdataot) { if (ModelState.IsValid) { db.Entry(viewattdataot).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(viewattdataot)); }
public ActionResult Edit([Bind(Include = "CrewID,CrewName")] Crew crew) { if (ModelState.IsValid) { db.Entry(crew).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(crew)); }
public ActionResult Edit([Bind(Include = "EmpDate,EmpID,Dated,OTMin,ApprovedMin,UserID")] ApprovedOT approvedot) { if (ModelState.IsValid) { db.Entry(approvedot).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(approvedot)); }
public ActionResult Edit([Bind(Include = "DivisionID,DivisionName,CompID")] Division division) { if (ModelState.IsValid) { db.Entry(division).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(division)); }
public ActionResult Edit([Bind(Include = "CompID,CompName,Address,TelNo,Email")] Company company) { if (ModelState.IsValid) { db.Entry(company).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(company)); }
public ActionResult Edit([Bind(Include = "GradeID,GradeName")] Grade grade) { if (ModelState.IsValid) { db.Entry(grade).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(grade)); }
public ActionResult Edit([Bind(Include = "CriteriaValueDate,RosterAppID,DutyCode,DutyTime,WorkMin,Remarks,CompanyID,OpenShift,RosterDate,UserID")] RosterDetail rosterdetail) { if (ModelState.IsValid) { db.Entry(rosterdetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RosterAppID = new SelectList(db.RosterApps, "RotaApplD", "RosterCriteria", rosterdetail.RosterAppID); return(View(rosterdetail)); }
public ActionResult Edit([Bind(Include = "GradeID,GradeName,CompID")] Grade grade) { if (ModelState.IsValid) { db.Entry(grade).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompID = new SelectList(db.Companies.OrderBy(s => s.CompName), "CompanyID", "CompName", grade.Company.CompName); return(View(grade)); }
public ActionResult Edit([Bind(Include = "SectionID,SectionName,DeptID")] Section section) { if (ModelState.IsValid) { db.Entry(section).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DeptID = new SelectList(db.Departments, "DeptID", "DeptName", section.DeptID); return(View(section)); }
public ActionResult Edit([Bind(Include = "CrewID,CrewName,CompanyID")] Crew crew) { if (ModelState.IsValid) { db.Entry(crew).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompanyID = new SelectList(db.Companies, "CompID", "CompName"); return(View(crew)); }
public ActionResult Edit([Bind(Include = "EmpLvType,EmpID,LeaveType,CompanyID,JanConsumed,FebConsumed,MarchConsumed,AprConsumed,MayConsumed,JuneConsumed,JulyConsumed,AugustConsumed,SepConsumed,OctConsumed,NovConsumed,DecConsumed,TotalForYear,YearRemaining,GrandTotal,GrandTotalRemaining")] LvConsumed lvconsumed) { if (ModelState.IsValid) { db.Entry(lvconsumed).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmpID = new SelectList(db.Emps, "EmpID", "EmpNo", lvconsumed.EmpID); return(View(lvconsumed)); }
public ActionResult Edit([Bind(Include = "DivisionID,DivisionName,CompanyID")] Division division) { if (ModelState.IsValid) { db.Entry(division).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompanyID = new SelectList(db.Companies.OrderBy(s => s.CompName), "CompID", "CompName"); return(View(division)); }
public ActionResult Edit([Bind(Include = "RotaApplD,DateCreated,DateStarted,DateEnded,UserID,RosterCriteria,CriteriaData,Status,RotaTypeID,WorkMin,DutyTime,ShiftID")] RosterApp rosterapp) { if (ModelState.IsValid) { db.Entry(rosterapp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.RotaTypeID = new SelectList(db.RosterTypes, "ID", "Name", rosterapp.RotaTypeID); ViewBag.ShiftID = new SelectList(db.Shifts, "ShiftID", "ShiftName", rosterapp.ShiftID); return(View(rosterapp)); }