Esempio n. 1
0
        public string GetCarBrandName(int id)
        {
            CarBrandInfo entity = GetCarBrandModel(id, true);

            if (entity == null)
            {
                return(string.Empty);
            }
            return(entity.Name);
        }
Esempio n. 2
0
        public CarBrandInfo GetCarBrandModel(int id, bool fromCache = false)
        {
            CarBrandInfo entity = null;

            List <CarBrandInfo> list = GetCarBrandList(fromCache);

            entity = list.Find(c => c.ID == id);

            return(entity);
        }
Esempio n. 3
0
        public static CarBrandInfo PopulateCarBrandInfo(IDataReader reader)
        {
            CarBrandInfo entity = new CarBrandInfo()
            {
                ID = (int)reader["ID"],
                Name = reader["Name"] as string,
                NameIndex = reader["NameIndex"] as string
            };

            return entity;
        }
Esempio n. 4
0
        private void LoadData()
        {
            int id = GetInt("id");
            if (id > 0)
            {
                CurrentCarBrand = Cars.Instance.GetCarBrandModel(id, true);

                txtName.Value = CurrentCarBrand.Name;
                txtNameIndex.Value = CurrentCarBrand.NameIndex;
            }
        }
Esempio n. 5
0
        public static CarBrandInfo PopulateCarBrandInfo(IDataReader reader)
        {
            CarBrandInfo entity = new CarBrandInfo()
            {
                ID        = (int)reader["ID"],
                Name      = reader["Name"] as string,
                NameIndex = reader["NameIndex"] as string
            };

            return(entity);
        }
Esempio n. 6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CarBrandInfo entity = new CarBrandInfo();
            int id = GetInt("id");
            if (id > 0) entity = Cars.Instance.GetCarBrandModel(id, true);
            FillData(entity);

            if (id > 0) Cars.Instance.UpdateCarBrand(entity);
            else Cars.Instance.AddCarBrand(entity);

            Cars.Instance.ReloadCarBrandListCache();
            Response.Redirect("carbrandmg.aspx");
        }
Esempio n. 7
0
 public override int AddCarBrand(CarBrandInfo entity)
 {
     string sql = @"INSERT INTO ComOpp_CarBrand(
         [Name]
         ,[NameIndex]
     )VALUES(
         @Name
         ,@NameIndex
     );SELECT @@IDENTITY";
     SqlParameter[] p =
     {
         new SqlParameter("@Name",entity.Name),
         new SqlParameter("@NameIndex",entity.NameIndex)
     };
     return DataConvert.SafeInt(SqlHelper.ExecuteScalar(_con, CommandType.Text, sql, p));
 }
Esempio n. 8
0
 public int AddCarBrand(CarBrandInfo entity)
 {
     return CommonDataProvider.Instance().AddCarBrand(entity);
 }
Esempio n. 9
0
 public abstract void UpdateCarBrand(CarBrandInfo entity);
Esempio n. 10
0
 public abstract int AddCarBrand(CarBrandInfo entity);
Esempio n. 11
0
 public abstract void UpdateCarBrand(CarBrandInfo entity);
Esempio n. 12
0
 public override void UpdateCarBrand(CarBrandInfo entity)
 {
     string sql = @"
     UPDATE ComOpp_CarBrand set
         Name = @Name
         ,NameIndex = @NameIndex
     WHERE ID=@ID";
     SqlParameter[] parameters =
     {
         new SqlParameter("@ID", entity.ID),
         new SqlParameter("@Name", entity.Name),
         new SqlParameter("@NameIndex", entity.NameIndex)
     };
     SqlHelper.ExecuteNonQuery(_con, CommandType.Text, sql, parameters);
 }
Esempio n. 13
0
 public int AddCarBrand(CarBrandInfo entity)
 {
     return(CommonDataProvider.Instance().AddCarBrand(entity));
 }
Esempio n. 14
0
 public abstract int AddCarBrand(CarBrandInfo entity);
Esempio n. 15
0
 private void FillData(CarBrandInfo entity)
 {
     entity.Name = txtName.Value;
     entity.NameIndex = txtNameIndex.Value;
 }
Esempio n. 16
0
 public void UpdateCarBrand(CarBrandInfo entity)
 {
     CommonDataProvider.Instance().UpdateCarBrand(entity);
 }
Esempio n. 17
0
 public void UpdateCarBrand(CarBrandInfo entity)
 {
     CommonDataProvider.Instance().UpdateCarBrand(entity);
 }