private LeafLevel SetValue() { LeafLevel m_Base = new LeafLevel(); m_Base.Level = txtLEAF_LEVEL.Text; m_Base.LeafLevelName = txtLeafLevelName.Text; //等级名称 m_Base.LeafLevelDesc = txtLeafLevelDesc.Text; //等级描述 m_Base.LeafLevelPrice = Convert.ToDouble(txtLeafLevelPrice.Text); //烟叶等级价格 m_Base.LeafLevelSort = Convert.ToInt32(txtLeafLevelSort.Text); //排序 return(m_Base); }
/// <summary> /// 根据 Level 更新烟叶等级表记录 /// </summary> /// <returns>返回烟叶等级受影响的行数</returns> public virtual int Update(LeafLevel leaflevel) { return(db.ExecuteNoQuery(@"UPDATE T_BASE_LEAF_LEVEL SET LEAF_LEVEL_NAME = @LEAF_LEVEL_NAME, LEAF_LEVEL_DESC = @LEAF_LEVEL_DESC, LEAF_LEVEL_PRICE = @LEAF_LEVEL_PRICE, LEAF_LEVEL_SORT = @LEAF_LEVEL_SORT WHERE LEAF_LEVEL = @LEAF_LEVEL", db.GetDataParameter("@LEAF_LEVEL", leaflevel.Level), db.GetDataParameter("@LEAF_LEVEL_NAME", leaflevel.LeafLevelName), db.GetDataParameter("@LEAF_LEVEL_DESC", leaflevel.LeafLevelDesc), db.GetDataParameter("@LEAF_LEVEL_PRICE", leaflevel.LeafLevelPrice), db.GetDataParameter("@LEAF_LEVEL_SORT", leaflevel.LeafLevelSort) //db.GetDataParameter("@LEAF_LEVEL_IS_DELETED", leaflevel.LeafLevelIsDeleted), //db.GetDataParameter("@LEAF_LEVEL_DELETED_DATE", leaflevel.LeafLevelDeletedDate) )); }
/// <summary> /// 新增一条烟叶等级记录 /// </summary> /// <param name="leaflevel">System.String[]<param> /// <returns>返回烟叶等级受影响的行数</returns> public virtual int Add(LeafLevel leaflevel) { return(db.ExecuteNoQuery(@"INSERT INTO T_BASE_LEAF_LEVEL (LEAF_LEVEL, LEAF_LEVEL_NAME, LEAF_LEVEL_DESC, LEAF_LEVEL_PRICE, LEAF_LEVEL_SORT,LEAF_LEVEL_IS_DELETED) VALUES (@LEAF_LEVEL, @LEAF_LEVEL_NAME, @LEAF_LEVEL_DESC, @LEAF_LEVEL_PRICE, @LEAF_LEVEL_SORT, 'N')", db.GetDataParameter("@LEAF_LEVEL", leaflevel.Level), db.GetDataParameter("@LEAF_LEVEL_NAME", leaflevel.LeafLevelName), db.GetDataParameter("@LEAF_LEVEL_DESC", leaflevel.LeafLevelDesc), db.GetDataParameter("@LEAF_LEVEL_PRICE", leaflevel.LeafLevelPrice), db.GetDataParameter("@LEAF_LEVEL_SORT", leaflevel.LeafLevelSort) //db.GetDataParameter("@LEAF_LEVEL_IS_DELETED", leaflevel.LeafLevelIsDeleted), //db.GetDataParameter("@LEAF_LEVEL_DELETED_DATE", leaflevel.LeafLevelDeletedDate) )); }
protected void lbtSave_Click(object sender, EventArgs e) { LeafLevel sg = SetValue(); try { if (Request.QueryString["id"] == null) { new LeafLevelDAL().Add(sg); } else { new LeafLevelDAL().Update(sg); } base.Close("tr"); } catch (Exception ex) { base.Alert(ex.Message); } }