Esempio n. 1
0
File: PO.cs Progetto: djohan89/OPM
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }