private void button2_Click(object sender, EventArgs e) { if (comboBox1.Text == "Gestionaire de stock") { MachineDAO.supprimer(textBox4.Text); } }
public int DeleteMachine(NZString MachineNo) { Database db = CommonLib.Common.CurrentDatabase; db.KeepConnection = true; db.BeginTransaction(); try { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); dao.Delete(null, MachineNo); db.Commit(); return(1); } catch (Exception err) { db.Rollback(); throw err; } finally { if (db.DBConnectionState == ConnectionState.Open) { db.Close(); } } }
public int AddNew(MachineDTO dtoMachine) { MachineValidator validator = new MachineValidator(); validator.ValidateBeforeSaveNew(dtoMachine); Database db = CommonLib.Common.CurrentDatabase; db.KeepConnection = true; db.BeginTransaction(); try { MachineDAO daoMachine = new MachineDAO(CommonLib.Common.CurrentDatabase); daoMachine.AddNew(null, dtoMachine); db.Commit(); return(1); } catch (Exception err) { db.Rollback(); throw err; } finally { if (db.DBConnectionState == ConnectionState.Open) { db.Close(); } } }
private void button1_Click(object sender, EventArgs e) { if (comboBox1.Text == "Gestionaire de stock") { MachineDAO.Update_Machine(textBox4.Text, textBox5.Text, float.Parse(textBox3.Text), pictureBox1.Text, textBox2.Text); } }
/// <summary> /// ใช้โหลดมาเป็น text autocomplete /// โดยส่งค่าที่ต้องการมาเป็นชื่อ column และ table /// </summary> /// <param name="column"></param> /// <returns></returns> public LookupData LoadLookupTextHelper(string TableName, string ColumnName) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); DataTable dt = dao.LoadLookupTextHelper(null, TableName, ColumnName); LookupData lookupData = new LookupData(dt, ColumnName, ColumnName); return(lookupData); }
public int SaveUpdate(MachineDTO data) { MachineValidator validator = new MachineValidator(); validator.ValidateBeforeSaveUpdate(data); MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); return(dao.UpdateWithoutPK(null, data)); }
public List <MachineDTO> LoadAllMachines(bool LimitRow) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); if (LimitRow) { return(dao.LoadAllWithLimit(CommonLib.Common.CurrentDatabase, true, MachineDTO.eColumns.MACHINE_CD)); } return(dao.LoadAll(null, true)); }
public LookupData LoadMachineByProcess(NZString ItemCD, NZString Process) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); DataTable dt = dao.LoadMachineByProcess(null, ItemCD.StrongValue, Process.StrongValue, false); LookupData lookupData = new LookupData(dt, MachineDTO.eColumns.MACHINE_CD.ToString(), MachineDTO.eColumns.MACHINE_CD.ToString()); return(lookupData); }
public LookupData LoadMachineAll() { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); DataTable dt = dao.LoadMachine(null, false); LookupData lookupData = new LookupData(dt, MachineDTO.eColumns.MACHINE_CD.ToString(), MachineDTO.eColumns.MACHINE_CD.ToString()); return(lookupData); }
public BusinessException CheckMachineNotExist(NZString MachineNo) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); if (!dao.Exist(null, MachineNo)) { ErrorItem errorItem = new ErrorItem(MachineNo.Owner, TKPMessages.eValidate.VLM0164.ToString()); return(new BusinessException(errorItem)); } return(null); }
public ErrorItem ValidateBeforeDelete(NZString MACHINE_CD) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); string returnString = dao.ValidateBeforeDelete(null, MACHINE_CD); if (returnString == null) { return(null); } else { return(new ErrorItem(MACHINE_CD.Owner, returnString)); } }
public DataTable LoadMachineGroupOfProcess(string Process) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); return(dao.LoadMachineGroupOfProcess(null, Process)); }
public DataTable LoadMachineGroup() { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); return(dao.LoadMachineGroup(null)); }
public DataTable LoadMachineList() { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); return(dao.LoadMachineList(null, false)); }
public MachineDTO LoadMachine(NZString MachineNo) { MachineDAO dao = new MachineDAO(CommonLib.Common.CurrentDatabase); return(dao.LoadByPK(null, MachineNo)); }