Exemple #1
0
        public int Update(GoodsCatInfo model, DbTransaction tran)
        {
            string strSql = SQL_UPDATE + PK_PARA_SET;

            DbParameter[] para = makeParameterForUpdate(model);
            return(Db.Helper.ExecuteNonQuery(tran, strSql, para));
        }
Exemple #2
0
        public int Update(GoodsCatInfo model)
        {
            string strSql = SQL_UPDATE + PK_PARA_SET;

            DbParameter[] paras = makeParameterForUpdate(model);
            return(Db.Helper.ExecuteNonQuery(strSql, paras));
        }
Exemple #3
0
 private void fillModel(DbDataReader dr, GoodsCatInfo model)
 {
     model.ID          = dr.GetInt32(0);
     model.Name        = dr.GetString(1);
     model.IsDel       = dr.GetInt32(2);
     model.SortOrder   = dr.GetInt32(3);
     model.Remarks     = dr.GetString(4);
     model.ExtraFields = FieldsHelper.XmlDeserialize(dr.GetString(5));
 }
Exemple #4
0
 private DbParameter[] makeParameterForAdd(GoodsCatInfo model)
 {
     DbParameter[] paras =
     {
         Db.Helper.MakeInParameter("@Name",        model.Name),
         Db.Helper.MakeInParameter("@IsDel",       model.IsDel),
         Db.Helper.MakeInParameter("@SortOrder",   model.SortOrder),
         Db.Helper.MakeInParameter("@Remarks",     model.Remarks),
         Db.Helper.MakeInParameter("@ExtraFields", FieldsHelper.XmlSerialize(model.ExtraFields))
     };
     return(paras);
 }
Exemple #5
0
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        string catName   = tbName.Text.Trim();
        int    sortOrder = tbSortOrder.Text.Trim().ToArrowInt();

        if (catName.ValidateIsNullOrEmpty("请输入分类名称!"))
        {
            return;
        }

        var model = new TMS.GoodsCatInfo();

        model.IsDel     = 0;
        model.Name      = catName;
        model.Remarks   = "";
        model.SortOrder = sortOrder;

        GoodsBLL.AddGoodsCat(model);

        tbName.Text      = "";
        tbSortOrder.Text = "";
        MessageBox.Show("添加成功!");
        BindData();
    }
Exemple #6
0
 public int Add(GoodsCatInfo model)
 {
     DbParameter[] paras = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(SQL_ADD, paras));
 }
Exemple #7
0
 public int Add(GoodsCatInfo model, DbTransaction tran)
 {
     DbParameter[] para = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(tran, SQL_ADD, para));
 }