Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        /// <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));
            }
        }
Exemplo n.º 3
0
        public ActionResult GetGlobalCodesDropdownDataByExternalValue1(string globalCodeValue, string parentCategory)
        {
            var list = new List <SelectListItem>();

            using (var bal = new GlobalCodeBal())
            {
                //var current = bal.GetGlobalCodeByCategoryAndCodeValue(parentCategory, globalCodeValue);
                //int category;
                //if (current != null && !string.IsNullOrEmpty(current.ExternalValue1) && int.TryParse(current.ExternalValue1, out category))
                //{
                //    var gcList = bal.GetListByCategoryId(current.ExternalValue1).OrderBy(x => x.GlobalCodeID).ToList();
                //    if (gcList.Any())
                //    {
                //        list.AddRange(gcList.Select(item => new SelectListItem
                //        {
                //            Text = item.GlobalCodeName,
                //            Value = item.GlobalCodeValue,
                //        }));
                //    }
                //}

                var gcList = bal.GetSubCategories2(globalCodeValue).OrderBy(x => int.Parse(x.GlobalCodeValue)).ToList();
                if (gcList.Any())
                {
                    list.AddRange(gcList.Select(item => new SelectListItem
                    {
                        Text  = item.GlobalCodeName,
                        Value = item.GlobalCodeValue,
                    }));
                }
            }
            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
 public ActionResult GetOrderSubCategoryDetail(string id)
 {
     using (var bal = new GlobalCodeBal())
     {
         var globalCode = bal.GetGlobalCodeByGlobalCodeId(Convert.ToInt32(id));
         var jsonResult = new
         {
             globalCode.GlobalCodeID,
             globalCode.GlobalCodeName,
             globalCode.FacilityNumber,
             globalCode.GlobalCodeCategoryValue,
             globalCode.Description,
             globalCode.ExternalValue1,
             globalCode.ExternalValue2,
             globalCode.ExternalValue3,
             globalCode.ExternalValue4,
             globalCode.ExternalValue5,
             globalCode.ExternalValue6,
             globalCode.IsActive,
             globalCode.IsDeleted,
             globalCode.ModifiedBy,
             globalCode.ModifiedDate,
             globalCode.SortOrder,
             globalCode.DeletedDate,
             globalCode.DeletedBy,
             globalCode.GlobalCodeValue
         };
         return(Json(jsonResult, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the globa code by identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <returns></returns>
 public ActionResult GetSubCategoryDetails(int id)
 {
     using (var bal = new GlobalCodeBal())
     {
         var result     = bal.GetGlobalCodeCustomById(id);
         var jsonResult = new
         {
             Id       = result.GlobalCodes.GlobalCodeID,
             Name     = result.GlobalCodes.GlobalCodeName,
             Value    = result.GlobalCodes.GlobalCodeValue,
             Category = result.GlobalCodes.GlobalCodeCategoryValue,
             result.GlobalCodes.Description,
             result.GlobalCodes.IsActive,
             result.GlobalCodes.SortOrder,
             result.GlobalCodes.ExternalValue1,
             result.GlobalCodes.ExternalValue2,
             result.GlobalCodes.ExternalValue3,
             result.GlobalCodes.ExternalValue4,
             result.GlobalCodes.ExternalValue5,
             result.GlobalCodes.ExternalValue6,
             CategoryName = result.GlobalCodeCustomValue,
         };
         return(Json(jsonResult, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 6
0
        public ActionResult SaveSecurityParameters(GlobalCodes objGlobalCode)
        {
            var globalCodeBal   = new GlobalCodeBal();
            var userId          = Helpers.GetLoggedInUserId();
            var currentDateTime = Helpers.GetInvariantCultureDateTime();

            if (string.IsNullOrEmpty(objGlobalCode.GlobalCodeValue))
            {
                var maxValue = globalCodeBal.GetMaxGlobalCodeValueByCategory(objGlobalCode.GlobalCodeCategoryValue, objGlobalCode.FacilityNumber);
                maxValue = maxValue == 0 ? 1 : maxValue + 1;
                objGlobalCode.GlobalCodeValue = Convert.ToString(maxValue);
            }

            objGlobalCode.IsDeleted = false;
            objGlobalCode.IsActive  = true;
            if (objGlobalCode.GlobalCodeID > 0)
            {
                objGlobalCode.ModifiedBy   = userId;
                objGlobalCode.ModifiedDate = currentDateTime;
            }
            else
            {
                objGlobalCode.CreatedBy   = userId;
                objGlobalCode.CreatedDate = currentDateTime;
            }
            var id = globalCodeBal.AddUpdateGlobalCodes(objGlobalCode);

            return(Json(id, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
 public ActionResult SetMaxGlobalCodeValue(string category)
 {
     using (var bal = new GlobalCodeBal())
     {
         var maxValue = bal.GetMaxGlobalCodeValueByCategory(category);
         return(Json(maxValue + 1));
     }
 }
Exemplo n.º 8
0
        // Function to chek duplicate Global Code Name
        /// <summary>
        /// Checks the duplicate sub category.
        /// </summary>
        /// <param name="GlobalCodeName">Name of the global code.</param>
        /// <param name="GlobalCodeId">The global code identifier.</param>
        /// <param name="GlobalCodeCategoryValue">The global code category value.</param>
        /// <returns></returns>
        public JsonResult CheckDuplicateSubCategory(string GlobalCodeName, int GlobalCodeId, string GlobalCodeCategoryValue)
        {
            var globalCodeBal = new GlobalCodeBal();
            var fn            = Convert.ToString(Helpers.GetDefaultFacilityId());
            var isExist       = globalCodeBal.CheckDuplicateGlobalCodeName(GlobalCodeName, GlobalCodeId, GlobalCodeCategoryValue, fn);

            return(Json(isExist, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 9
0
 //Function to get  GlobalCode for editing
 /// <summary>
 /// Gets the order sub category.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <returns></returns>
 public ActionResult GetOrderSubCategory(string id)
 {
     using (var bal = new GlobalCodeBal())
     {
         var globalCode = bal.GetGlobalCodeByGlobalCodeId(Convert.ToInt32(id));
         return(PartialView(PartialViews.AddUpdateOrderSubCategory, globalCode));
     }
 }
Exemplo n.º 10
0
 public ActionResult ChangeSubCategory(string categoryValue)
 {
     using (var bal = new GlobalCodeBal())
     {
         var maxNumber = bal.GetMaxGlobalCodeValueByCategory(categoryValue) + 1;
         return(Json(maxNumber, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// Globals the codes list.
 /// </summary>
 /// <param name="categoryValue">The category value.</param>
 /// <returns></returns>
 private List <GlobalCodeCustomModel> GlobalCodesList(string categoryValue)
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.GetAllGlobalCodes(categoryValue);
         return(list);
     }
 }
 /// <summary>
 /// Deletes the equipment.
 /// </summary>
 /// <param name="globalCodeid">The global codeid.</param>
 /// <param name="facilityNumber">The facility number.</param>
 /// <returns></returns>
 public ActionResult DeleteEquipment(int globalCodeid, string facilityNumber)
 {
     using (var gcBal = new GlobalCodeBal())
     {
         var objToReturn = gcBal.DeleteGlobalCode(globalCodeid, facilityNumber);
         return(PartialView(PartialViews.RoomEquipmentList, objToReturn));
     }
 }
Exemplo n.º 13
0
 //Function to get  GlobalCode for editing
 /// <summary>
 /// Gets the current allergy.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <returns></returns>
 public ActionResult GetCurrentAllergy(int id)
 {
     using (var bal = new GlobalCodeBal())
     {
         var globalCode = bal.GetGlobalCodeByGlobalCodeId(id);
         return(PartialView(PartialViews.AllergyMasterAddEdit, globalCode));
     }
 }
Exemplo n.º 14
0
 public ActionResult GetRecordsByCategoryValue(string categoryValue)
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.GetGCodesListByCategoryValue(categoryValue);
         return(PartialView(PartialViews.LabTestCodesListView, list));
     }
 }
Exemplo n.º 15
0
 /// <summary>
 /// Binds the allergy list.
 /// </summary>
 /// <returns></returns>
 public ActionResult BindAllergyList()
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.GetGlobalCodesByCategoriesRange(8101, 8999);
         return(PartialView(PartialViews.AllergyMasterListView, list));
     }
 }
Exemplo n.º 16
0
 public ActionResult RebindListBySubCategory1Value(string categoryValue, string selectedValue)
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.GetSubCategoriesListBySubCategory1Value(categoryValue, selectedValue);
         return(PartialView(PartialViews.DashboardSubCategoriesList, list));
     }
 }
Exemplo n.º 17
0
 public ActionResult GetIndicatorSettings(string corporateId)
 {
     using (var bal = new GlobalCodeBal())
     {
         var result = bal.GetIndicatorSettingsByCorporateId(Convert.ToString(corporateId));
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 18
0
 public ActionResult ShowDeletedRecords(string category, bool showDeleted)
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.ShowDeletedRecordsByCategoryValue(category, showDeleted);
         return(PartialView(PartialViews.GenericListView, list));
     }
 }
Exemplo n.º 19
0
 public ActionResult ShowDeletedRecords(string category, bool showDeleted)
 {
     using (var bal = new GlobalCodeBal())
     {
         var list = bal.GetGlobalCodesByCategory(category, Helpers.GetSysAdminCorporateID(),
                                                 Helpers.GetDefaultFacilityId(), Helpers.GetLoggedInUserId(), 0, out long mxGlobalCodeValue, showDeleted, isFacilityPassed: true);
         return(PartialView(PartialViews.GenericListView, list));
     }
 }
Exemplo n.º 20
0
 public ActionResult IndicatorSettings()
 {
     using (var bal = new GlobalCodeBal())
     {
         var corporateId = Helpers.GetSysAdminCorporateID();
         var model       = bal.GetIndicatorSettingsByCorporateId(Convert.ToString(corporateId));
         return(View(model));
     }
 }
        // GET: /RoomEquipment/
        #region Public Methods and Operators

        /// <summary>
        /// The index.
        /// </summary>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public ActionResult Index()
        {
            var gcBal = new GlobalCodeBal();
            var facilityEquipmentList = gcBal.GetRoomEquipmentALLList(Helpers.GetDefaultFacilityId().ToString());
            var viewtoRetrun          = new RoomEquipmentView()
            {
                GCCurrentDataView = new GlobalCodeCustomDModel(),
                GClistView        = facilityEquipmentList
            };

            return(this.View(viewtoRetrun));
        }
Exemplo n.º 22
0
        public ActionResult GetOrderTypeSubCategoriesList(string gcc, string blockNumber, bool showInActive)
        {
            var recordCount = Helpers.DefaultRecordCount;
            var facilityId  = Helpers.GetDefaultFacilityId();

            using (var bal = new GlobalCodeBal())
            {
                var list = !string.IsNullOrEmpty(gcc)
                    ? bal.GetGlobalCodesByCategoriesRangeOnDemand(gcc, Convert.ToInt32(blockNumber), recordCount, true, showInActive, facilityId: facilityId)
                    : bal.GetGlobalCodesByCategoriesRangeOnDemand(11000, 11999, Convert.ToInt32(blockNumber), recordCount, true, showInActive, facilityId: facilityId);
                return(PartialView(PartialViews.OrderSubCategoryList, list));
            }
        }
Exemplo n.º 23
0
 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));
     }
 }
Exemplo n.º 24
0
        /// <summary>
        /// Deletes the global code.
        /// </summary>
        /// <param name="globalCodeId">The global code identifier.</param>
        /// <returns></returns>
        public ActionResult DeleteGlobalCode(int globalCodeId)
        {
            var globalCodeBal = new GlobalCodeBal();
            var objGlobalCode = globalCodeBal.GetGlobalCodeByGlobalCodeId(globalCodeId);

            objGlobalCode.IsDeleted   = true;
            objGlobalCode.DeletedBy   = Helpers.GetLoggedInUserId();
            objGlobalCode.DeletedDate = Helpers.GetInvariantCultureDateTime();

            var id = globalCodeBal.AddUpdateGlobalCodes(objGlobalCode);

            //return PartialView(PartialViews.GlobalCodesList, globalCodeBal.GetAllGlobalCodes(string.Empty));
            return(Json(id));
        }
Exemplo n.º 25
0
 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));
     }
 }
Exemplo n.º 26
0
 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));
     }
 }
Exemplo n.º 27
0
        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));
            }
        }
Exemplo n.º 28
0
 //Delete global code
 /// <summary>
 /// Deletes the allergy.
 /// </summary>
 /// <param name="globalCodeId">The global code identifier.</param>
 /// <returns></returns>
 public ActionResult DeleteAllergy(int globalCodeId)
 {
     using (var bal = new GlobalCodeBal())
     {
         var gCode = bal.GetGlobalCodeByGlobalCodeId(globalCodeId);
         if (gCode != null)
         {
             gCode.IsDeleted   = true;
             gCode.DeletedBy   = Helpers.GetLoggedInUserId();
             gCode.DeletedDate = Helpers.GetInvariantCultureDateTime();
             AddUpdateGlobalCode(gCode);
             return(Json(gCode.GlobalCodeID));
         }
         return(Json(null));
     }
 }
Exemplo n.º 29
0
 //Delete global code
 /// <summary>
 /// Deletes the order sub category.
 /// </summary>
 /// <param name="globalCodeId">The global code identifier.</param>
 /// <returns></returns>
 public ActionResult DeleteOrderSubCategory(string globalCodeId)
 {
     using (var bal = new GlobalCodeBal())
     {
         var m = bal.GetGlobalCodeByGlobalCodeId(Convert.ToInt32(globalCodeId));
         if (m != null)
         {
             m.IsDeleted   = true;
             m.DeletedBy   = Helpers.GetLoggedInUserId();
             m.DeletedDate = Helpers.GetInvariantCultureDateTime();
             AddUpdateGlobalCode(m);
             return(Json(m.GlobalCodeID, JsonRequestBehavior.AllowGet));
         }
         return(Json(null));
     }
 }
        /// <summary>
        /// Saves the room equipments.
        /// </summary>
        /// <param name="globalCodeObj">The global code object.</param>
        /// <returns></returns>
        public ActionResult SaveRoomEquipments(List <GlobalCodes> globalCodeObj)
        {
            using (var gcBal = new GlobalCodeBal())
            {
                foreach (var item in globalCodeObj)
                {
                    item.CreatedDate = Helpers.GetInvariantCultureDateTime();
                    item.CreatedBy   = Helpers.GetLoggedInUserId();
                }

                var result = gcBal.AddUpdateGlobalCodesList(globalCodeObj);
                //return Json(result, JsonRequestBehavior.AllowGet);
                var facilityEquipmentList = gcBal.GetRoomEquipmentALLList(globalCodeObj[0].FacilityNumber);
                return(PartialView(PartialViews.RoomEquipmentList, facilityEquipmentList));
            }
        }