示例#1
0
        public ActionResult Edit(int Id)
        {
            eConserveCommission obj = new eConserveCommission();

            obj         = BL_ConserveCommission.GetSingleRecordById(Id);
            obj.heading = "Modify Conserve Commission";
            obj.Mode    = "Edit";
            if (obj.dtFrom != null)
            {
                obj.StayFrom = String.Format("{0:dd/MM/yyyy}", obj.dtFrom);
            }
            if (obj.dtTo != null)
            {
                obj.StayTo = String.Format("{0:dd/MM/yyyy}", obj.dtTo);
            }
            return(PartialView("_ConserveCommission", obj));
        }
示例#2
0
        //public string DeletePromoCode(int id)
        //{
        //    object result = null;
        //    string strReturn = string.Empty;

        //    try
        //    {
        //        int i = BL_Amenity.DeleteRecord(id);
        //        if (i == 1)
        //        {
        //            result = new { st = 1, msg = clsUtils.ErrorMsg("Promo Code", 5) };
        //        }
        //        else
        //        {
        //            result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };

        //    }
        //    strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
        //    return strReturn;
        //}

        //public string UpdatePromoCode(int id, string name)
        //{
        //    object result = null;
        //    string strReturn = string.Empty;

        //    try
        //    {
        //        ePromoCode obj = new ePromoCode();
        //        //obj = BL_PromoCode.GetSingleRecordById(id);
        //        obj.dtActionDate = DateTime.Now;
        //        obj.sPromoCode = name;
        //        obj.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
        //        int i = BL_PromoCode.UpdateRecord(obj);
        //        if (i == 1)
        //        {
        //            result = new { st = 1, msg = clsUtils.ErrorMsg("Promo Code", 2) };
        //        }
        //        else
        //        {
        //            result = new { st = 0, msg = clsUtils.ErrorMsg("Promo Code", 0) };
        //        }
        //    }
        //    catch (Exception)
        //    {
        //        result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };

        //    }
        //    strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
        //    return strReturn;
        //}
        public string UpdateStatus(int id, string status)
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                eConserveCommission obj = new eConserveCommission();
                obj = BL_ConserveCommission.GetSingleRecordById(id);
                obj.dtActionDate = DateTime.Now;
                obj.cStatus      = status;
                obj.iActionBy    = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
                string s = "";
                if (status == "A")
                {
                    s = BL_ConserveCommission.CheckHotelMappingWhileEditOrEnable(obj);
                }
                if (s == "")
                {
                    int i = BL_ConserveCommission.UpdateRecord(obj);
                    if (i == 1)
                    {
                        result = new { st = 1, msg = clsUtils.ErrorMsg("Conserve Commission", 4, status) };
                    }
                    else
                    {
                        result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };
                    }
                }
                else
                {
                    result = new { st = 0, msg = s };
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };
            }
            strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
            return(strReturn);
        }