Example #1
0
        public string UpdateStatus(int id, string status)
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                eAmenity obj = new eAmenity();
                obj = BL_Amenity.GetSingleRecordById(id);
                obj.dtActionDate = DateTime.Now;
                obj.cStatus      = status;
                obj.iActionBy    = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
                int i = BL_Amenity.UpdateRecord(obj);
                if (i == 1)
                {
                    result = new { st = 1, msg = clsUtils.ErrorMsg("Amenity", 4, status) };
                }
                else
                {
                    result = new { st = 0, msg = clsUtils.ErrorMsg("Amenity", 0) };
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };
            }
            strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
            return(strReturn);
        }
Example #2
0
        public string GetApplicabilitiesList()
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                List <eApplicability> AM = new List <eApplicability>();
                AM = BL_Amenity.GetAllApplicabilities();

                strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(AM);
                result    = new { st = 1, msg = strReturn };
            }
            catch (Exception)
            {
                result = new { st = 0, msg = "Kindly try after some time." };
            }
            strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
            return(strReturn);
        }
Example #3
0
        public string AddAmenity(string name)
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                eAmenity eObj = new eAmenity();
                eObj.sAmenityName = name;
                eObj.dtActionDate = DateTime.Now;
                eObj.cStatus      = "A";
                eObj.iActionBy    = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
                if (name.Trim() == "")
                {
                    result = new { st = 0, msg = clsUtils.ErrorMsg("", 9) };
                }
                else
                {
                    int i = BL_Amenity.AddRecord(eObj);
                    if (i == 1)
                    {
                        result = new { st = 1, msg = clsUtils.ErrorMsg("Amenity", 1) };
                    }
                    else if (i == 2)
                    {
                        result = new { st = 0, msg = clsUtils.ErrorMsg("Amenity", 0) };
                    }
                    else
                    {
                        result = new { st = 0, msg = clsUtils.ErrorMsg("Amenity", 3) };
                    }
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = clsUtils.ErrorMsg("", 3) };
            }
            strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
            return(strReturn);
        }
Example #4
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);
        }
Example #5
0
        public string DeleteAmenity(int id)
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                int i = BL_Amenity.DeleteRecord(id);
                if (i == 1)
                {
                    result = new { st = 1, msg = "Deleted successfully." };
                }
                else
                {
                    result = new { st = 0, msg = "Kindly try after some time." };
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = "Kindly try after some time." };
            }
            strReturn = OneFineRateAppUtil.clsUtils.ConvertToJson(result);
            return(strReturn);
        }