Ejemplo n.º 1
0
        public JsonResult GetAllBranches()
        {
            var currentUser = (dtoUserAccount)Session["CurrentUser"];
            var page = int.Parse(Request["page"]);
            var recordPerPage = int.Parse(Request["recordPerPage"]);
            var isExport = false;

            var filter = new dtoBranch()
            {
                branchCode = Request["searchBranchCode"],
                branchName = Request["searchBranchName"]
              };

            var list = repo.GetAllBranches2(page, recordPerPage, filter, isExport);

            return Json(list);
        }
Ejemplo n.º 2
0
        public JsonResult AddEditBranch(dtoBranch branch)
        {
            dtoResult result;
            var currentUser = (dtoUserAccount)Session["CurrentUser"];

            if (branch.branchId == 0)
            {
                branch.createdBy = currentUser.userId;
                branch.dateCreated = DateTime.Now;
                result = repo.Insert(branch);
            }
            else
            {
                branch.lastModifiedBy = currentUser.userId;
                branch.dateLastModified = DateTime.Now;
                result = repo.Update(branch);
            }

            return Json(result);
        }
Ejemplo n.º 3
0
 public dtoResult Update(dtoBranch branch)
 {
     return repo.Update(branch);
 }
Ejemplo n.º 4
0
 public dtoResult Insert(dtoBranch branch)
 {
     return repo.Insert(branch);
 }