public ActionResult Edit(int id) { GlAccountSubGroupModel model = new GlAccountSubGroupModel(); model = pro.GetAllAccountGroup().Where(x => x.AccSubGruupID == id).FirstOrDefault(); return(View(model)); }
public ActionResult Index() { GlAccountSubGroupModel model = new GlAccountSubGroupModel(); model.GlAccountSubGroupModelList = pro.GetAccountGroup(); return(View(model)); }
public void Edit(int id, GlAccountSubGroupModel model) { using (EHMSEntities ent = new EHMSEntities()) { int Level = 0; string Hierachy = ""; var data = ent.GL_AccSubGroups.Where(x => x.AccSubGruupID == model.ParentID).FirstOrDefault(); if (model.ParentID == 0) { Level = 2; Hierachy = model.AccGroupID.ToString(); } else { Hierachy = data.HierarchyCode + "." + model.ParentID.ToString(); Level = data.HeadLevel + 1; } var data1 = ent.GL_AccSubGroups.Where(x => x.AccSubGruupID == id).FirstOrDefault(); data1.AccGroupID = model.AccGroupID; data1.ParentID = model.ParentID; data1.Remarks = model.Remarks; data1.IsLeafLevel = model.IsLeafLevel; data1.HeadLevel = Level; data1.HierarchyCode = Hierachy; data1.AccSubGroupName = model.AccSubGroupName; ent.SaveChanges(); } }
public ActionResult Create(GlAccountSubGroupModel model) { if (ModelState.IsValid) { pro.Insert(model); } return(RedirectToAction("Create")); }
public void Insert(GlAccountSubGroupModel model) { using (EHMSEntities ent = new EHMSEntities()) { int Level = 0; string Hierachy = ""; var data = ent.GL_AccSubGroups.Where(x => x.AccSubGruupID == model.ParentID).FirstOrDefault(); if (model.ParentID == 0) { Level = 2; Hierachy = model.AccGroupID.ToString(); } else { Hierachy = data.HierarchyCode + "." + model.ParentID.ToString(); Level = data.HeadLevel + 1; } var objGlAccount = new GL_AccSubGroups() { AccGroupID = model.AccGroupID, ParentID = model.ParentID, Remarks = model.Remarks, IsLeafLevel = model.IsLeafLevel, CreatedDate = DateTime.Now, CreatedBy = Utility.GetCurrentLoginUserId(), HeadLevel = Level, HierarchyCode = Hierachy, Status = true, AccSubGroupName = model.AccSubGroupName }; ent.GL_AccSubGroups.Add(objGlAccount); ent.SaveChanges(); int id = objGlAccount.AccSubGruupID; int parentnewid = Utility.GetAccHeadIDFromDescription("Staff Advance"); if (model.ParentID == parentnewid) { SetupEmployeeMaster SEMP = (from x in ent.SetupEmployeeMasters where x.EmployeeMasterId == model.EmployeeMasterId && x.Status == true select x).First(); SEMP.AccountHeadID = objGlAccount.AccSubGruupID; ent.SaveChanges(); } int SalaryParentid = Utility.GetAccHeadIDFromDescription("Salary Payable"); if (model.ParentID == SalaryParentid) { SetupEmployeeMaster SEMP = (from x in ent.SetupEmployeeMasters where x.EmployeeMasterId == model.EmployeeMasterId && x.Status == true select x).First(); SEMP.SPAccountHeadID = objGlAccount.AccSubGruupID; ent.SaveChanges(); } } }
public ActionResult SearchIndex(string AccSubGroupName) { GlAccountSubGroupModel model = new GlAccountSubGroupModel(); string accountAccSubGroupName = string.Empty; if (!string.IsNullOrEmpty(AccSubGroupName)) { AccSubGroupName = AccSubGroupName.ToLower(); model.GlAccountSubGroupModelList = pro.GetAccountGroup().Where(x => x.AccSubGroupName.ToLower().StartsWith(AccSubGroupName)).ToList(); } return(View("Index", model)); }
public ActionResult Edit(int id, GlAccountSubGroupModel model) { pro.Edit(id, model); return(RedirectToAction("Index")); }
public ActionResult Create() { GlAccountSubGroupModel model = new GlAccountSubGroupModel(); return(View(model)); }
public ActionResult DetailOfCOA() { GlAccountSubGroupModel model = new GlAccountSubGroupModel(); return(View(model)); }