Example #1
0
        public ActionResult Edit(Users item)
        {
            //neu cac rang buoc ok
            if (ModelState.IsValid)
            {
                if (item.UserId != 0)
                {
                    item.UpdatedDate = DateTime.Now;
                    item.UpdatedUser = new Guid(ConstantVariable.STRING_GUIDEMPTY);
                }
                else
                {
                    item.CreatedDate = DateTime.Now;
                    item.CreatedUser = new Guid(ConstantVariable.STRING_GUIDEMPTY);
                }
                //Save data
                item.UserId = itemUserBAL.Save(item);

                if (item.UserId != 0)
                {
                    ViewBag.ItemGuid = item.UserId;
                    return JavaScript("DialogAlert('','Cập nhập dữ liệu thành công', 'info');");
                }
                else
                    return JavaScript(" DialogAlert('','Cập nhập dữ liệu thất bại', 'error');");
            }
            return JavaScript("DialogAlert('','Dữ liệu chưa đúng', 'error');");
        }
Example #2
0
        public ActionResult Create()
        {
            Users item = new Users();

            return PartialView("_PartialPopupCreateUser", item);
        }