public bool Update(TB_TypeReservationStatusExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeReservationStatus.Where(x => x.ID == model.ID).FirstOrDefault();
         DepObj.PartID = model.PartID;
         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(TB_TypeReservationStatusExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     using (DBEntities DE = new DBEntities())
     {
         var DepObj = DE.TB_TypeReservationStatus.Where(x => x.ID == model.ID).FirstOrDefault();
         DE.TB_TypeReservationStatus.Remove(DepObj);
         DE.SaveChanges();
     }
     return status;
 }
        public List<TB_TypeReservationStatusExt> GetAllTableValue(int TableID)
        {
            List<TB_TypeReservationStatusExt> list = new List<TB_TypeReservationStatusExt>();

            DataTable dt = new DataTable();
            SQLCon.Open();
            SqlCommand cmd = new SqlCommand("B_DisplayTable_BizTbl_Table_Sp", SQLCon);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TableID", TableID);
            cmd.Parameters.AddWithValue("@CultureCode", CultureCode);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            sda.Fill(dt);
            SQLCon.Close();

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    TB_TypeReservationStatusExt model = new TB_TypeReservationStatusExt();
                    model.ID = Convert.ToInt32(dr["ID"]);
                    model.PartID = Convert.ToInt32(dr["PartID"]);
                    model.PartName = dr["FK_PartID_ID"].ToString();
                    model.Name_en = dr["Name_en"].ToString();
                    model.Name_tr = dr["Name_tr"].ToString();
                    model.Name_de = dr["Name_de"].ToString();
                    model.Name_es = dr["Name_es"].ToString();
                    model.Name_fr = dr["Name_fr"].ToString();
                    model.Name_ru = dr["Name_ru"].ToString();
                    model.Name_it = dr["Name_it"].ToString();
                    model.Name_ar = dr["Name_ar"].ToString();
                    model.Name_ja = dr["Name_ja"].ToString();
                    model.Name_pt = dr["Name_pt"].ToString();
                    model.Name_zh = dr["Name_zh"].ToString();
                    model.Sorts = dr["Sort"].ToString();
                    model.Active = Convert.ToBoolean(dr["Active"]);
                    list.Add(model);
                }
            }

            return list;
        }
 public bool Create(TB_TypeReservationStatusExt model, ref string Msg, Controller ctrl)
 {
     bool status = true;
     DBEntities insertentity = new DBEntities();
     TB_TypeReservationStatus DepObj = new TB_TypeReservationStatus();
     DepObj.ID = model.ID;
     DepObj.PartID = model.PartID;
     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_TypeReservationStatus.Add(DepObj);
     insertentity.SaveChanges();
     int id = DepObj.ID;
     return status;
 }