public void AddRequest(string id, string desc, string storeId) { MaintenanceModel md = new MaintenanceModel(); MaintenanceDTO dto = new MaintenanceDTO(); UserContext cont = (UserContext)Session["UserContext"]; if (!ValidationUtility.IsNull(cont)) { if (ValidationUtility.IsEqual("AreaManager", cont.Role)) { int storId = ValidationUtility.ToInteger(storeId); dto.Status = "pending"; dto.StoreId = storId; dto.CategoryId = ValidationUtility.ToInteger(id); dto.Description = desc; md.AddMaintenanceRequest(dto); } if (ValidationUtility.IsEqual("GeneralManager", cont.Role)) { int storId = ValidationUtility.ToInteger(storeId); dto.Status = "pending"; dto.StoreId = storId; dto.CategoryId = ValidationUtility.ToInteger(id); dto.Description = desc; md.AddMaintenanceRequest(dto); } } }
public void AddRequest(string sId, string id, string desc) { MaintenanceModel md = new MaintenanceModel(); MaintenanceDTO dto = new MaintenanceDTO(); UserContext cont = (UserContext)Session["UserContext"]; if (!ValidationUtility.IsNull(cont)) { if (ValidationUtility.IsEqual("Manager", cont.Role)) { int storId = md.GetStoredId(cont.Id); dto.Status = "pending"; dto.StoreId = storId; dto.CategoryId = ValidationUtility.ToInteger(id); dto.Description = desc; md.AddMaintenanceRequest(dto); } else if (ValidationUtility.IsEqual("Admin", cont.Role) || ValidationUtility.IsEqual("Corporate", cont.Role) || ValidationUtility.IsEqual("Maintenance", cont.Role)) { //dto.Status = "pending"; //dto.CategoryId = ValidationUtility.ToInteger(id); //dto.Description = desc; //md.AddUserStore(ValidationUtility.ToInteger(sId), cont.Id); //int storId = md.GetStoredId(cont.Id); //dto.StoreId = storId; //md.AddMaintenanceRequest(dto); dto.Status = "pending"; dto.CategoryId = ValidationUtility.ToInteger(id); dto.Description = desc; // md.AddUserStore(ValidationUtility.ToInteger(sId), cont.Id); // int storId = md.GetStoredId(cont.Id); dto.StoreId = ValidationUtility.ToInteger(sId); md.AddMaintenanceRequest(dto); } } }