Ejemplo n.º 1
0
        public ActionResult Index()
        {
            etblPropertyBiddingRateM obj = new etblPropertyBiddingRateM();

            ViewBag.rooms = BL_tblPropertyRoomMap.GetAllPropertyRoomNamesCurrency(Convert.ToInt32(Session["PropId"]));
            return(View(obj));
        }
Ejemplo n.º 2
0
        public string UpdateStatus(int Id, bool Mode)
        {
            object result    = null;
            string strReturn = string.Empty;

            try
            {
                obj         = BL_tblPropertyRoomMap.GetSingleRecordById(Id);
                obj.bActive = Mode ? true : false;
                int i = BL_tblPropertyRoomMap.UpdateRecord(obj);
                if (i == 1)
                {
                    if (Mode)
                    {
                        result = new { st = 1, msg = "Room enabled Successfully ." };
                    }
                    else
                    {
                        result = new { st = 1, msg = "Room disabled 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);
        }
Ejemplo n.º 3
0
        public ActionResult Edit(int Id)
        {
            ViewBag.HeaderText = "Modify Room";
            obj          = BL_tblPropertyRoomMap.GetSingleRecordById(Id);
            obj.Mode     = "Edit";
            obj.SizeType = obj.sSizeType;
            decimal ft = (decimal)obj.dSizeSqft;
            decimal mt = (decimal)obj.dSizeMtr;

            if (obj.SizeType == "Sq.Mtr")
            {
                obj.dSizeSqft = mt;
                obj.dSizeMtr  = ft;
            }
            else
            {
                obj.dSizeSqft = ft;
                obj.dSizeMtr  = mt;
            }

            obj.AccessibilityItems           = BL_tblRoomAccessibilityM.GetRoomAccessibility(obj.sRoomAccessibilityIds);
            obj.BuildingcharacteristicsItems = BL_tblBuildingCharacteristicsM.GetBuildingCharacteristics(obj.sBuildingCharacteristicsIds);
            obj.OutdoorViewItems             = BL_tblRoomOutdoorViewM.GetRoomOutdoorViews(obj.sRoomOutdoorViewIds);
            return(PartialView("_PropertyRoom", obj));
        }
Ejemplo n.º 4
0
 public ActionResult Add()
 {
     obj.ListTaxes     = BL_Tax.GetAllTax();
     obj.ListRatePlans = BL_tblPropertyRoomMap.GetAllPropertyTypes(Convert.ToInt32(Session["PropId"]));
     obj.Mode          = "ADD";
     ViewBag.heading   = "Add Taxes";
     return(PartialView("PropertyTax", obj));
 }
Ejemplo n.º 5
0
 public ActionResult Edit(int Id)
 {
     obj             = BL_tblPropertyTaxMap.GetSingleRecordById(Id);
     ViewBag.heading = "Modify Taxes";
     obj.Mode        = "Edit";
     if (obj.dtStayFrom != null)
     {
         obj.stayfrom = String.Format("{0:dd/MM/yyyy}", obj.dtStayFrom);
     }
     if (obj.dtStayTo != null)
     {
         obj.stayto = String.Format("{0:dd/MM/yyyy}", obj.dtStayTo);
     }
     //obj.PlanId = obj.iRoomId + "|" + obj.iRPId;
     if (obj.iRoomId == null)
     {
         obj.iRoomId = 0;
     }
     obj.ListRatePlans = BL_tblPropertyRoomMap.GetAllPropertyTypes(Convert.ToInt32(Session["PropId"]));
     obj.ListTaxes     = BL_Tax.GetAllTaxOfProperty(Id);
     return(PartialView("PropertyTax", obj));
 }
Ejemplo n.º 6
0
        public ActionResult AddUpdate(eInventoryPlan_Ph eObj)
        {
            object result = null;

            try
            {
                if (ModelState.IsValid)
                {
                    eObj.dtFrom = clsUtils.ConvertddmmyyyytoDateTime(eObj.FromDate);
                    eObj.dtTo   = clsUtils.ConvertddmmyyyytoDateTime(eObj.ToDate);

                    var res = new List <string>();
                    for (var date = eObj.dtFrom; date <= eObj.dtTo; date = date.AddDays(1))
                    {
                        res.Add(date.ToString());
                    }

                    List <PNames> RoomIds  = new List <PNames>();
                    DataTable     DateRoom = new DataTable();
                    DataColumn    col      = null;
                    col = new DataColumn("dtInventoryDate", typeof(DateTime));
                    DateRoom.Columns.Add(col);
                    col = new DataColumn("iRoomId", typeof(Int64));
                    DateRoom.Columns.Add(col);
                    int PropId = 0;
                    if (Session["PropId"] != null)
                    {
                        PropId = Convert.ToInt32(Session["PropId"]);
                    }
                    if (eObj.RoomType == true)
                    {
                        RoomIds = BL_tblPropertyRoomMap.GetAllPropertyRoomNames(PropId);
                        foreach (var ddate in res)
                        {
                            foreach (var item in RoomIds)
                            {
                                DataRow drDateRoom = DateRoom.NewRow();
                                drDateRoom["dtInventoryDate"] = ddate;
                                drDateRoom["iRoomId"]         = item.Id;
                                DateRoom.Rows.Add(drDateRoom);
                            }
                        }
                    }
                    else
                    {
                        foreach (var ddate in res)
                        {
                            DataRow drDateRoom = DateRoom.NewRow();
                            drDateRoom["dtInventoryDate"] = ddate;
                            drDateRoom["iRoomId"]         = eObj.RoomId;
                            DateRoom.Rows.Add(drDateRoom);
                        }
                    }

                    int i = BL_bulk.SaveInventoryPlan_Ph(((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId, Convert.ToInt32(Session["PropId"].ToString()), eObj.Action, DateRoom);
                    if (i == 1)
                    {
                        result = new { st = 1, msg = "Updated successfully" };
                    }
                    else
                    {
                        result = new { st = 0, msg = "Kindly try after some time" };
                    }
                }
                else
                {
                    string errormsg = "";
                    foreach (ModelState modelState in ViewData.ModelState.Values)
                    {
                        foreach (ModelError error in modelState.Errors)
                        {
                            errormsg += error.ErrorMessage;
                            errormsg += "</br>";
                        }
                    }

                    result = new { st = 0, msg = errormsg };
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = "Kindly try after some time" };
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 7
0
        public ActionResult Add(etblPropertyRoomMap eObj)
        {
            object result = null;

            try
            {
                if (ModelState.IsValid)
                {
                    decimal?sqft = 0, sqmtr = 0;
                    sqft  = eObj.dSizeSqft;
                    sqmtr = eObj.dSizeMtr;

                    if (eObj.SizeType == "Sq.Mtr")
                    {
                        eObj.dSizeSqft = sqmtr;
                        eObj.dSizeMtr  = sqft;
                    }
                    //get all room accessbility comma seperated
                    if (eObj.SelectedAccessibility != null)
                    {
                        eObj.sRoomAccessibilityIds = eObj.SelectedAccessibility.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + ", " + s2);
                    }
                    //get all room building characteristics comma seperated
                    if (eObj.SelectedBuildingcharacteristics != null)
                    {
                        eObj.sBuildingCharacteristicsIds = eObj.SelectedBuildingcharacteristics.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + ", " + s2);
                    }
                    //get all room building characteristics comma seperated
                    if (eObj.SelectedOutdoorView != null)
                    {
                        eObj.sRoomOutdoorViewIds = eObj.SelectedOutdoorView.Select(i => i.ToString(CultureInfo.InvariantCulture)).Aggregate((s1, s2) => s1 + ", " + s2);
                    }
                    eObj.dtActionDate = DateTime.Now;
                    eObj.bActive      = true;
                    eObj.sSizeType    = eObj.SizeType;

                    if (eObj.Mode == "Add")
                    {
                        eObj.iPropId   = Convert.ToInt32(Session["PropId"]);
                        eObj.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
                        int j = BL_tblPropertyRoomMap.AddRecord(eObj);
                        if (j == 1)
                        {
                            result = new { st = 1, msg = "Added Successfully ." };
                        }
                        else if (j == 2)
                        {
                            result = new { st = 0, msg = "Room Code already exists" };
                        }
                        else
                        {
                            result = new { st = 0, msg = "Kindly try after some time." };
                        }
                    }
                    else
                    {
                        eObj.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId;
                        int i = BL_tblPropertyRoomMap.UpdateRecord(eObj);
                        if (i == 1)
                        {
                            result = new { st = 1, msg = "Updated Successfully ." };
                        }
                        else if (i == 2)
                        {
                            result = new { st = 0, msg = "Room Code already exists" };
                        }
                        else
                        {
                            result = new { st = 0, msg = "Kindly try after some time." };
                        }
                    }
                }
                else
                {
                    string errormsg = "";
                    foreach (ModelState modelState in ViewData.ModelState.Values)
                    {
                        foreach (ModelError error in modelState.Errors)
                        {
                            errormsg += error.ErrorMessage;
                            errormsg += "</br>";
                        }
                    }

                    result = new { st = 0, msg = errormsg };
                }
            }
            catch (Exception)
            {
                result = new { st = 0, msg = "Kindly try after some time." };
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }