/// <summary>
        /// Delete the current DashboardIndicators based on the DashboardIndicators ID passed in the DashboardIndicatorsModel
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public ActionResult DeleteDashboardIndicators(int id)
        {
            using (var bal = new DashboardIndicatorsBal())
            {
                //Get DashboardIndicators model object by current DashboardIndicators ID
                var model     = bal.GetDashboardIndicatorsById(id);
                var isDeleted = false;
                var list      = new List <DashboardIndicatorsCustomModel>();
                //Check If DashboardIndicators model is not null
                if (model != null)
                {
                    model.IsActive = 0;

                    //Update Operation of current DashboardIndicators
                    isDeleted = bal.DeleteIndicator(model);
                    //return deleted ID of current DashboardIndicators as Json Result to the Ajax Call.
                    using (var dashboardIndicatorDataBal = new DashboardIndicatorDataBal())
                    {
                        dashboardIndicatorDataBal.BulkInactiveDashboardIndicatorData(model.IndicatorNumber, Helpers.GetSysAdminCorporateID());
                    }

                    bal.UpdateIndicatorsOtherDetail(model);
                }
                //var orderByExpression = HtmlExtensions.GetOrderByExpression<DashboardIndicatorsCustomModel>("Dashboard");
                //list = HtmlExtensions.OrderByDir<DashboardIndicatorsCustomModel>(list, "ASC", orderByExpression);
                //return PartialView(PartialViews.DashboardIndicatorsList, list);
                return(Json(isDeleted));
            }
            //Pass the ActionResult with List of DashboardIndicatorsViewModel object to Partial View DashboardIndicatorsList
        }
        /// <summary>
        /// Add New or Update the DashboardIndicators based on if we pass the DashboardIndicators ID in the DashboardIndicatorsViewModel object.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>
        /// returns the newly added or updated ID of DashboardIndicators row
        /// </returns>
        public ActionResult SaveDashboardIndicatorsV1(DashboardIndicators model)
        {
            var userId      = Helpers.GetLoggedInUserId();
            var currentDate = Helpers.GetInvariantCultureDateTime();
            var list        = new List <DashboardIndicatorsCustomModel>();

            //Check if Model is not null
            if (model != null)
            {
                model.CorporateId = Helpers.GetSysAdminCorporateID();
                using (var bal = new DashboardIndicatorsBal())
                {
                    if (model.IndicatorID == 0)
                    {
                        model.CreatedBy   = userId;
                        model.CreatedDate = currentDate;
                    }
                    using (var dashboardIndicatorDataBal = new DashboardIndicatorDataBal())
                    {
                        switch (model.IsActive)
                        {
                        case 0:
                            dashboardIndicatorDataBal.BulkInactiveDashboardIndicatorData(model.IndicatorNumber,
                                                                                         Helpers.GetSysAdminCorporateID());
                            break;

                        default:
                            dashboardIndicatorDataBal.BulkActiveDashboardIndicatorData(model.IndicatorNumber,
                                                                                       Helpers.GetSysAdminCorporateID());
                            break;
                        }
                    }
                    using (var oDashboardIndicatorDataBal = new DashboardIndicatorDataBal())
                    {
                        oDashboardIndicatorDataBal.GenerateIndicatorEffects(model);
                    }
                    list = bal.SaveDashboardIndicatorsV1(model);

                    //Add by shashank to check the Special case for the Indicator i.e. is the Target/Budget is static for indicator
                    //.... Should only Call for Dashboard type = Budget (Externalvalue1='1')
                    if (!string.IsNullOrEmpty(model.IndicatorNumber) && model.ExternalValue4.ToLower() == "true")
                    {
                        using (var ibal = new DashboardIndicatorDataBal())
                            ibal.SetStaticBudgetTargetIndciators(model);
                    }
                    using (var oDashboardIndicatorDataBal = new DashboardIndicatorDataBal())
                    {
                        oDashboardIndicatorDataBal.GenerateIndicatorEffects(model);
                        oDashboardIndicatorDataBal.UpdateCalculateIndicatorUpdate(model);
                    }
                    //Call the AddDashboardIndicators Method to Add / Update current DashboardIndicators
                    var orderByExpression = HtmlExtensions.GetOrderByExpression <DashboardIndicatorsCustomModel>("Dashboard");
                    list = HtmlExtensions.OrderByDir <DashboardIndicatorsCustomModel>(list, "ASC", orderByExpression);
                }
            }
            //Pass the ActionResult with List of DashboardIndicatorsViewModel object to Partial View DashboardIndicatorsList
            return(PartialView(PartialViews.DashboardIndicatorsList, list));
        }