示例#1
0
        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);
        }
示例#2
0
文件: PO.cs 项目: duongbui2708/OPM
        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);
        }
示例#3
0
文件: PO.cs 项目: 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);
        }
示例#4
0
文件: NTKT.cs 项目: duongbui2708/OPM
        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);
            }
        }
示例#5
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);
            }
        }
示例#6
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);
        }
示例#7
0
文件: PO.cs 项目: duongbui2708/OPM
        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);
        }
示例#8
0
文件: PO.cs 项目: duongbui2708/OPM
        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);
        }
示例#9
0
文件: NTKT.cs 项目: duongbui2708/OPM
        //@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);
        }
示例#10
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);
        }
示例#11
0
文件: NTKT.cs 项目: duongbui2708/OPM
        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);
        }
示例#12
0
        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);
        }
示例#13
0
文件: PO.cs 项目: duongbui2708/OPM
        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);
        }
示例#14
0
文件: NTKT.cs 项目: duongbui2708/OPM
        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);
        }
示例#15
0
文件: NTKT.cs 项目: duongbui2708/OPM
        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);
        }