public bool Insert() { bool flag = false; using (PersistentManager persistentManager = new PersistentManager()) { UnitDao dao = new UnitDao(); string sql = string.Format("Insert into WMS_UNIT (UNITCODE,UNITNAME,ISDEFAULT,ISACTIVE,STANDARDRATE,MEMO) values('{0}','{1}','{2}','{3}','{4}','{5}')" , this.UNITCODE, this.UNITNAME, this.ISDEFAULT, this.ISACTIVE, this.STANDARDRATE, this.MEMO); dao.SetData(sql); flag = true; } return(flag); }
public bool Update() { bool flag = false; using (PersistentManager persistentManager = new PersistentManager()) { UnitDao dao = new UnitDao(); string sql = string.Format("update WMS_UNIT set UNITCODE='{1}',UNITNAME='{2}',ISDEFAULT='{3}',ISACTIVE='{4}',STANDARDRATE='{5}',MEMO='{6}' where ID='{0}'" , this.ID, this.UNITCODE, this.UNITNAME, this.ISDEFAULT, this.ISACTIVE, this.STANDARDRATE, this.MEMO); dao.SetData(sql); flag = true; } return(flag); }