Esempio n. 1
0
 public IActionResult Edit(vmBranchHead modelData)
 {
     //var headObj = db.BranchHead.Get(modelData.Id);
     if (ModelState.IsValid)
     {
         BranchHead head = db.BranchHead.GetFirstOrDefault(c => c.Id == modelData.Id);
         head.CompanyId       = modelData.CompanyId;
         head.EmployeeId      = modelData.EmployeeId;
         head.BranchId        = modelData.BranchId;
         head.DivisionId      = modelData.DivisionId;
         head.SisterConcernId = modelData.SisterConcernId;
         db.BranchHead.Update(head);
         db.Save();
         if (head.Id > 0)
         {
             return(Json(true));
         }
     }
     return(Json(false));
 }
Esempio n. 2
0
        public IActionResult Create(vmBranchHead vmBranchHead)
        {
            if (!ModelState.IsValid)
            {
                BranchHead branchHead = new BranchHead()
                {
                    CompanyId       = vmBranchHead.CompanyId,
                    SisterConcernId = vmBranchHead.SisterConcernId,
                    EmployeeId      = vmBranchHead.EmployeeId,
                    BranchId        = vmBranchHead.BranchId,
                    DivisionId      = vmBranchHead.DivisionId
                };
                db.BranchHead.Add(branchHead);
                db.Save();
                ModelState.Clear();

                if (branchHead.Id > 0)
                {
                    return(Json(true));
                }
            }
            return(Json(false));
        }
Esempio n. 3
0
        public IActionResult CreateView()
        {
            vmBranchHead vmBranch = new vmBranchHead();

            return(PartialView("BHeadCreate", vmBranch));
        }