public ActionResult Edit(string userId, string userName, string pass, string fullName, string active, string email) { if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(pass) && !string.IsNullOrWhiteSpace(fullName) && !string.IsNullOrWhiteSpace(userId) && userId.All(Char.IsDigit)) { //user id ís Exist SYS_USER user = DA_User.Instance.GetById(Convert.ToInt32(userId)); if (user != null) { try { SYS_USER checkNameAndPass = DA_User.Instance.getItemBasetUserName(userName); //check user name and pass Exist another user or this user not Exist if (checkNameAndPass.UserID == user.UserID || checkNameAndPass == null) { user.UserName = userName; user.Password = Encrypt.MD5Hash(pass); user.FullName = fullName; user.IsActive = (active == "on") ? true : false; user.Email = email; DA_User.Instance.Update(user); return(RedirectToAction("Index", "User")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(SYS_USER).Name, "edit"); } catch (Exception ex) { } } return(View()); } return(View()); }
public ActionResult Create(string userName, string pass, string fullName, string active, string email) { ViewBag.title = TitleEnum.getTitleForPage(typeof(SYS_USER).Name, "create"); if (!string.IsNullOrWhiteSpace(userName) && !string.IsNullOrWhiteSpace(pass) && !string.IsNullOrWhiteSpace(fullName)) { if (DA_User.Instance.getUserBaseNameAndPass(userName, pass) == null) { try { SYS_USER item = new SYS_USER(); item.UserName = userName; item.Password = Encrypt.MD5Hash(pass); item.FullName = fullName; item.IsActive = (active == "on") ? true : false; item.Email = email; item.IsAdmin = false; DA_User.Instance.Insert(item); return(RedirectToAction("Index", "User")); } catch (Exception ex) { } } return(View()); } return(View()); }
public ActionResult Index() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_MATERIAL).Name, "index"); return(View()); }
public ActionResult Create() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRICE_PAYROLL).Name, "create"); return(View()); }
public ActionResult Create() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_EMPLOYEE).Name, "create"); ViewBag.comboboxPB = DA_Department.Instance.GetAll().ToList(); return(View()); }
public ActionResult Create() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_GROUP).Name, "create"); ViewBag.combobox = DA_GroupFood.Instance.GetAll().ToList(); return(View()); }
public ActionResult Create() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_MATERIAL).Name, "create"); ViewBag.comBoBoxDVT = DA_UOM.Instance.GetAll().ToList(); return(View()); }
public ActionResult Create() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT).Name, "create"); ViewBag.comBoBoxNVL = DA_Material.Instance.GetAll().ToList(); ViewBag.comBoBoxDVT = DA_UOM.Instance.GetAll().ToList(); ViewBag.combobox = DA_GroupFood.Instance.getAllEntityNoChild(); return(View()); }
// GET: GroupFood #region method is used for load page public ActionResult Index() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_GROUP).Name, "index"); List <object> ls = new List <object>(); DA_GroupFood.Instance.ProductGroupID(ref ls, null); ViewBag.List = ls.ToArray(); return(View()); }
public ActionResult Index() { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } if (!Role(3)) { return(RedirectToAction("AccessDenied", "Errors")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT).Name, "index"); return(View()); }
/// <summary> /// load page edit /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_SERVICE).Name, "edit"); if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { return(View(DA_Service.Instance.GetById(Convert.ToInt32(id)))); } return(RedirectToAction("Index", "Service")); }
public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRICE_PAYROLL).Name, "edit"); return(View(DA_PricePayroll.Instance.GetById(Convert.ToInt32(id)))); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRICE_PAYROLL).Name, "index"); return(RedirectToAction("Index", "PricePayroll")); }
public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_GROUP).Name, "edit"); if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { ViewBag.combobox = DA_GroupFood.Instance.GetAllEntityExceptProductGroupId(Convert.ToInt32(id)); return(View(DA_GroupFood.Instance.GetById(Convert.ToInt32(id)))); } return(RedirectToAction("Index", "GroupFood")); }
public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { ViewBag.comBoBoxDVT = DA_UOM.Instance.GetAll().ToList(); ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_MATERIAL).Name, "edit"); return(View(DA_Material.Instance.GetById(Convert.ToInt32(id)))); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_MATERIAL).Name, "index"); return(RedirectToAction("Index", "Material")); }
public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_EMPLOYEE).Name, "edit"); ViewBag.comboboxPB = DA_Department.Instance.GetAll().ToList(); return(View(DA_Employee.Instance.GetById(Convert.ToInt32(id)))); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_EMPLOYEE).Name, "index"); return(RedirectToAction("Index", "Department")); }
/// <summary> /// load page edit /// </summary> /// <returns></returns> public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(SYS_USER).Name, "edit"); if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { SYS_USER item = new SYS_USER(); item = DA_User.Instance.GetById(Convert.ToInt32(id)); return(View(item)); } return(RedirectToAction("Index", "User")); }
public ActionResult Edit(string id) { if (!CheckPermission()) { return(RedirectToAction("Index", "Login")); } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT).Name, "edit"); if (!string.IsNullOrWhiteSpace(id) && id.All(Char.IsDigit)) { ViewBag.comBoBoxNVL = DA_Material.Instance.GetAll().ToList(); ViewBag.comBoBoxDVT = DA_UOM.Instance.GetAll().ToList(); ViewBag.combobox = DA_GroupFood.Instance.getAllEntityNoChild(); ViewBag.productMaterial = DA_Product_Material.Instance.getEntityBaseIdProduct(Convert.ToInt32(id)); return(View(DA_Food.Instance.GetById(Convert.ToInt32(id)))); } return(RedirectToAction("Index", "GroupFood")); }
public ActionResult Edit(string productGroupID, string groupName, string parentName) { if (!string.IsNullOrWhiteSpace(groupName) && !string.IsNullOrWhiteSpace(productGroupID) && productGroupID.All(Char.IsDigit)) { try { int parentId = (parentName.Split('/').Length > 0) ? Convert.ToInt32(parentName.Split('/')[0].All(Char.IsDigit) ? parentName.Split('/')[0] : "0") : 0; int levelId = (parentName.Split('/').Length > 0) ? Convert.ToInt32(parentName.Split('/')[1].All(Char.IsDigit) ? parentName.Split('/')[1] : "0") : 0; TBL_PRODUCT_GROUP item = DA_GroupFood.Instance.GetById(Convert.ToInt32(productGroupID)); item.GroupName = groupName; if (parentId > 0) { item.ParentID = parentId; } item.LevelID = levelId + 1; DA_GroupFood.Instance.Update(item); return(RedirectToAction("Index", "GroupFood")); } catch (Exception ex) { return(View()); } } ViewBag.title = TitleEnum.getTitleForPage(typeof(TBL_PRODUCT_GROUP).Name, "edit"); ViewBag.combobox = DA_GroupFood.Instance.GetAll().ToList(); return(View()); }