public static string GetMEssageTableCaptions(string ColumnName, string PageIDParam)
        {
            string CultureValue = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            string Caption = "";
            try
            {

                DBEntities entity = new DBEntities();
                var PageID = new SqlParameter("@PageID", PageIDParam);
                var Culture = new SqlParameter("@Culture", CultureValue);
                var ColumnCode = new SqlParameter("@ColumnCode", ColumnName);
                var result = entity.Database.SqlQuery<GetPageCaption_Result>("B_Ex_GetPageCaptions_BizTbl_PageControl_SP @PageID,@Culture,@ColumnCode", PageID, Culture, ColumnCode).ToList();
                PropertyReservationsColumn objN = new PropertyReservationsColumn();
                foreach (GetPageCaption_Result Val in result)
                {
                    Caption = Val.Caption;
                }
            }
            catch
            {

            }

            return Caption;
        }
 public bool Delete(TB_TypeHotelChainExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeHotelChain.Where(x => x.ID == model.ID).FirstOrDefault();
         DE.TB_TypeHotelChain.Remove(DepObj);
         DE.SaveChanges();
     }
     return status;
 }
        public ActionResult Edit(long id)
        {
            using (DBEntities db = new DBEntities())
            {
                UsersRepository uRepo = new UsersRepository();
                var user = uRepo.ReadAll().FirstOrDefault(u => u.UserID == id);

                user.Password = SecurityUtils.DecryptCypher(user.Password);

                return View(user);
            }
        }
 public bool Create(TB_TypeHotelChainExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeHotelChain DepObj = new TB_TypeHotelChain();
     DepObj.Name = model.Name;
     DepObj.Sort = Convert.ToInt16(model.Sorts);
     DepObj.Active = model.Active;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     insertentity.TB_TypeHotelChain.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
 public bool Create(TB_AttributeHeaderExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_AttributeHeader DepObj = new TB_AttributeHeader();
        // DepObj.ID = model.ID;
     DepObj.Code = model.Code;
     DepObj.Name_en = model.Name;
     DepObj.Sort = Convert.ToInt16(model.Sorts);
     DepObj.Active = model.Active;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = Convert.ToInt64(ctrl.Session["UserID"]);
     insertentity.TB_AttributeHeader.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
 public bool Create(ParameterExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     BizTbl_Parameter MsgObj = new BizTbl_Parameter();
     MsgObj.ID = model.ID;
     MsgObj.Code = model.Code;
     MsgObj.Value = model.Value;
     MsgObj.Description_en = model.Description;
     MsgObj.IsCommon = model.IsCommon;
     MsgObj.OpDateTime = DateTime.Now;
     MsgObj.OpUserID = Convert.ToInt64(ctrl.Session["UserID"]);
     insertentity.BizTbl_Parameter.Add(MsgObj);
     insertentity.SaveChanges();
     int id = MsgObj.ID;
     return status;
 }
 public bool Create(RegionExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_Region RegionTable = new TB_Region();
     RegionTable.ID = model.ID;
     RegionTable.CountryID = Convert.ToInt32(model.CountryID);
     RegionTable.ParentID = Convert.ToInt64(model.ParentID);
     RegionTable.SecondParentID = Convert.ToInt64(model.secondParentID);
     RegionTable.RegionType = model.RegionType;
     RegionTable.SubRegionType = model.SubRegionType;
     RegionTable.Name = model.Name;
     RegionTable.NameASCII = model.NameASCII;
     RegionTable.Name_en = model.Name_en;
     RegionTable.Name_tr = model.Name_tr;
     RegionTable.Name_de = model.Name_de;
     RegionTable.Name_es = model.Name_es;
     RegionTable.Name_fr = model.Name_fr;
     RegionTable.Name_ru = model.Name_ru;
     RegionTable.Name_it = model.Name_it;
     RegionTable.Name_ar = model.Name_ar;
     RegionTable.Name_ja = model.Name_ja;
     RegionTable.Name_pt = model.Name_pt;
     RegionTable.Name_zh = model.Name_zh;
     RegionTable.Code = model.Code;
     RegionTable.Population = Convert.ToInt64(model.Population);
     RegionTable.IsIncludedInDestinationSearch = model.IsIncludedInSearch;
     RegionTable.IsCity = model.IsCity;
     RegionTable.IsPopular = model.IsPopular;
     RegionTable.IsFilter = model.IsFilter;
     RegionTable.IsMainPageDisplay = model.IsMainPageDisplay;
     RegionTable.MainPageDisplaySort = Convert.ToInt32(model.MainPageDisplaySort);
     RegionTable.HitCount = Convert.ToInt64(model.HitCount);
     RegionTable.Sort = Convert.ToInt16(model.Sort);
     RegionTable.Latitude = model.Latitude;
     RegionTable.Longitude = model.Longitude;
     RegionTable.MapZoomIndex = Convert.ToInt32(model.MapZoomIndex);
     RegionTable.HasCityTax = model.CityTax;
     RegionTable.Active = model.Active;
     RegionTable.OpDateTime = DateTime.Now;
     RegionTable.OpUserID = Convert.ToInt64(ctrl.Session["UserID"]);
     insertentity.TB_Region.Add(RegionTable);
     insertentity.SaveChanges();
     return status;
 }
        public bool Update(MessageExt model, ref string Msg, Controller ctrl)
        {
            bool status = true;
            using (DBEntities DE = new DBEntities())
            {
                var MessageTable = DE.BizTbl_Message.Where(x => x.ID == model.ID).FirstOrDefault();
                MessageTable.Code = model.Code;
                MessageTable.Description_en = model.Description_en;
                MessageTable.Description_tr = model.Description_tr;
                MessageTable.Description_de = model.Description_de;
                MessageTable.Description_es = model.Description_es;
                MessageTable.Description_fr = model.Description_fr;
                MessageTable.Description_ru = model.Description_ru;
                MessageTable.Description_it = model.Description_it;
                MessageTable.Description_ar = model.Description_ar;
                MessageTable.Description_ja = model.Description_ja;
                MessageTable.Description_pt = model.Description_pt;
                MessageTable.Description_zh = model.Description_zh;
                MessageTable.IsCommon = model.IsCommon;
                MessageTable.OpDateTime = DateTime.Now;
                MessageTable.OpUserID = Convert.ToInt64(ctrl.Session["UserID"]);
                DE.SaveChanges();
            }

            //var IDParam = new SqlParameter("@ID", model.ID);
            //var CodeParam = new SqlParameter("@Code", model.Code);
            //var Description_trparam = new SqlParameter("@Description_tr", model.Description_tr);
            //var Description_enparam = new SqlParameter("@Description_en", model.Description_en);
            //var Description_deparam = new SqlParameter("@Description_de", model.Description_de);
            //var Description_esparam = new SqlParameter("@Description_es", model.Description_es);
            //var Description_frParam = new SqlParameter("@Description_fr", model.Description_fr);
            //var Description_ruparam = new SqlParameter("@Description_ru", model.Description_ru);
            //var Description_itparam = new SqlParameter("@Description_it", model.Description_it);
            //var Description_arparam = new SqlParameter("@Description_ar", model.Description_ar);
            //var Description_jaParam = new SqlParameter("@Description_ja", model.Description_ja);
            //var Description_ptParam = new SqlParameter("@Description_pt", model.Description_pt);
            //var Description_zhparam = new SqlParameter("@Description_zh", model.Description_zh);
            //var IsCommonparam = new SqlParameter("@IsCommon", model.IsCommon);
            //var i = updateentity.Database.ExecuteSqlCommand("B_Ex_Update_BizTbl_Message_SP @ID,@Code,@Description_tr,@Description_en,@Description_de,@Description_es,@Description_fr,@Description_ru,@Description_it,@Description_ar,@Description_ja,@Description_pt,@Description_zh,@IsCommon", IDParam, CodeParam, Description_trparam, Description_enparam, Description_deparam, Description_esparam, Description_frParam, Description_ruparam, Description_itparam, Description_itparam, Description_arparam, Description_jaParam, Description_ptParam, Description_zhparam, IsCommonparam);
            return status;
        }
        public ActionResult _Destroy([DataSourceRequest]DataSourceRequest request, UsersExt userExt)
        {
            using (DBEntities db = new DBEntities())
            {
                try
                {
                    UsersRepository uRepo = new UsersRepository();
                    uRepo.Delete(userExt, this);
                }
                catch (Exception ex)
                {
                    ErrorHandling.HandleModelStateException(ex, ModelState);
                    ErrorHandling.SetErrorCode(ex);
                    throw new Exception("");
                }
            }

            return Json(request);
        }
 public bool Create(TB_TransferExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_Transfer DepObj = new TB_Transfer();
     //DepObj.ID = model.ID;
     DepObj.BusinessPartnerID = model.BusinessPartnerID;
     DepObj.CostCurrencyID = model.CostCurrencyID;
     DepObj.CurrencyID = model.CurrencyID;
     DepObj.TransferPaxID = model.TransferPaxID;
     DepObj.DepartureRegionID = model.DepartureRegionID;
     DepObj.DepositCurrencyID = model.DepositCurrencyID;
     DepObj.TransferPeriodID = model.TransferPeriodID;
     DepObj.Deposit = model.Deposit;
     DepObj.Amount = model.Amount;
     DepObj.Cost = model.Amount;
     DepObj.HitCount = model.HitCount;
     DepObj.Active = model.Active;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.CreateDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     DepObj.CreateUserID = 0;
     insertentity.TB_Transfer.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
        public static string GetRegionTableCaptions(string ColumnName, string TableNameParam)
        {
            string CultureValue = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
                string Caption = "";
                try
                {

                    DBEntities entity = new DBEntities();
                    var TableName = new SqlParameter("@TableName", TableNameParam);
                    var Culture = new SqlParameter("@Culture", CultureValue);
                    var MessageCode = new SqlParameter("@MessageCode", ColumnName);
                    var result = entity.Database.SqlQuery<GetTableCaptionValue_Result>("B_Ex_GetCaptionValues_BizTbl_TableColumn_SP @TableName,@Culture,@MessageCode", TableName, Culture, MessageCode).ToList();
                    RegionCaption objN = new RegionCaption();
                    foreach (GetTableCaptionValue_Result Val in result)
                    {
                        string name = Val.Name;
                        Caption = Val.Caption;
                        if (Caption == "")
                        {
                            Caption = Val.Name;
                        }
                    }
                }
                catch
                {

                }

                return Caption;
        }
        protected override ResourceEntry ReadResource(string name, string culture)
        {
            ResourceEntry resource = null;

            var resources = new List<ResourceEntry>();

            using (DBEntities db = new DBEntities())
            {
                var dbculture = db.BizTbl_Message.ToList();

                foreach (var item in dbculture)
                {
                    {
                        //Türkçe
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "tr-TR";
                        rs.Name = item.Code;
                        rs.Value = item.Description_tr;
                        resources.Add(rs);
                    }

                    {
                        //English us
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "en-us";
                        rs.Name = item.Code;
                        rs.Value = item.Description_en;
                        resources.Add(rs);
                    }

                    {
                        //English GB
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "en-gb";
                        rs.Name = item.Code;
                        rs.Value = item.Description_en;
                        resources.Add(rs);
                    }

                    {
                        //Deutsch
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "de-DE";
                        rs.Name = item.Code;
                        rs.Value = item.Description_de;
                        resources.Add(rs);
                    }

                    {
                        //Español
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "es-ES";
                        rs.Name = item.Code;
                        rs.Value = item.Description_es;
                        resources.Add(rs);
                    }

                    {
                        //Français
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "fr-FR";
                        rs.Name = item.Code;
                        rs.Value = item.Description_fr;
                        resources.Add(rs);
                    }

                    {
                        //Русский
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ru-RU";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ru;
                        resources.Add(rs);
                    }
                    {
                        //Italiano
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "it-IT";
                        rs.Name = item.Code;
                        rs.Value = item.Description_it;
                        resources.Add(rs);
                    }

                    {
                        //العربية Arabic
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ar-SA";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ar;
                        resources.Add(rs);
                    }

                    {
                        //Japanes 日本人
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ja-JP";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ja;
                        resources.Add(rs);
                    }

                    {
                        //Português Portugal
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "pt-PT";
                        rs.Name = item.Code;
                        rs.Value = item.Description_pt;
                        resources.Add(rs);
                    }

                    {
                        //Chinese
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "zh-CN";
                        rs.Name = item.Code;
                        rs.Value = item.Description_zh;
                        resources.Add(rs);
                    }
                }

                resource = resources.FirstOrDefault(f => f.Culture == culture);

            }

            //const string sql = "select Culture, Name, Value from dbo.Resources where culture = @culture and name = @name;";

            //using (var con = new SqlConnection(connectionString)) {
            //    var cmd = new SqlCommand(sql, con);

            //    cmd.Parameters.AddWithValue("@culture", culture);
            //    cmd.Parameters.AddWithValue("@name", name);

            //    con.Open();

            //    using (var reader = cmd.ExecuteReader()) {
            //        if (reader.Read()) {
            //            resource = new ResourceEntry {
            //                Name = reader["Name"].ToString(),
            //                Value = reader["Value"].ToString(),
            //                Culture = reader["Culture"].ToString()
            //            };
            //        }

            //        if (!reader.HasRows) throw new Exception(string.Format("Resource {0} for culture {1} was not found", name, culture));
            //    }
            //}

            return resource;
        }
 public bool Create(TB_TypeSalutationExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeSalutation DepObj = new TB_TypeSalutation();
     DepObj.Name_en = model.Name_en;
     DepObj.Name_tr = model.Name_tr;
     DepObj.Name_de = model.Name_de;
     DepObj.Name_es = model.Name_es;
     DepObj.Name_fr = model.Name_fr;
     DepObj.Name_ru = model.Name_ru;
     DepObj.Name_it = model.Name_it;
     DepObj.Name_ar = model.Name_ar;
     DepObj.Name_ja = model.Name_ja;
     DepObj.Name_pt = model.Name_pt;
     DepObj.Name_zh = model.Name_zh;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     insertentity.TB_TypeSalutation.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
 public bool Update(TB_TypeHotelBudgetExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeHotelBudget.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.CurrencyID = model.CurrencyID;
         DepObj.EndValue = model.EndValue;
         DepObj.Margin = model.Margin;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DE.SaveChanges();
     }
     return status;
 }
        public bool Delete(ParameterExt model, ref string Msg, Controller ctrl)
        {
            bool status = true;

            using (DBEntities DE = new DBEntities())
            {
                var MessageTable = DE.BizTbl_Parameter.Where(x => x.ID == model.ID).FirstOrDefault();
                DE.BizTbl_Parameter.Remove(MessageTable);
                DE.SaveChanges();
            }
            return status;
        }
 public bool Update(ParameterExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var MessageTable = DE.BizTbl_Parameter.Where(x => x.ID == model.ID).FirstOrDefault();
         MessageTable.Code = model.Code;
         MessageTable.Value = model.Value;
         MessageTable.Description_en = model.Description;
         MessageTable.IsCommon = model.IsCommon;
         MessageTable.OpDateTime = DateTime.Now;
         MessageTable.OpUserID = model.OpUserID;
         DE.SaveChanges();
     }
     return status;
 }
        public static string GetPageTitle(string TableNameParam)
        {
            string CultureValue = System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            string Caption = "";
            try
            {

                DBEntities entity = new DBEntities();
                var TableName = new SqlParameter("@Name", TableNameParam);
                var Culture = new SqlParameter("@Culture", CultureValue);
                var result = entity.Database.SqlQuery<GetPageTitle_Result>("B_Ex_GetpageTitle_BizTbl_Table_SP @Culture,@Name", Culture, TableName).ToList();
                MessageCaption objN = new MessageCaption();
                foreach (GetPageTitle_Result Val in result)
                {
                    Caption = Val.ColumnName;
                    if (Caption == "")
                    {
                        Caption = Val.ColumnName;
                    }
                }
            }
            catch
            {

            }

            return Caption;
        }
 public bool Update(TB_TransferExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_Transfer.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.BusinessPartnerID = model.BusinessPartnerID;
         DepObj.CostCurrencyID = model.CostCurrencyID;
         DepObj.CurrencyID = model.CurrencyID;
         DepObj.TransferPaxID = model.TransferPaxID;
         DepObj.DepartureRegionID = model.DepartureRegionID;
         DepObj.DepositCurrencyID = model.DepositCurrencyID;
         DepObj.TransferPeriodID = model.TransferPeriodID;
         DepObj.Deposit = model.Deposit;
         DepObj.Amount = model.Amount;
         DepObj.Cost = model.Amount;
         DepObj.HitCount = model.HitCount;
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DE.SaveChanges();
     }
     return status;
 }
 public bool Delete(RegionExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var RegionTable = DE.TB_Region.Where(x => x.ID == model.ID).FirstOrDefault();
         DE.TB_Region.Remove(RegionTable);
         DE.SaveChanges();
     }
     return status;
 }
 public bool Create(TB_TypeHotelBudgetExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeHotelBudget DepObj = new TB_TypeHotelBudget();
     //DepObj.ID = model.ID;
     DepObj.CurrencyID = model.CurrencyID;
     DepObj.EndValue = model.EndValue;
     DepObj.Margin = model.Margin;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     insertentity.TB_TypeHotelBudget.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
 public bool Update(RegionExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var RegionTable = DE.TB_Region.Where(x => x.ID == model.ID).FirstOrDefault();
         RegionTable.ID = model.ID;
         RegionTable.CountryID = Convert.ToInt32(model.CountryID);
         RegionTable.ParentID = Convert.ToInt64(model.ParentID);
         RegionTable.SecondParentID = Convert.ToInt64(model.secondParentID);
         RegionTable.RegionType = model.RegionType;
         RegionTable.SubRegionType = model.SubRegionType;
         RegionTable.Name = model.Name;
         RegionTable.NameASCII = model.NameASCII;
         RegionTable.Name_en = model.Name_en;
         RegionTable.Name_tr = model.Name_tr;
         RegionTable.Name_de = model.Name_de;
         RegionTable.Name_es = model.Name_es;
         RegionTable.Name_fr = model.Name_fr;
         RegionTable.Name_ru = model.Name_ru;
         RegionTable.Name_it = model.Name_it;
         RegionTable.Name_ar = model.Name_ar;
         RegionTable.Name_ja = model.Name_ja;
         RegionTable.Name_pt = model.Name_pt;
         RegionTable.Name_zh = model.Name_zh;
         RegionTable.Code = model.Code;
         RegionTable.Population = Convert.ToInt64(model.Population);
         RegionTable.IsIncludedInDestinationSearch = model.IsIncludedInSearch;
         RegionTable.IsCity = model.IsCity;
         RegionTable.IsPopular = model.IsPopular;
         RegionTable.IsFilter = model.IsFilter;
         RegionTable.IsMainPageDisplay = model.IsMainPageDisplay;
         RegionTable.MainPageDisplaySort = Convert.ToInt32(model.MainPageDisplaySort);
         RegionTable.HitCount = Convert.ToInt64(model.HitCount);
         RegionTable.Sort = Convert.ToInt16(model.Sort);
         RegionTable.Latitude = model.Latitude;
         RegionTable.Longitude = model.Longitude;
         RegionTable.MapZoomIndex = Convert.ToInt32(model.MapZoomIndex);
         RegionTable.HasCityTax = model.CityTax;
         RegionTable.Active = model.Active;
         DE.SaveChanges();
     }
     return status;
 }
 public bool Create(TB_TypeHotelClassExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeHotelClass DepObj = new TB_TypeHotelClass();
     DepObj.Code = model.Code;
     DepObj.Name_en = model.Name_en;
     DepObj.Name_tr = model.Name_tr;
     DepObj.Name_de = model.Name_de;
     DepObj.Name_es = model.Name_es;
     DepObj.Name_fr = model.Name_fr;
     DepObj.Name_ru = model.Name_ru;
     DepObj.Name_it = model.Name_it;
     DepObj.Name_ar = model.Name_ar;
     DepObj.Name_ja = model.Name_ja;
     DepObj.Name_pt = model.Name_pt;
     DepObj.Name_zh = model.Name_zh;
     DepObj.Sort = Convert.ToInt16(model.Sorts);
     DepObj.Active = model.Active;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     insertentity.TB_TypeHotelClass.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
        protected override IList<ResourceEntry> ReadResources()
        {
            var resources = new List<ResourceEntry>();

            using (DBEntities db = new DBEntities())
            {
                var culture = db.BizTbl_Message.ToList();

                foreach (var item in culture)
                {
                    {
                        //Türkçe
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "tr-TR";
                        rs.Name = item.Code;
                        rs.Value = item.Description_tr;
                        resources.Add(rs);
                    }

                    {
                        //English us
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "en-us";
                        rs.Name = item.Code;
                        rs.Value = item.Description_en;
                        resources.Add(rs);
                    }

                    {
                        //English GB
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "en-gb";
                        rs.Name = item.Code;
                        rs.Value = item.Description_en;
                        resources.Add(rs);
                    }

                    {
                        //Deutsch
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "de-DE";
                        rs.Name = item.Code;
                        rs.Value = item.Description_de;
                        resources.Add(rs);
                    }

                    {
                        //Español
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "es-ES";
                        rs.Name = item.Code;
                        rs.Value = item.Description_es;
                        resources.Add(rs);
                    }

                    {
                        //Français
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "fr-FR";
                        rs.Name = item.Code;
                        rs.Value = item.Description_fr;
                        resources.Add(rs);
                    }

                    {
                        //Русский
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ru-RU";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ru;
                        resources.Add(rs);
                    }
                    {
                        //Italiano
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "it-IT";
                        rs.Name = item.Code;
                        rs.Value = item.Description_it;
                        resources.Add(rs);
                    }

                    {
                        //العربية Arabic
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ar-SA";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ar;
                        resources.Add(rs);
                    }

                    {
                        //Japanes 日本人
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "ja-JP";
                        rs.Name = item.Code;
                        rs.Value = item.Description_ja;
                        resources.Add(rs);
                    }

                    {
                        //Português Portugal
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "pt-PT";
                        rs.Name = item.Code;
                        rs.Value = item.Description_pt;
                        resources.Add(rs);
                    }

                    {
                        //Chinese
                        ResourceEntry rs = new ResourceEntry();
                        rs.Culture = "zh-CN";
                        rs.Name = item.Code;
                        rs.Value = item.Description_zh;
                        resources.Add(rs);
                    }
                }
            }

            //const string sql = "select Culture, Name, Value from dbo.Resources;";

            //using (var con = new SqlConnection(connectionString)) {
            //    var cmd = new SqlCommand(sql, con);

            //    con.Open();

            //    using (var reader = cmd.ExecuteReader()) {
            //        while (reader.Read()) {
            //            resources.Add(new ResourceEntry {
            //                Name = reader["Name"].ToString(),
            //                Value = reader["Value"].ToString(),
            //                Culture = reader["Culture"].ToString()
            //            });
            //        }

            //        if (!reader.HasRows) throw new Exception("No resources were found");
            //    }
            //}

            return resources;
        }
        public List<MessageExt> GetAllMessages()
        {
            DBEntities entity = new DBEntities();
            var result = entity.Database.SqlQuery<BizTbl_Message>("B_EX_GetAllMessage_BizTbl_Message_SP").ToList();
            List<MessageExt> ListOfModel = new List<MessageExt>();
            DataTable dt = new DataTable();
            dt.Columns.Add("ID");
            dt.Columns.Add("Code");
            dt.Columns.Add("Description_en");
            dt.Columns.Add("Description_tr");
            dt.Columns.Add("Description_de");
            dt.Columns.Add("Description_es");
            dt.Columns.Add("Description_fr");
            dt.Columns.Add("Description_ru");
            dt.Columns.Add("Description_it");
            dt.Columns.Add("Description_ar");
            dt.Columns.Add("Description_ja");
            dt.Columns.Add("Description_pt");
            dt.Columns.Add("Description_zh");
            dt.Columns.Add("IsCommon");
            foreach (BizTbl_Message dr in result)
            {
                dt.Rows.Add(dr.ID, dr.Code, dr.Description_en, dr.Description_tr, dr.Description_de, dr.Description_es, dr.Description_fr,
                    dr.Description_ru, dr.Description_it, dr.Description_ar, dr.Description_ja, dr.Description_pt, dr.Description_zh, dr.IsCommon);
            }

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    MessageExt MsgObj = new MessageExt();
                    MsgObj.ID = Convert.ToInt32(dr["ID"]);
                    MsgObj.Code = dr["Code"].ToString();
                    MsgObj.Description_en = dr["Description_en"].ToString();
                    MsgObj.Description_tr = dr["Description_tr"].ToString();
                    MsgObj.Description_de = dr["Description_de"].ToString();
                    MsgObj.Description_es = dr["Description_es"].ToString();
                    MsgObj.Description_fr = dr["Description_fr"].ToString();
                    MsgObj.Description_ru = dr["Description_ru"].ToString();
                    MsgObj.Description_it = dr["Description_it"].ToString();
                    MsgObj.Description_ar = dr["Description_ar"].ToString();
                    MsgObj.Description_ja = dr["Description_ja"].ToString();
                    MsgObj.Description_pt = dr["Description_pt"].ToString();
                    MsgObj.Description_zh = dr["Description_zh"].ToString();
                    MsgObj.IsCommon = Convert.ToBoolean(dr["IsCommon"].ToString());
                    ListOfModel.Add(MsgObj);
                }
            }

            return ListOfModel;
        }
 public bool Update(TB_PromotionExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_Promotion.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.PartID = model.PartID;
         switch (CultureCode)
         {
             case "en": //ID from BizTbl_Table for this Table
                 DepObj.Name_en = model.Name;
                 DepObj.Description_en = model.Description;
                 break;
             case "tr":
                 DepObj.Name_tr = model.Name;
                 DepObj.Description_tr = model.Description;
                 break;
             case "de":
                 DepObj.Name_de = model.Name;
                 DepObj.Description_de = model.Description;
                 break;
             case "es":
                 DepObj.Name_es = model.Name;
                 DepObj.Description_es = model.Description;
                 break;
             case "fr":
                 DepObj.Name_fr = model.Name;
                 DepObj.Description_fr = model.Description;
                 break;
             case "ru":
                 DepObj.Name_ru = model.Name;
                 DepObj.Description_ru = model.Description;
                 break;
             case "it":
                 DepObj.Name_it = model.Name;
                 DepObj.Description_it = model.Description;
                 break;
             case "ar":
                 DepObj.Name_ar = model.Name;
                 DepObj.Description_ar = model.Description;
                 break;
             case "ja":
                 DepObj.Name_ja = model.Name;
                 DepObj.Description_ja = model.Description;
                 break;
             case "pt":
                 DepObj.Name_pt = model.Name;
                 DepObj.Description_pt = model.Description;
                 break;
             case "zh":
                 DepObj.Name_zh = model.Name;
                 DepObj.Description_zh = model.Description;
                 break;
             default:
                 break;
         }
         DepObj.Type = model.Type;
         DepObj.GeneralPromotion = model.GeneralPromotion;
         DepObj.StartDate = model.StartDate;
         DepObj.TargetStartDate = model.TargetStartDate;
         DepObj.TargetEndDate = model.TargetEndDate;
         DepObj.Count = model.Count;
         DepObj.DiscountPercentage = model.DiscountPercentage;
         DepObj.RegionID = model.RegionID;
         DepObj.Sort = Convert.ToInt16(model.Sorts);
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DE.SaveChanges();
     }
     return status;
 }
 public bool Update(TB_TypeHotelChainExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeHotelChain.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.Name = model.Name;
         DepObj.Sort = Convert.ToInt16(model.Sorts);
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DepObj.Sort = Convert.ToInt16(model.Sorts);
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DE.SaveChanges();
     }
     return status;
 }
 public bool Update(TB_AttributeHeaderExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_AttributeHeader.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.Code = model.Code;
         DepObj.Name_en = model.Name;
         DepObj.Sort = Convert.ToInt16(model.Sorts);
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = Convert.ToInt64(ctrl.Session["UserID"]);
         DE.SaveChanges();
     }
     return status;
 }
 public bool Create(TB_TypeReviewScaleExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeReviewScale DepObj = new TB_TypeReviewScale();
     DepObj.ID = model.ID;
     DepObj.Name_en = model.Name_en;
     DepObj.Name_tr = model.Name_tr;
     DepObj.Name_de = model.Name_de;
     DepObj.Name_es = model.Name_es;
     DepObj.Name_fr = model.Name_fr;
     DepObj.Name_ru = model.Name_ru;
     DepObj.Name_it = model.Name_it;
     DepObj.Name_ar = model.Name_ar;
     DepObj.Name_ja = model.Name_ja;
     DepObj.Name_pt = model.Name_pt;
     DepObj.Name_zh = model.Name_zh;
     DepObj.Point = Convert.ToDecimal(model.Points);
     DepObj.Active = model.Active;
     DepObj.OpDateTime = DateTime.Now;
     DepObj.OpUserID = 0;
     insertentity.TB_TypeReviewScale.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }
 public bool Update(TB_TypeHotelClassExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeHotelClass.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.Code = model.Code;
         DepObj.Name_en = model.Name_en;
         DepObj.Name_tr = model.Name_tr;
         DepObj.Name_de = model.Name_de;
         DepObj.Name_es = model.Name_es;
         DepObj.Name_fr = model.Name_fr;
         DepObj.Name_ru = model.Name_ru;
         DepObj.Name_it = model.Name_it;
         DepObj.Name_ar = model.Name_ar;
         DepObj.Name_ja = model.Name_ja;
         DepObj.Name_pt = model.Name_pt;
         DepObj.Name_zh = model.Name_zh;
         DepObj.Sort = Convert.ToInt16(model.Sorts);
         DepObj.Active = model.Active;
         DepObj.OpDateTime = DateTime.Now;
         DepObj.OpUserID = 0;
         DE.SaveChanges();
     }
     return status;
 }
        public bool Delete(MessageExt model, ref string Msg, Controller ctrl)
        {
            bool status = true;
            //DBEntities insertentity = new DBEntities();
            //var IDParam = new SqlParameter("@ID", model.ID);
            //int i = insertentity.Database.ExecuteSqlCommand("B_Ex_Delete_BizTbl_Message_SP @ID", IDParam);

            using (DBEntities DE = new DBEntities())
            {
                var MessageTable = DE.BizTbl_Message.Where(x => x.ID == model.ID).FirstOrDefault();
                DE.BizTbl_Message.Remove(MessageTable);
                DE.SaveChanges();
            }
            return status;
        }