Пример #1
0
        public void getSERSHeader()
        {
            DBConnection   dbCon         = new DBConnection();
            cMySQLCommands oMySQLCommand = new cMySQLCommands();


            MySqlDataReader reader;

            oMySQLCommand._fields    = "";
            oMySQLCommand._tblName   = " sers_tran ";
            oMySQLCommand._condition = " sers_tran.rsh_no = '" + _sersno + "'";

            reader = oMySQLCommand.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _dateRequested = reader.GetString(3);
                    _dateNeeded    = reader.GetString(4);
                    _loccode       = reader.GetString(5);
                    _deptcode      = reader.GetString(6);
                    _datestamp     = reader.GetString(7);
                    _status        = reader.GetString(8);
                    _uid           = reader.GetString(9);
                    _remarks       = reader.GetString(10);
                    _sersType      = reader.GetString(22);
                    _noOfCopies    = reader.GetString(25);
                    _approvedBy    = reader.GetString(35);
                }
            }
        }
Пример #2
0
        //used to return attachments included from the supplier
        //in the quotation transaction. Query is based on
        //transaction number and supplier
        public List <cAttachment> loadSupQuoteAttachment(string transno, string supcd, string loccd)
        {
            List <cAttachment> cAttachGetList = new List <cAttachment>();
            cMySQLCommands     mySqlCom       = new cMySQLCommands();
            MySqlDataReader    reader;

            mySqlCom._tblName = "attachments";
            _transtype        = "Quotation";
            _transno          = transno;
            _supcd            = supcd;
            _loccd            = loccd;

            mySqlCom.addFields("transno");
            mySqlCom.addFields("sup_code");
            mySqlCom.addFields("filename");
            mySqlCom._condition = "transno = '" + transno + "' and sup_code ='" + supcd + "' and loc_code = '" + _loccd + "'";

            reader = mySqlCom.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    cAttachGetList.Add(new cAttachment
                    {
                        _Code           = reader.GetString(0),
                        _supcd          = reader.GetString(1),
                        _attachmentName = reader.GetString(2),
                    });
                }
            }
            return(cAttachGetList);
        }
Пример #3
0
        public void getPOCurrency()
        {
            DBConnection    dbCon         = new DBConnection( );
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommand._fields  = "";
            oMySQLCommand._tblName = "spo_currency";
            //oMySQLCommand._condition = " spo_currency.poc_no = " + _pocno;
            oMySQLCommand._condition = " spo_currency.ers_no = '" + _pocersno + "' and spo_currency.loc_code = '" + _pocLocCode + "'";

            reader = oMySQLCommand.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _pocdate    = reader.GetString(3);
                    _curCode    = reader.GetString(4);
                    _curname    = reader.GetString(5);
                    _curVal     = reader.GetString(6);
                    _remarks    = reader.GetString(7);
                    _pocPrepBy  = reader.GetString(8);
                    _pocConfirm = reader.GetString(9);
                    _pocLocCode = reader.GetString(10);
                }
            }
        }
Пример #4
0
        public void setLocationConfig()
        {
            cMySQLCommands  oMySQLCommands = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommands._fields    = "";
            oMySQLCommands._tblName   = " locationconfig ";
            oMySQLCommands._condition = " loc_code = '" + _LocCode + "'";

            reader = oMySQLCommands.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _Database   = reader.GetString(2);
                    _Masterfile = reader.GetString(3);
                    _CNVPICT    = reader.GetString(4);
                    _SERVER     = reader.GetString(5);
                    _DOMAIN     = reader.GetString(6);
                    _DBFUSER    = reader.GetString(7);
                    _DBFPASS    = reader.GetString(8);
                    _DBNAME     = reader.GetString(9);
                    _DBUSER     = reader.GetString(10);
                    _DBPASS     = reader.GetString(11);
                    _SELLOCCODE = reader.GetString(12);
                    _SERVERLOC  = reader.GetString(13);
                }
            }
        }
Пример #5
0
        public MySqlDataReader getQuoteSupplierERS()
        {
            cMySQLCommands  cMySQLCom = new cMySQLCommands();
            MySqlDataReader reader;

            cMySQLCom.addFields("quote_supplier.sup_code");
            cMySQLCom.addFields("supplier.sup_extype");
            cMySQLCom.addFields("supplier.sup_active");
            cMySQLCom.addFields("quote_supplier.discount1");
            cMySQLCom.addFields("quote_supplier.discount2");
            cMySQLCom.addFields("quote_supplier.discount3");
            cMySQLCom.addFields("quote_supplier.discount4");
            cMySQLCom.addFields("quote_supplier.special");
            cMySQLCom.addFields("quote_supplier.vat");
            cMySQLCom.addFields("quote_supplier.freight");
            cMySQLCom.addFields("quote_supplier.othercharges");
            cMySQLCom.addFields("quote_supplier.netamt");

            cMySQLCom._tblName        = " quote_supplier ";
            cMySQLCom._innerTableName = " supplier ";
            cMySQLCom._innerLeftOn    = " quote_supplier.sup_code ";
            cMySQLCom._innerRightOn   = " supplier.sup_code ";


            cMySQLCom._condition = " quote_supplier.quote_no = '" + _quoteno + "' and quote_supplier.selected = True and quote_supplier.quote_loccd = '" + _locCode + "'";

            reader = cMySQLCom.innerSelectQueryWhere();
            return(reader);
        }
Пример #6
0
        public List <cCurrencyValue> getCurrencyList()
        {
            cMySQLCommands        cMySQLCom     = new cMySQLCommands();
            List <cCurrencyValue> oCurrencyList = new List <cCurrencyValue>();
            MySqlDataReader       reader;

            cMySQLCom.addFields("quote_currency.cur_isoCode");
            cMySQLCom.addFields("currency.cur_name");
            cMySQLCom.addFields("quote_currency.cur_value");
            cMySQLCom.addFields("quote_currency.selected");

            cMySQLCom._tblName        = "quote_currency";
            cMySQLCom._innerTableName = "currency";

            cMySQLCom._innerLeftOn  = "quote_currency.cur_isoCode";
            cMySQLCom._innerRightOn = "currency.cur_isocode";

            reader = cMySQLCom.innerSelectQuery();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    oCurrencyList.Add(new cCurrencyValue
                    {
                        _currIsoCode  = reader.GetString(0),
                        _currName     = reader.GetString(1),
                        _currExchange = reader.GetDouble(2),
                        _selected     = reader.GetString(3)
                    });
                }
            }
            return(oCurrencyList);
        }
Пример #7
0
        public MySqlDataReader getQuoteLineERS()
        {
            MySqlDataReader reader;
            //DBConnection dbcon = new DBConnection();
            //edited to fix bugs unselected items included in ers
            cMySQLCommands cMySQLCom = new cMySQLCommands();


            cMySQLCom.addFields("quote_line.itm_code");
            cMySQLCom.addFields("quote_line.itm_qty");
            cMySQLCom.addFields("quote_line.itm_uom");
            cMySQLCom.addFields("quote_line.itm_cost");
            cMySQLCom.addFields("(quote_line.itm_cost * quote_line.itm_qty) AS itm_amt");
            cMySQLCom.addFields("quote_line.itm_disc");
            cMySQLCom.addFields("quote_line.itm_net");
            cMySQLCom.addFields("item_mst.itm_specs");


            cMySQLCom._tblName        = "quote_line";
            cMySQLCom._innerTableName = "item_mst";
            cMySQLCom._innerLeftOn    = "quote_line.itm_code";
            cMySQLCom._innerRightOn   = "item_mst.itm_code";

            //added quote _quote no due to varchar
            cMySQLCom._condition = " quote_line.quote_no = '" + _quoteno + "' and quote_line.selected = 'True' and " +
                                   "quote_line.quote_loccd = '" + _locCode + "'";

            reader = cMySQLCom.innerSelectQueryWhere();
            return(reader);
        }
Пример #8
0
        //retrieves the department details based on the current
        //company code provided and sets the details on the properties
        public void setDepartmentDetails()
        {
            cMySQLCommands  osetDeptDetails = new cMySQLCommands();
            MySqlDataReader reader;

            osetDeptDetails._fields    = "";
            osetDeptDetails._tblName   = "company";
            osetDeptDetails._condition = "company.com_code='" + _code + "'";

            reader = osetDeptDetails.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _code      = reader.GetString(1);
                    _name      = reader.GetString(2);
                    _locCode   = reader.GetString(3);
                    _navdeptcd = reader.GetString(4);
                    _navdeptyp = reader.GetString(5);
                    _comprccd  = reader.GetString(6);
                    _comhead1  = reader.GetString(7);
                    _comhead2  = reader.GetString(8);
                    _comaddr   = reader.GetString(9);
                    _comtelno  = reader.GetString(10);
                    _comuseg   = reader.GetString(11);
                    _comconper = reader.GetString(12);
                    _commobil  = reader.GetString(13);
                    _comemail  = reader.GetString(14);
                    _comuser   = reader.GetString(15);
                    _comdupdat = reader.GetString(16);
                    _comfad    = reader.GetString(17);
                }
            }
        }
Пример #9
0
        //same as savetotable function but the only difference is the query
        //removes all existing attachments related to the transaction no and transaction type
        //and adds all attachments included
        public void edittotable(string transno, string transtype, List <cAttachment> cAttachList)
        {
            //remove all transaction entries first
            cMySQLCommands mySqlCom = new cMySQLCommands();
            cMySQLCommands mySqlDel = new cMySQLCommands();

            mySqlDel._tblName   = "attachments";
            mySqlDel._condition = " transno = '" + transno + "' and transtype = '" + transtype + "' and loc_code = '" + selLocCode + "'";
            mySqlDel.deleteQuery();

            mySqlCom._tblName = "attachments";
            mySqlCom.addFields("transno");
            mySqlCom.addFields("transtype");
            mySqlCom.addFields("sup_code");
            mySqlCom.addFields("filename");
            mySqlCom.addFields("loc_code");

            //adds attachment values per entry in list
            foreach (cAttachment cAttach in cAttachList)
            {
                mySqlCom._values = "";
                mySqlCom.addValues(transno);
                mySqlCom.addValues(transtype);
                mySqlCom.addValues(cAttach._supcd);
                mySqlCom.addValues(Path.GetFileName(cAttach._attachmentName));
                mySqlCom.addValues(cAttach._loccd);
                copyToCNVPICT(cAttach._attachmentName);
                mySqlCom.insertQuery();
            }
        }
Пример #10
0
        public MySqlDataReader getQuoteLine()
        {
            cMySQLCommands  cMySQLCom = new cMySQLCommands();
            MySqlDataReader reader;

            cMySQLCom.addFields("quote_line.itm_code");
            cMySQLCom.addFields("quote_line.itm_qty");
            cMySQLCom.addFields("quote_line.itm_uom");
            cMySQLCom.addFields("quote_line.itm_cost");
            cMySQLCom.addFields("quote_line.itm_disc");
            cMySQLCom.addFields("quote_line.itm_freight");
            cMySQLCom.addFields("quote_line.itm_vat");
            cMySQLCom.addFields("quote_line.itm_net");

            cMySQLCom._tblName        = "quote_line";
            cMySQLCom._innerTableName = "item_mst";

            cMySQLCom._innerLeftOn  = "quote_line.itm_code";
            cMySQLCom._innerRightOn = "item_mst.itm_code";

            cMySQLCom._condition = " quote_line.quote_no = '" + _quoteno + "'";

            reader = cMySQLCom.innerSelectQueryWhere();
            return(reader);
        }
Пример #11
0
        //set location details based on location code
        //retrieved on mysql location table
        public void setLocationDetails()
        {
            cMySQLCommands  osetLocationDetails = new cMySQLCommands();
            MySqlDataReader reader;

            osetLocationDetails._fields    = "";
            osetLocationDetails._tblName   = "location";
            osetLocationDetails._condition = "location.loc_code='" + _code.TrimEnd() + "'";

            reader = osetLocationDetails.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _name   = reader.GetString(2);
                    _comHed = reader.GetString(3);
                    _main   = reader.GetString(4);
                    _navcd  = reader.GetString(5);
                    _addr   = reader.GetString(6);
                    _conper = reader.GetString(7);
                    _connum = reader.GetString(8);
                    _email  = reader.GetString(9);
                    _web    = reader.GetString(10);
                    _user   = reader.GetString(11);
                    _dupdat = reader.GetString(12);
                }
            }
        }
Пример #12
0
        public void savePOCurrency()
        {
            cMySQLCommands cMySQLCom = new cMySQLCommands();

            cMySQLCom._tblName = "spo_currency";

            cMySQLCom.addFields("poc_no");
            cMySQLCom.addFields("ers_no");
            cMySQLCom.addFields("poc_date");
            cMySQLCom.addFields("cur_code");
            cMySQLCom.addFields("cur_name");
            cMySQLCom.addFields("cur_val");
            cMySQLCom.addFields("remarks");
            cMySQLCom.addFields("prepby");
            cMySQLCom.addFields("confirmed");
            cMySQLCom.addFields("loc_code");

            cMySQLCom._values = "";
            cMySQLCom.addValues(_pocno);
            cMySQLCom.addValues(_pocersno);
            cMySQLCom.addValues(_pocdate);
            cMySQLCom.addValues(_curCode);
            cMySQLCom.addValues(_curname);
            cMySQLCom.addValues(_curVal);
            cMySQLCom.addValues(_pocremarks);
            cMySQLCom.addValues(_pocPrepBy);
            cMySQLCom.addValues(_pocConfirm);
            cMySQLCom.addValues(_pocLocCode);

            cMySQLCom.insertQuery();
        }
Пример #13
0
        //set ers columns based on object's values
        public void setStatus()
        {
            cMySQLCommands cMySQLCom = new cMySQLCommands();

            //cMySQLCommands oDeleteOldEntry = new cMySQLCommands();

            //oDeleteOldEntry._values = "";
            cMySQLCom._values = "";

            //oDeleteOldEntry._tblName = "ers_tagged";
            cMySQLCom._tblName = "ers_tagged";

            //oDeleteOldEntry._condition = "ers_tagged.rst_no = '"+ _rstNo +
            //"' and ers_tagged.tag_status = '' and ers_tagged.rst_loccd='"+ _rstLocCd + "'";

            cMySQLCom.addFields("tag_status");
            cMySQLCom.addFields("rst_no");
            cMySQLCom.addFields("rst_locCd");

            cMySQLCom.addValues(_rstStat);
            cMySQLCom.addValues(_rstNo);
            cMySQLCom.addValues(_rstLocCd);

            //oDeleteOldEntry.deleteQuery();
            cMySQLCom.insertQuery();
        }
Пример #14
0
        //getERSLine is a method used to update the properties of the class
        //it retrieves the details included in E-Requisiton Line MySqltable
        //data is based on the initialized ERS No
        //entry items are listed in the Property List
        public List <cERequisitionLine> getERSLine()
        {
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            //oMySQLCommand.addFields("pod_date");
            oMySQLCommand.addFields("rsd_itemcd");
            oMySQLCommand.addFields("item_mst.itm_desc");
            oMySQLCommand.addFields("rsd_qty");
            oMySQLCommand.addFields("rsd_untms");
            oMySQLCommand.addFields("rsd_untcst");
            oMySQLCommand.addFields("rsd_amt");
            oMySQLCommand.addFields("rsd_itemno");
            oMySQLCommand.addFields("rsd_dcount");
            oMySQLCommand.addFields("rsd_netamt");
            oMySQLCommand.addFields("rsd_detl");
            oMySQLCommand.addFields("rsd_rrstat");
            oMySQLCommand.addFields("rsd_balanc");

            oMySQLCommand._tblName        = "ers_line";
            oMySQLCommand._innerTableName = "item_mst";

            oMySQLCommand._innerLeftOn  = "ers_line.rsd_itemcd";
            oMySQLCommand._innerRightOn = "item_mst.itm_code";

            oMySQLCommand._condition = "ers_line.rsd_no = " + _ersno;

            reader = oMySQLCommand.innerSelectQueryWhere();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    cErequisitionItems.Add(new cERequisitionLine
                    {
                        //_poddate = reader.GetString(0),
                        _itemCode     = reader.GetString(0),
                        _iDescription = reader.GetString(1),
                        _quantity     = reader.GetString(2),
                        _UOM          = reader.GetString(3),
                        _unitCost     = reader.GetString(4),
                        _amt          = reader.GetString(5),
                        _itemno       = reader.GetString(6),
                        _discount     = reader.GetString(7),
                        _itmnetamt    = reader.GetString(8),
                        _details      = reader.GetString(9),
                        _rrstat       = reader.GetString(10),
                        _balance      = reader.GetString(11)
                    });
                }
            }

            return(cErequisitionItems);
        }
Пример #15
0
        public List <cPurchaseOrderItem> getPOLine()
        {
            DBConnection    dbCon         = new DBConnection();
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommand.addFields("pod_date");
            oMySQLCommand.addFields("pod_itemcd");
            oMySQLCommand.addFields("item_mst.itm_desc");
            oMySQLCommand.addFields("pod_qty");
            oMySQLCommand.addFields("pod_untms");
            oMySQLCommand.addFields("pod_untcst");
            oMySQLCommand.addFields("pod_amt");
            oMySQLCommand.addFields("pod_itemno");
            oMySQLCommand.addFields("pod_dcount");
            oMySQLCommand.addFields("pod_netamt");
            oMySQLCommand.addFields("pod_detl");
            oMySQLCommand.addFields("pod_rrstat");
            oMySQLCommand.addFields("pod_balanc");

            oMySQLCommand._tblName        = "spo_line";
            oMySQLCommand._innerTableName = "item_mst";

            oMySQLCommand._innerLeftOn  = "spo_line.pod_itemcd";
            oMySQLCommand._innerRightOn = "item_mst.itm_code";

            oMySQLCommand._condition = "spo_line.pod_no = " + _pohno;

            reader = oMySQLCommand.innerSelectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    cPOItemsList.Add(new cPurchaseOrderItem
                    {
                        _poddate     = reader.GetString(0),
                        _itemCode    = reader.GetString(1),
                        _description = reader.GetString(2),
                        _quantity    = reader.GetString(3),
                        _uom         = reader.GetString(4),
                        _unitcost    = reader.GetString(5),
                        _amount      = reader.GetString(6),
                        _itemno      = reader.GetString(7),
                        _discount    = reader.GetString(8),
                        _netamount   = reader.GetString(9),
                        _detail      = reader.GetString(10),
                        _rrstat      = reader.GetString(11),
                        _balance     = reader.GetString(12)
                    });
                }
            }

            return(cPOItemsList);
        }
Пример #16
0
        public void editDetails(List <cSupplierPerCost> cSupplierCostList, string selQuoteSupplier)
        {
            cMySQLCommands cMySQLComDel = new cMySQLCommands();
            cMySQLCommands cMySQLCom    = new cMySQLCommands();

            cMySQLCom._tblName = "quote_line";
            cMySQLCom.addFields("quote_no");
            cMySQLCom.addFields("itm_code");
            cMySQLCom.addFields("itm_qty");
            cMySQLCom.addFields("itm_uom");
            cMySQLCom.addFields("itm_cost");
            cMySQLCom.addFields("itm_disc");
            cMySQLCom.addFields("itm_freight");
            cMySQLCom.addFields("itm_vat");
            cMySQLCom.addFields("itm_net");
            cMySQLCom.addFields("sup_code");
            cMySQLCom.addFields("quote_loccd");
            cMySQLCom.addFields("selected");

            if (cSupplierCostList.Count > 0)
            {
                foreach (cSupplierPerCost cSupPerCost in cSupplierCostList)
                {
                    cMySQLComDel._fields    = "";
                    cMySQLComDel._tblName   = "quote_line";
                    cMySQLComDel._condition = "quote_no = '" + _quoteno + "' and quote_loccd = '" + _locCode
                                              + "' and sup_code = '" + cSupPerCost._supplierCode + "' and itm_code ='" + cSupPerCost._itmCode + "'";
                    cMySQLComDel.deleteQuery();

                    cMySQLCom._values = "";
                    cMySQLCom.addValues(_quoteno);
                    cMySQLCom.addValues(cSupPerCost._itmCode);
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._quantity));
                    cMySQLCom.addValues(cSupPerCost._uom);
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._unitCost));
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._discount));
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._freight));
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._vat));
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._netTotal).Replace(",", ""));
                    cMySQLCom.addValues(Convert.ToString(cSupPerCost._supplierCode));
                    cMySQLCom.addValues(_locCode);
                    if (cSupPerCost._supplierCode == selQuoteSupplier)
                    {
                        cMySQLCom.addValues("True");
                    }
                    else
                    {
                        cMySQLCom.addValues("False");
                    }
                    cMySQLCom.insertQuery();
                }
            }
        }
Пример #17
0
        //Used to add entry in ERS Currency table .dbf file in system
        public void createERSCurrency(List <cERequisitionCur> eRequisitionCurList)
        {
            //for each value in listed currencies
            foreach (cERequisitionCur oERequisitionCur in eRequisitionCurList)
            {
                //intialized variables
                List <setDBFValues> dbfColumnList   = new List <setDBFValues>();
                cMySQLCommands      cInsertERSQuery = new cMySQLCommands();
                cInsertERSQuery._tblName = "ers_currency";
                cInsertERSQuery._values  = "";

                //get ers number +1
                _eno = (Convert.ToDouble(cInsertERSQuery.getDBFSequenceNo("ERS")) + 1).ToString();

                //currency columns
                //selected value is only 1 per entry list
                cInsertERSQuery.addFields("ers_no");
                cInsertERSQuery.addFields("cur_code");
                cInsertERSQuery.addFields("cur_name");
                cInsertERSQuery.addFields("cur_val");
                cInsertERSQuery.addFields("selected");

                //ers currency entry per list will be added based on value
                cInsertERSQuery.addValues(_eno);
                cInsertERSQuery.addValues(oERequisitionCur._rscCode);
                cInsertERSQuery.addValues(oERequisitionCur._rscName);
                cInsertERSQuery.addValues(oERequisitionCur._rscValue);
                cInsertERSQuery.addValues(oERequisitionCur._rscSelected);

                //commented of uninsert ers_line
                // cInsertERSQuery.insertQuery();

                //set datatypes for dbf Column
                dbfColumnList.Add(new setDBFValues {
                    valueName = _ersno, valueType = "NUMERIC"
                });
                dbfColumnList.Add(new setDBFValues {
                    valueName = oERequisitionCur._rscCode, valueType = "STRING"
                });
                dbfColumnList.Add(new setDBFValues {
                    valueName = oERequisitionCur._rscName, valueType = "STRING"
                });
                dbfColumnList.Add(new setDBFValues {
                    valueName = oERequisitionCur._rscValue, valueType = "NUMERIC"
                });
                dbfColumnList.Add(new setDBFValues {
                    valueName = oERequisitionCur._rscSelected, valueType = "BOOL"
                });

                cInsertERSQuery.insertDBFQuery(dbfColumnList);
                //  cInsertERSQuery.closeDBFAll();}
            }
        }
Пример #18
0
        //Used to increment PO from sequence .dbf table
        public void incrementPO()
        {
            cMySQLCommands oMySQLSetSequence = new cMySQLCommands();

            oMySQLSetSequence.setDBFSequenceNo("SPO", _pono);

            oMySQLSetSequence._tblName   = "sequence";
            oMySQLSetSequence._fields    = "sequence.seq_num";
            oMySQLSetSequence._values    = _pono;
            oMySQLSetSequence._condition = ("sequence.seq_code = 'SPO'");
            oMySQLSetSequence.updateQuery();
        }
Пример #19
0
        //Used to increment ERS from sequence .dbf table
        public void incrementERS()
        {
            cMySQLCommands oMySQLSetSequence = new cMySQLCommands();

            oMySQLSetSequence.setDBFSequenceNo("ERS", _ersno);

            oMySQLSetSequence._tblName   = "sequence";
            oMySQLSetSequence._fields    = "sequence.seq_num";
            oMySQLSetSequence._values    = _ersno;
            oMySQLSetSequence._condition = ("sequence.seq_code = 'ERS'");
            oMySQLSetSequence.updateQuery();
        }
Пример #20
0
        public void incrementQTN()
        {
            cMySQLCommands oMySQLSetSequence = new cMySQLCommands();

            oMySQLSetSequence.setDBFSequenceNo("QTN", _quoteno);

            oMySQLSetSequence._tblName   = "sequence";
            oMySQLSetSequence._fields    = "sequence.seq_num";
            oMySQLSetSequence._values    = _quoteno;
            oMySQLSetSequence._condition = ("sequence.seq_code = 'QTN'");
            oMySQLSetSequence.updateQuery();
        }
Пример #21
0
        //updates ers tagging
        public void setUntagged()
        {
            cMySQLCommands cMySQLCom = new cMySQLCommands();

            cMySQLCom._values = "";

            cMySQLCom._tblName = "ers_tagged";
            cMySQLCom.addFields("tag_status");
            cMySQLCom.addValues(_rstStat);
            cMySQLCom._condition = "rst_no = '" + _rstNo + "' and rst_loccd = '" + _rstLocCd + "'";

            cMySQLCom.updateQuery();
        }
Пример #22
0
        public int getQuoteNo()
        {
            //changed for per location #
            int            newSequenceNo = 0;
            cMySQLCommands cMySQLCom     = new cMySQLCommands();
            string         curnum        = "";

            //cMySQLCom._tblName = "quote_tran";
            //cMySQLCom._idName = "quote_no";
            curnum        = cMySQLCom.getDBFSequenceNo("QTN");
            newSequenceNo = Convert.ToInt32(curnum);//Convert.ToInt32(cMySQLCom.getSequenceNo());
            //System.Diagnostics.Trace.WriteLine(newSequenceNo);
            return(newSequenceNo);
        }
Пример #23
0
        public List <cSupplierPerCost> getitemSupplierCost()
        {
            cMySQLCommands  cMySQLCom = new cMySQLCommands();
            MySqlDataReader reader;

            cMySQLCom.addFields("quote_line.sup_code");
            cMySQLCom.addFields("quote_line.itm_code");
            cMySQLCom.addFields("item_mst.itm_desc");
            cMySQLCom.addFields("item_mst.itm_specs");
            cMySQLCom.addFields("quote_line.itm_qty");
            cMySQLCom.addFields("quote_line.itm_uom");
            cMySQLCom.addFields("quote_line.itm_cost");
            cMySQLCom.addFields("quote_line.itm_disc");
            cMySQLCom.addFields("quote_line.itm_freight");
            cMySQLCom.addFields("quote_line.itm_vat");
            cMySQLCom.addFields("quote_line.itm_net");

            cMySQLCom._tblName        = "quote_line";
            cMySQLCom._innerTableName = "item_mst";

            cMySQLCom._innerLeftOn  = "quote_line.itm_code";
            cMySQLCom._innerRightOn = "item_mst.itm_code";

            cMySQLCom._condition = " quote_line.quote_no = '" + _quoteno + "' and quote_line.quote_loccd = '" + _locCode + "'";

            reader = cMySQLCom.innerSelectQueryWhere();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    cSupplierItemPerCostList.Add(new cSupplierPerCost
                    {
                        _supplierCode = reader.GetString(0),
                        _itmCode      = reader.GetString(1),
                        _description  = reader.GetString(2),
                        _details      = reader.GetString(3),
                        _quantity     = reader.GetDouble(4),
                        _uom          = reader.GetString(5),
                        _unitCost     = reader.GetDouble(6),
                        _discount     = reader.GetDouble(7),
                        _freight      = reader.GetDouble(8),
                        _vat          = reader.GetDouble(9),
                        _netTotal     = reader.GetDouble(10),
                    });
                }
            }
            return(cSupplierItemPerCostList);
        }
Пример #24
0
        public void setStatus()
        {
            cMySQLCommands cMySQLCom = new cMySQLCommands();

            cMySQLCom._values = "";

            cMySQLCom._tblName = "quote_tran";

            cMySQLCom.addFields("quote_stat");
            cMySQLCom.addValues(_status);

            cMySQLCom._condition = " quote_no = '" + _quoteno + "' and quote_loccd = '" + _locCode + "'";

            cMySQLCom.updateQuery();
        }
Пример #25
0
        public void getSERSHeader(string selSERSNo)
        {
            DBConnection    dbCon         = new DBConnection();
            cLocation       oLocation     = new cLocation();
            cCompany        oCompany      = new cCompany();
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommand.addFields("sers_tran.rsh_dreq");
            oMySQLCommand.addFields("sers_tran.rsh_dneed");
            oMySQLCommand.addFields("sers_tran.rsh_loccd");
            oMySQLCommand.addFields("sers_tran.rsh_depcd");
            oMySQLCommand.addFields("sers_tran.rsh_dstamp");
            oMySQLCommand.addFields("sers_tran.rsh_stat");
            oMySQLCommand.addFields("usertab.usr_name");
            oMySQLCommand.addFields("sers_tran.rsh_rem");
            oMySQLCommand.addFields("sers_tran.rsh_type");
            oMySQLCommand.addFields("sers_tran.rsh_apprby");


            oMySQLCommand._tblName        = "sers_tran";
            oMySQLCommand._innerTableName = "usertab";
            oMySQLCommand._innerLeftOn    = "sers_tran.rsh_uid";
            oMySQLCommand._innerRightOn   = "usertab.usr_login";
            oMySQLCommand._condition      = "sers_tran.rsh_no = '" + selSERSNo + "'";

            reader = oMySQLCommand.innerSelectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _dateRequested = reader.GetString(0);
                    _dateNeeded    = reader.GetString(1);
                    _loccode       = reader.GetString(2);
                    _deptcode      = reader.GetString(3);
                    _datestamp     = reader.GetString(4);
                    _status        = reader.GetString(5);
                    _uid           = reader.GetString(6);
                    _remarks       = reader.GetString(7);
                    _sersType      = reader.GetString(8);
                    //_noOfCopies = reader.GetString(25);
                    _approvedBy = reader.GetString(9);
                }
            }

            ////getLocation();
            //getCompany();
        }
Пример #26
0
        public void changePassword()
        {
            string    newPasswordEncrypt;
            MD5Sample oMD5 = new MD5Sample();

            oMD5._source       = _password;
            newPasswordEncrypt = oMD5.GetMd5Hash();
            cMySQLCommands cMySQLChangePassword = new cMySQLCommands();

            cMySQLChangePassword._tblName = "usertab";

            cMySQLChangePassword._fields    = "usertab.usr_pass";
            cMySQLChangePassword._values    = "'" + newPasswordEncrypt + "'";
            cMySQLChangePassword._condition = ("usertab.usr_login = '******'");
            cMySQLChangePassword.updateQuery();
        }
Пример #27
0
        public void addEventEntry()
        {
            cLocation oLocation = new cLocation();

            oLocation._code = _locCode;
            oLocation.setLocationDetails();

            cMySQLCommands oMySQLCommands = new cMySQLCommands();

            oMySQLCommands._tblName = "eventlog";
            oMySQLCommands.addFields("eventtime");
            oMySQLCommands.addFields("eventname");
            oMySQLCommands._values = "";
            oMySQLCommands.addValues(_logEventDateTime);
            oMySQLCommands.addValues(oLocation._name.TrimEnd() + " has " + _logEventCount + "entries of " + _logEventName);
            oMySQLCommands.insertQuery();
        }
Пример #28
0
        //a module that provides location name based on location code
        public void getLocation()
        {
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommand._fields    = "location.loc_name";
            oMySQLCommand._tblName   = "location";
            oMySQLCommand._condition = "location.loc_code = '" + _location + "'";
            reader = oMySQLCommand.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _locationName = reader.GetString(0);
                }
            }
        }
Пример #29
0
        //a module that provides company name based on company code
        public void getCompany()
        {
            cMySQLCommands  oMySQLCommand = new cMySQLCommands();
            MySqlDataReader reader;

            oMySQLCommand._fields    = "company.com_name";
            oMySQLCommand._tblName   = "company";
            oMySQLCommand._condition = "company.com_code = '" + _department + "'";

            reader = oMySQLCommand.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _departmentName = reader.GetString(0);
                }
            }
        }
Пример #30
0
        public void deptNametoDeptCode()
        {
            cMySQLCommands  osetDeptDetails = new cMySQLCommands();
            MySqlDataReader reader;

            osetDeptDetails._fields    = "";
            osetDeptDetails._tblName   = "company";
            osetDeptDetails._condition = "company.com_name='" + _name + "'";

            reader = osetDeptDetails.selectQueryWhere();
            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    _code = reader.GetString(1);
                }
            }
        }