public static int GetNodes(ref List <string> strLstNodes, Boolean isParent, string strParent) { string strQuerry = String.Empty; DataSet ds = new DataSet(); int ret = 0; if (true == isParent) { strQuerry = "select distinct ctlparent from CatalogAdmin where ctlparent is not null"; } else { strQuerry = "select ctlID from CatalogAdmin where ctlparent=" + "'" + strParent + "'"; } ret = OPMDBHandler.fQuerryData(strQuerry, ref ds); if (0 == ret) { return(0); } if (0 != ds.Tables.Count) { foreach (DataRow row in ds.Tables[0].Rows) { strLstNodes.Add(row[0].ToString()); } } else { return(0); } return(1); }
public static int GetObjectPO(string strIdPO, ref PO objPO) { string strQueryOne = "select * from PO where id=" + "'" + strIdPO + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); Console.Write(ds); if (0 != ds.Tables.Count) { objPO.IDPO = (string)ds.Tables[0].Rows[0].ItemArray[0]; objPO.IdContract = (string)ds.Tables[0].Rows[0].ItemArray[1]; objPO.PONumber = (string)ds.Tables[0].Rows[0].ItemArray[2]; objPO.NumberOfDevice = (float)(double)ds.Tables[0].Rows[0].ItemArray[3]; objPO.DateCreatedPO = ((DateTime)ds.Tables[0].Rows[0].ItemArray[4]).ToString("yyyy-MM-dd"); objPO.DurationConfirmPO = ((DateTime)ds.Tables[0].Rows[0].ItemArray[6]).ToString("yyyy-MM-dd"); objPO.DefaultActiveDatePO = ((DateTime)ds.Tables[0].Rows[0].ItemArray[7]).ToString("yyyy-MM-dd"); objPO.DeadLinePO = ((DateTime)ds.Tables[0].Rows[0].ItemArray[8]).ToString("yyyy-MM-dd"); objPO.TotalValuePO = (float)(double)ds.Tables[0].Rows[0].ItemArray[12]; } else { return(0); } return(1); }
public int InsertNewPO(PO po) { int ret; // string strQueryOne = "select id from PO where id ='" + po.IDPO.ToString() + "'"; DataSet ds = new DataSet(); ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); // if (ret == 1) { string strSQLUpdate = "Update PO set" + " po_number = '" + po.PONumber + "'," + "numberofdevice = '" + po.NumberOfDevice + "'," + "datecreated = '" + po.DateCreatedPO + "'," + "dateconfirm ='" + po.DateCreatedPO + "'," + "totalvalue ='" + po.TotalValuePO + "'" + " where id = '" + po.IDPO.ToString() + "'"; ret = OPM.DBHandler.OPMDBHandler.fInsertData(strSQLUpdate); ret = 2; } else { string strInsertPONew = "insert into PO values ("; strInsertPONew += "'"; strInsertPONew += po.IDPO; strInsertPONew += "','"; strInsertPONew += po.IDContract; strInsertPONew += "','"; strInsertPONew += po.PONumber; strInsertPONew += "','"; strInsertPONew += po.NumberOfDevice.ToString(); strInsertPONew += "','"; strInsertPONew += po.DateCreatedPO; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += po.DurationConfirmPO; strInsertPONew += "','"; strInsertPONew += po.DefaultActiveDatePO; strInsertPONew += "','"; strInsertPONew += po.DeadLinePO; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += po.TotalValuePO; strInsertPONew += "','"; //strInsertPONew += po.Tupo; strInsertPONew += "')"; ret = OPMDBHandler.fInsertData(strInsertPONew); } return(ret); }
public int CheckExistNTKT(string strIDNTKT) { string strQueryOne = "select * from NTKT where id=" + "'" + strIDNTKT + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ret) { return(1); } else { return(0); } }
public int CheckExistConfirmPO(string strIDConfirmPO) { string strQueryOne = "select * from VBConfirmPO where id=" + "'" + strIDConfirmPO + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ret) { return(1); } else { return(0); } }
public int GetAllNodes() { string strQuerryCatalog = "select * from CatalogAdmin"; List <CatalogAdmin> lstCatalogAdmin = new List <CatalogAdmin>(); DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQuerryCatalog, ref ds); if (0 != ds.Tables.Count) { } else { return(0); } return(1); }
public int GetDetailPO(string strQueryOne) { string strQuery = "select * from PO where id=" + "/'" + strQueryOne + "/'"; PO newPO = new PO(); DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQuery, ref ds); if (0 != ds.Tables.Count) { newPO.IDPO = (string)ds.Tables[0].Rows[0].ItemArray[0]; } else { return(0); } return(1); }
public int DisplayPO(string idPO, ref string namecontract, ref string KHMS) { string strQueryOne = "SELECT DISTINCT Contract.namecontract, Contract.KHMS FROM Contract INNER JOIN PO ON PO.id_contract = Contract.id WHERE PO.id =" + "'" + idPO + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ds.Tables.Count) { namecontract = (string)ds.Tables[0].Rows[0].ItemArray[0]; KHMS = ds.Tables[0].Rows[0].ItemArray[1].ToString(); } else { return(0); } return(1); }
//@Dưỡng Bùi -- Lấy thông tin mã PO, PO number, idContract bằng mã NTKT public int getPOinfor(string idNTKT, ref string idPO, ref string PONumber, ref string idContract) { string strQueryOne = "SELECT DISTINCT PO.id, PO.po_number, PO.id_contract FROM NTKT INNER JOIN PO ON NTKT.id_po = PO.id WHERE NTKT.id = " + "'" + idNTKT + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ds.Tables.Count) { idPO = (string)ds.Tables[0].Rows[0].ItemArray[0]; PONumber = ds.Tables[0].Rows[0].ItemArray[1].ToString(); idContract = ds.Tables[0].Rows[0].ItemArray[2].ToString(); } else { return(0); } return(1); }
public int InsertNewConfirmPO(ConfirmPO confirmPO) { string strInsertConfirmPONew = "insert into VBConfirmPO values ("; strInsertConfirmPONew += "'"; strInsertConfirmPONew += confirmPO.ConfirmPOID; strInsertConfirmPONew += "','"; strInsertConfirmPONew += confirmPO.POID; strInsertConfirmPONew += "','"; strInsertConfirmPONew += "')"; int ret = OPMDBHandler.fInsertData(strInsertConfirmPONew); if (0 == ret) { return(ret); } return(1); }
public int GetObjectNTKTByIDPO(string strIdPO, ref NTKT nTKT) { string strQueryOne = "select * from NTKT where id_po=" + "'" + strIdPO + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ds.Tables.Count) { nTKT.ID_NTKT = (string)ds.Tables[0].Rows[0].ItemArray[0]; nTKT.POID = (string)ds.Tables[0].Rows[0].ItemArray[1]; nTKT.NumberOfDevice = (int)ds.Tables[0].Rows[0].ItemArray[2]; nTKT.DateDuKienNTKT = ((DateTime)ds.Tables[0].Rows[0].ItemArray[3]).ToString("yyyy-MM-dd"); //nTKT.getCreateDate = ((DateTime)ds.Tables[0].Rows[0].ItemArray[5]).ToString("yyyy-MM-dd"); } else { return(0); } return(1); }
public static int GetCatalogNodes(ref DataSet ds, string strParent) { string strQuerry = String.Empty; if (null == strParent) { strQuerry = "select ctlparent, ctlID, ctlname from CatalogAdmin where ctlparent is null"; } else { strQuerry = "select ctlparent, ctlID, ctlname from CatalogAdmin where ctlparent=" + "'" + strParent + "'"; } int ret = OPMDBHandler.fQuerryData(strQuerry, ref ds); if (0 == ret) { return(0); } return(1); }
public int InsertNewPO(PO po) { string strInsertPONew = "insert into PO values ("; strInsertPONew += "'"; strInsertPONew += po.IDPO; strInsertPONew += "','"; strInsertPONew += po.IDContract; strInsertPONew += "','"; strInsertPONew += po.PONumber; strInsertPONew += "','"; strInsertPONew += po.NumberOfDevice.ToString(); strInsertPONew += "','"; strInsertPONew += po.DateCreatedPO; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += po.DurationConfirmPO; strInsertPONew += "','"; strInsertPONew += po.DefaultActiveDatePO; strInsertPONew += "','"; strInsertPONew += po.DeadLinePO; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += "','"; strInsertPONew += po.TotalValuePO; strInsertPONew += "')"; int ret = OPMDBHandler.fInsertData(strInsertPONew); if (0 == ret) { return(ret); } return(1); }
public int GetObjectNTKTGUI(string strIdNTKT, ref NTKT nTKT) { string strQueryOne = "SELECT t1.id,t1.id_po, t1.deliver_date_expected, t1.email_request_status, t2.po_number, t2.id_contract, t3.KHMS FROM NTKT t1 join PO t2 ON t1.id_po =t2.id join Contract t3 ON t2.id_Contract =t3.id where t1.id = " + "'" + strIdNTKT + "'"; DataSet ds = new DataSet(); int ret = OPMDBHandler.fQuerryData(strQueryOne, ref ds); if (0 != ds.Tables.Count) { nTKT.ID_NTKT = (string)ds.Tables[0].Rows[0].ItemArray[0]; nTKT.POID = (string)ds.Tables[0].Rows[0].ItemArray[1]; nTKT.DateDuKienNTKT = ((DateTime)ds.Tables[0].Rows[0].ItemArray[2]).ToString("yyyy-MM-dd"); nTKT.PONumber = (string)ds.Tables[0].Rows[0].ItemArray[4]; nTKT.IDContract = (string)ds.Tables[0].Rows[0].ItemArray[5]; nTKT.KHMS = (string)ds.Tables[0].Rows[0].ItemArray[6]; } else { return(0); } return(1); }
public int InsertNewNTKT(NTKT nTKT) { string strInsertNTKTNew = "insert into NTKT values ("; strInsertNTKTNew += "'"; strInsertNTKTNew += nTKT.ID_NTKT; strInsertNTKTNew += "',N'"; strInsertNTKTNew += nTKT.POID; strInsertNTKTNew += "','"; strInsertNTKTNew += nTKT.NumberOfDevice; strInsertNTKTNew += "','"; strInsertNTKTNew += nTKT.DateDuKienNTKT; strInsertNTKTNew += "','"; strInsertNTKTNew += "')"; int ret = OPMDBHandler.fInsertData(strInsertNTKTNew); if (0 == ret) { return(ret); } return(1); }