public JsonResult SaveCompanyBranch(SET_CompanyBranch companyBranch) { result = new Result(); companyBranchFactory = new CompanyBranchFactorys(); Dictionary <int, CheckSessionData> dictionary = CheckSessionData.GetSessionValues(); int empId = Convert.ToInt32(dictionary[1].Id); if (companyBranch.BranchID > 0) { companyBranch.UpdatedBy = empId; companyBranch.UpdatedDate = DateTime.Now; } else { companyBranch.CreatedBy = empId; companyBranch.CreatedDate = DateTime.Now; } result = companyBranchFactory.SaveCompanyBranch(companyBranch); return(Json(result)); }
public JsonResult LoadCompanyBranch(int?id) { companyBranchFactory = new CompanyBranchFactorys(); List <SET_CompanyBranch> list = companyBranchFactory.SearchCompanyBranch(id); var branchList = list.Select(x => new { x.BranchID, x.CompanyID, x.Name, CompanyName = x.SET_Company.Name, x.ContactNO, x.Code, x.Address, x.Status, x.IsHeadOffice, x.Description, x.Email, x.CreatedBy, x.NoOfFloor, x.CreatedDate }); return(Json(branchList, JsonRequestBehavior.AllowGet)); }