public ActionResult AddUpdateRecord(GlobalCodes objGlobalCode) { var globalCodeBal = new GlobalCodeBal(); var userId = Helpers.GetLoggedInUserId(); var currentDateTime = Helpers.GetInvariantCultureDateTime(); if (objGlobalCode.GlobalCodeID > 0) { objGlobalCode.ModifiedBy = userId; objGlobalCode.ModifiedDate = currentDateTime; } else { objGlobalCode.CreatedBy = userId; objGlobalCode.CreatedDate = currentDateTime; } globalCodeBal.AddUpdateGlobalCodes(objGlobalCode); var categoryName = globalCodeBal.GetGlobalCategoryNameById(objGlobalCode.GlobalCodeCategoryValue); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = globalCodeBal.GetAllGlobalCodes(objGlobalCode.GlobalCodeCategoryValue), }; return(PartialView(PartialViews.GenericListView, globalCodeView)); }
/// <summary> /// Securities the specified category value. /// </summary> /// <param name="categoryValue">The category value.</param> /// <returns></returns> public ActionResult DashSubCategoryView(string categoryValue) { var facilityNumber = Helpers.GetDefaultFacilityNumber(); using (var bal = new GlobalCodeBal()) { var maxValue = bal.GetMaxGlobalCodeValueByCategory(categoryValue) + 1; var viewData = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true, IsDeleted = false, GlobalCodeCategoryValue = categoryValue, FacilityNumber = facilityNumber, GlobalCodeValue = Convert.ToString(maxValue), SortOrder = maxValue, GlobalCodeID = 0 }, CodesList = bal.GetSubCategoriesList(categoryValue) }; return(View(viewData)); } }
public ActionResult ShowInActiveRecords(string category, bool showInActive) { using (var bal = new GlobalCodeBal()) { var list = bal.ShowInActiveRecordsByCategoryValue(category, showInActive); var categoryName = bal.GetGlobalCategoryNameById(category); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); } }
public ActionResult DeleteRecord(int globalCodeId, string category) { using (var bal = new GlobalCodeBal()) { var list = bal.DeleteGlobalCodeById(globalCodeId, category); var categoryName = bal.GetGlobalCategoryNameById(category); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); } }
public ActionResult GetGenericTypeData(string category) { using (var bal = new GlobalCodeBal()) { var list = bal.GetAllGlobalCodes(category); var categoryName = bal.GetGlobalCategoryNameById(category); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); } }
public ActionResult ShowInActiveRecords(string category, bool inActiveStatus) { using (var bal = new GlobalCodeBal()) { var list = bal.GetGlobalCodesByCategory(category, Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId(), Helpers.GetLoggedInUserId(), 0, out long mxGlobalCodeValue, !inActiveStatus, isFacilityPassed: true); var categoryName = bal.GetGlobalCategoryNameById(category); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); } }
public ActionResult GetGenericTypeData(string category) { using (var bal = new GlobalCodeBal()) { var list = bal.GetGlobalCodesByCategory(category, Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId(), Helpers.GetLoggedInUserId(), 0, out long mxGlobalCodeValue, true, isFacilityPassed: true); var categoryName = list.Any() ? list[0].GlobalCodeCustomValue : bal.GetGlobalCategoryNameById(category); var globalCodeView = new GlobalCodeView { GlobalCategoryName = categoryName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); } }
public ActionResult View(string cv, int?txt) { var maxValue = 250; if (cv == "0101") { maxValue = 5; } if (!string.IsNullOrEmpty(cv)) { using (var bal = new GlobalCodeBal()) { var list = bal.GetGlobalCodesByCategory(cv, Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId(), Helpers.GetLoggedInUserId(), 0, out long mxGlobalCodeValue, true, isFacilityPassed: true); var categoryName = list.Any() ? list[0].GlobalCodeCustomValue : bal.GetGlobalCategoryNameById(cv); //mxGlobalCodeValue = Convert.ToInt32(bal.GetMaxGlobalCodeValueByCategory(categoryValue) + 1); var globalCodeView = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true, IsDeleted = false, GlobalCodeValue = Convert.ToString(mxGlobalCodeValue), GlobalCodeCategoryValue = cv, ExternalValue6 = Convert.ToInt32(txt) > 0 ? "1" : string.Empty, ExternalValue5 = categoryName, ExternalValue1 = Convert.ToString(maxValue) }, GlobalCategoryName = categoryName, CodesList = list }; //Pass the View Model in ActionResult to View Facility return(View("GenericView", globalCodeView)); } } //Pass the View Model in ActionResult to View Facility return(View("Index")); }
public ActionResult AddUpdateRecord(GlobalCodes model) { var userId = Helpers.GetLoggedInUserId(); var currentDateTime = Helpers.GetInvariantCultureDateTime(); model.FacilityNumber = Convert.ToString(Helpers.GetDefaultFacilityId()); if (model.GlobalCodeID > 0) { model.ModifiedBy = userId; model.ModifiedDate = currentDateTime; } else { model.CreatedBy = userId; model.CreatedDate = currentDateTime; } var cName = string.Empty; var list = new List <GlobalCodeCustomModel>(); using (var bal = new GlobalCodeBal()) { //Save bal.AddUpdateGlobalCodes(model); //Get List list = bal.GetGlobalCodesByCategory(model.GlobalCodeCategoryValue, Helpers.GetSysAdminCorporateID(), Helpers.GetDefaultFacilityId(), userId, 0, out long mxGlobalCodeValue, true, isFacilityPassed: true); //Get Category Name cName = list.Any() ? list[0].GlobalCodeCustomValue : bal.GetGlobalCategoryNameById(model.GlobalCodeCategoryValue); } //Initialize the View Model to return to the view. var globalCodeView = new GlobalCodeView { GlobalCategoryName = cName, CodesList = list, }; return(PartialView(PartialViews.GenericListView, globalCodeView)); }
/// <summary> /// Allergies the master. /// </summary> /// <returns></returns> public ActionResult AllergyMaster() { //Initialize the GlobalCode Bal using (var globalCodeBal = new GlobalCodeBal()) { var list = globalCodeBal.GetGlobalCodesByCategoriesRange(8101, 8999); //var list = globalCodeBal.Get var globalCodeView = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true, GlobalCodeValue = "0" }, CodesList = list, }; //Pass the View Model in ActionResult to View Facility return(View(globalCodeView)); } }
public ActionResult CodeView(string categoryValue, int?txt) { var maxValue = 250; if (categoryValue == "0101") { maxValue = 5; } if (!string.IsNullOrEmpty(categoryValue)) { using (var bal = new GlobalCodeBal()) { var mxGlobalCodeValue = Convert.ToInt32(bal.GetMaxGlobalCodeValueByCategory(categoryValue) + 1); var categoryName = bal.GetGlobalCategoryNameById(categoryValue); var globalCodeView = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true, IsDeleted = false, GlobalCodeValue = Convert.ToString(mxGlobalCodeValue), GlobalCodeCategoryValue = categoryValue, ExternalValue6 = Convert.ToInt32(txt) > 0 ? "1" : string.Empty, ExternalValue5 = categoryName, ExternalValue1 = Convert.ToString(maxValue) }, GlobalCategoryName = categoryName, CodesList = bal.GetAllGlobalCodes(categoryValue) }; //Pass the View Model in ActionResult to View Facility return(View("GenericView", globalCodeView)); } } //Pass the View Model in ActionResult to View Facility return(View("Index")); }
//order sub Category /// <summary> /// Orders the type sub category. /// </summary> /// <returns></returns> public ActionResult OrderTypeSubCategory() { var facilityId = Helpers.GetDefaultFacilityId(); //Initialize the GlobalCode Bal using (var globalCodeBal = new GlobalCodeBal()) { var list = globalCodeBal.GetGlobalCodesByCategoriesRangeOnDemand(11000, 11999, 1, Helpers.DefaultRecordCount, false, true, facilityId: facilityId); //var list = globalCodeBal.Get var globalCodeView = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true }, CodesList = list, }; //Pass the View Model in ActionResult to View Facility return(View(globalCodeView)); } }
public ActionResult Index() { //Initialize the GlobalCode Bal //var globalCodeBal = new GlobalCodeBal(); //var globalCodeCategoryBal = new GlobalCodeCategoryBal(); //var facilityBal = new FacilityBal(); //Get the Global Code list //var globalCodeList = globalCodeBal.GetAllGlobalCodes(); //List<GlobalCodeListView> gCodesCategory = new List<GlobalCodeListView>(); //gCodesCategory = (from y in globalCodeList // select new GlobalCodeListView // { // GlobalCodeID = y.GlobalCodeID, // FacilityNumber = y.FacilityNumber, // GlobalCodeCategoryName = GetGlobalCodeCategoryNameByID(y.GlobalCodeCategoryValue), // GlobalCodeValue = y.GlobalCodeValue, // GlobalCodeName = y.GlobalCodeName, // Description = y.Description // }).ToList(); //var globalCodeCategoryList = globalCodeCategoryBal.GetGlobalCodeCategories(); //var cId = Helpers.GetDefaultCorporateId(); var globalCodeView = new GlobalCodeView { CurrentGlobalCode = new GlobalCodes { IsActive = true, IsDeleted = false }, CodesList = new List <GlobalCodeCustomModel>(), //GlobalCodeCategoryList = globalCodeCategoryList, //LstFacility = facilityBal.GetFacilities(cId) }; //Pass the View Model in ActionResult to View Facility return(View(globalCodeView)); }