public void Getunitcurrencydropdown(PropertyConditionsExt HotelPropertyConditions)
 {
     ViewBag.propertyunit = DropDownLists.Getunitdropdown(HotelPropertyConditions.UnitID);
 }
        public JsonResult DisplayPropertyconditions()
        {
            AssignBizContext();
            int HotelID = BizContext.HotelID;

            DataTable AttributeHeader = new DataTable();
            DataTable HotelAttribute = new DataTable();
            DataTable Attributes = new DataTable();
            List<PropertyConditionsExt> PropertyConditions = new List<PropertyConditionsExt>();
            PropertyConditionsRepository modelRepo = new PropertyConditionsRepository();
            try {
            AttributeHeader = modelRepo.GetAttributeHeaders();
            Attributes = modelRepo.GetAttributes();
            HotelAttribute = modelRepo.HotelPropertyConditions(HotelID);

            foreach (DataRow AttributeHeaders in AttributeHeader.Rows)
            {
                foreach (DataRow CommonAttributes in Attributes.Rows)
                {

                    if (Convert.ToInt32(CommonAttributes["AttributeHeaderID"]) == Convert.ToInt32(AttributeHeaders["ID"]))
                    {
                        PropertyConditionsExt Obj = new PropertyConditionsExt();
                        Obj.AttributeId = Convert.ToInt32(CommonAttributes["ID"].ToString());
                        Obj.AttributeName = CommonAttributes["Name"].ToString();
                        Obj.AttributeHeaderId = CommonAttributes["AttributeHeaderID"].ToString();
                        Obj.AttributeHeaderName = AttributeHeaders["Name"].ToString();
                        Obj.AttributeHeaderCode = AttributeHeaders["Code"].ToString();
                        int AttributeId = Convert.ToInt32(CommonAttributes["ID"].ToString());
                        int AttributeHeaderID = Convert.ToInt32(CommonAttributes["AttributeHeaderID"].ToString());
                        DataRow[] hotelRoomAttribute = HotelAttribute.Select("AttributeID=" + AttributeId);
                        Obj.hasAttribute = (hotelRoomAttribute.Length > 0);

                        if (Obj.hasAttribute == true)
                        {
                            DataRow HotelAttributes = HotelAttribute.Select("AttributeID=" + AttributeId + " AND AttributeHeaderID=" + AttributeHeaderID)[0];
                            Obj.UnitValue = HotelAttributes["UnitValue"].ToString();
                            Obj.charge = Convert.ToBoolean(HotelAttributes["Charged"]);
                            bool charge1 = Convert.ToBoolean(HotelAttributes["Charged"]);
                            Obj.checkedradio = "checked";
                            if (charge1 == true)
                            {
                               Obj.UnitID = HotelAttributes["UnitID"].ToString();
                               Obj.HotelUnitID = HotelAttributes["HotelUnitID"].ToString();
                               Obj.HotelUnitName = HotelAttributes["HotelUnitName"].ToString();
                               string charge = HotelAttributes["Charge"].ToString();
                               if (charge != "")
                               {
                                   Obj.Chargedvalue = HotelAttributes["Charge"].ToString();
                               }
                               else
                               {
                                   Obj.Chargedvalue = "0.00";
                               }

                            Obj.CurrencyID = HotelAttributes["CurrencyID"].ToString();
                            Obj.Currency = HotelAttributes["CurrencySymbolWithCode"].ToString();
                            }

                        }

                        //
                        PropertyConditions.Add(Obj);
                    }

                }
            }
            }
            catch (Exception ex)
            {
                string hostName1 = Dns.GetHostName();
                string GetUserIPAddress = Dns.GetHostByName(hostName1).AddressList[0].ToString();
                string PageName = Convert.ToString(Session["PageName"]);
                //string GetUserIPAddress = GetUserIPAddress1();
                using (BaseRepository baseRepo = new BaseRepository())
                {
                    //BizContext BizContext1 = new BizContext();
                    BizApplication.AddError(baseRepo.BizDB, PageName, ex.Message, ex.StackTrace, DateTime.Now, GetUserIPAddress);
                }
                Session["PageName"] = "";
                string error = ErrorHandling.HandleException(ex);
                return this.Json(new DataSourceResult { Errors = error });
            }

            return Json(PropertyConditions, JsonRequestBehavior.AllowGet);
        }
 public void Getcurrencydropdown(PropertyConditionsExt HotelPropertyConditions)
 {
     ViewBag.propertycurrency = DropDownLists.Getcurrencydropdown(HotelPropertyConditions.CurrencyID);
 }