Пример #1
0
        public String insertxCPoR(XcustPoReceiptTbl p)
        {
            String sql = "", chk = "";

            if (selectDupPk(p.PO_HEADER_ID, p.PO_LINE_ID))
            {
                deletexCPoR(p.PO_HEADER_ID, p.PO_LINE_ID);
            }
            chk = insert(p);
            return(chk);
        }
Пример #2
0
        public void setXcustPRTbl(MaterialListView lv1, Form form1, MaterialProgressBar pB1)
        {
            String uri = "", dump = "";
            //HttpWebRequest request = CreateWebRequest();
            XmlDocument soapEnvelopeXml = new XmlDocument();
            const Int32 BufferSize      = 128;

            String[] filePO;
            addListView("setXcustPRTbl ", "Web Service", lv1, form1);
            //filePO = Cm.getFileinFolder(Cm.initC.PathZip);
            //String text = System.IO.File.ReadAllText(filePO[0]);
            //byte[] byteArraytext = Encoding.UTF8.GetBytes(text);
            //byte[] toEncodeAsBytestext = System.Text.ASCIIEncoding.ASCII.GetBytes(text);
            //String Arraytext = System.Convert.ToBase64String(toEncodeAsBytestext);
            //< soapenv:Envelope xmlns:soapenv = "http://schemas	xmlsoap	org/soap/envelope/" xmlns: v2 = "http://xmlns	oracle	com/oxp/service/v2" >
            uri = @" <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:pub='http://xmlns.oracle.com/oxp/service/PublicReportService'>  " +
                  "<soapenv:Header/> " +
                  "<soapenv:Body> " +
                  "<v2:runReport> " +
                  "<v2:reportRequest> " +
                  "<v2:attributeLocale>en-US</v2:attributeLocale> " +
                  "<v2:attributeTemplate>XCUST_PO_RECEIPT_REP</v2:attributeTemplate> " +
                  "<v2:reportAbsolutePath>/Custom/XCUST_CUSTOM/XCUST_PO_RECEIPT_REP.xdo</v2:reportAbsolutePath> " +
                  "<pub:parameterNameValues> " +
                  "<pub:item> " +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed> " +
                  "<pub:name>p_cre_date_frm</pub:name> " +
                  "<pub:values> " +
                  "<pub:item></pub:item> " +
                  "</pub:values>" +
                  "</pub:item>" +
                  "<pub:item>" +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed>" +
                  "<pub:name>p_cre_date_to</pub:name>" +
                  "<pub:values>" +
                  "<pub:item></pub:item>" +
                  "</pub:values>" +
                  "</pub:item> " +
                  "<pub:item>" +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed> " +
                  "<pub:name>p_update_date_frm</pub:name> " +
                  "<pub:values> " +
                  "<pub:item></pub:item> " +
                  "</pub:values> " +
                  "</pub:item> " +
                  "<pub:item> " +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed> " +
                  "<pub:name>p_update_date_to</pub:name> " +
                  "<pub:values> " +
                  "<pub:item></pub:item> " +
                  "</pub:values> " +
                  "</pub:item> " +
                  "<pub:item> " +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed> " +
                  "<pub:name>p_receipt_num_frm</pub:name> " +
                  "<pub:values> " +
                  "<pub:item></pub:item> " +
                  "</pub:values> " +
                  "</pub:item> " +
                  "<pub:item> " +
                  "<pub:multiValuesAllowed>False</pub:multiValuesAllowed> " +
                  "<pub:name>p_receipt_num_to</pub:name> " +
                  "<pub:values> " +
                  "<pub:item></pub:item> " +
                  "</pub:values> " +
                  "</pub:item> " +
                  "</pub:parameterNameValues>  " +
                  "</v2:reportRequest> " +
                  "<v2:userID>[email protected]</v2:userID> " +
                  "<v2:password>icetech@2017</v2:password> " +
                  "</v2:runReport> " +
                  "</soapenv:Body> " +
                  "</soapenv:Envelope> ";

            //byte[] byteArray = Encoding.UTF8.GetBytes(envelope);
            byte[] byteArray = Encoding.UTF8.GetBytes(uri);
            addListView("setXcustPRTbl Start", "Web Service", lv1, form1);
            // Construct the base 64 encoded string used as credentials for the service call
            byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes("*****@*****.**" + ":" + "icetech@2017");
            string credentials     = System.Convert.ToBase64String(toEncodeAsBytes);

            // Create HttpWebRequest connection to the service
            HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("https://eglj-test.fa.us2.oraclecloud.com/xmlpserver/services/PublicReportService");

            // Configure the request content type to be xml, HTTP method to be POST, and set the content length
            request1.Method        = "POST";
            request1.ContentType   = "text/xml;charset=UTF-8";
            request1.ContentLength = byteArray.Length;

            // Configure the request to use basic authentication, with base64 encoded user name and password, to invoke the service.
            request1.Headers.Add("Authorization", "Basic " + credentials);

            // Set the SOAP action to be invoked; while the call works without this, the value is expected to be set based as per standards
            request1.Headers.Add("SOAPAction", "https://eglj-test.fa.us2.oraclecloud.com/xmlpserver/services/PublicReportService");

            // Write the xml payload to the request
            Stream dataStream = request1.GetRequestStream();

            dataStream.Write(byteArray, 0, byteArray.Length);
            dataStream.Close();
            addListView("setXcustPRTbl Request", "Web Service", lv1, form1);
            // Get the response and process it; In this example, we simply print out the response XDocument doc;
            string    actNumber = "";
            XDocument doc;

            using (WebResponse response = request1.GetResponse())
            {
                addListView("setXcustPRTbl Response", "Web Service", lv1, form1);
                using (Stream stream = response.GetResponseStream())
                {
                    doc = XDocument.Load(stream);
                    foreach (XNode node in doc.DescendantNodes())
                    {
                        if (node is XElement)
                        {
                            XElement element = (XElement)node;
                            if (element.Name.LocalName.Equals("reportBytes"))
                            {
                                actNumber = element.ToString().Replace(@"<ns1:reportBytes xmlns:ns1=""http://xmlns.oracle.com/oxp/service/PublicReportService"">", "");
                                actNumber = actNumber.Replace("</reportBytes>", "").Replace("</result>", "").Replace(@"""", "").Replace("<>", "");
                                actNumber = actNumber.Replace("<reportBytes>", "").Replace("</ns1:reportBytes>", "");
                            }
                        }
                    }
                }
            }
            actNumber = actNumber.Trim();
            actNumber = actNumber.IndexOf("<reportContentType>") >= 0 ? actNumber.Substring(0, actNumber.IndexOf("<reportContentType>")) : actNumber;
            addListView("setXcustPRTbl Extract html", "Web Service", lv1, form1);
            byte[] data          = Convert.FromBase64String(actNumber);
            string decodedString = Encoding.UTF8.GetString(data);

            //XElement html = XElement.Parse(decodedString);
            //string[] values = html.Descendants("table").Select(td => td.Value).ToArray();

            //int row = -1;
            //var doc1 = new HtmlAgilityPack.HtmlDocument();
            //doc1.LoadHtml(html.ToString());
            //var nodesTable = doc1.DocumentNode.Descendants("tr");
            String[] data1 = decodedString.Split('\n');
            //foreach (var nodeTr in nodesTable)
            for (int row = 0; row < data1.Length; row++)
            {
                if (row == 0)
                {
                    continue;
                }
                if (data1[row].Length <= 0)
                {
                    continue;
                }

                String[]          data2 = data1[row].Split(',');
                XcustPoReceiptTbl item  = new XcustPoReceiptTbl();
                item.LAST_UPDATE_DATE    = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[0].Trim());
                item.CREATION_DATE       = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[1].Trim());
                item.RECEIPT_SOURCE_CODE = data2[2].Trim();
                item.VENDOR_ID           = data2[3].Trim().Equals("")?"0": data2[3].Trim();
                item.VENDOR_SITE_ID      = data2[4].Trim().Equals("") ? "0" : data2[4].Trim();
                item.ORGANIZATION_ID     = data2[5].Trim().Equals("") ? "0" : data2[5].Trim();
                item.SHIPMENT_NUM        = data2[6].Trim();
                item.RECEIPT_NUM         = data2[7].Trim();
                item.SHIP_TO_LOCATION_ID = data2[8].Trim();
                item.PACKING_SLIP        = data2[9].Trim();
                item.SHIPPED_DATE        = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[10].Trim());

                item.EXPECTED_RECEIPT_DATE = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[11].Trim());
                item.ATTRIBUTE_CATEGORY    = data2[12].Trim();
                item.ATTRIBUTE1            = data2[13].Trim();
                item.ATTRIBUTE2            = data2[14].Trim();
                item.ATTRIBUTE3            = data2[15].Trim();
                item.ATTRIBUTE4            = data2[16].Trim();
                item.ATTRIBUTE5            = data2[17].Trim();
                item.ATTRIBUTE6            = data2[18].Trim();
                item.ATTRIBUTE7            = data2[19].Trim();
                item.ATTRIBUTE8            = data2[20].Trim();

                item.ATTRIBUTE9            = data2[21].Trim();
                item.ATTRIBUTE10           = data2[22].Trim();
                item.REQUEST_ID            = data2[23].Trim().Equals("") ? "0" : data2[23].Trim();
                item.GROSS_WEIGHT          = data2[24].Trim().Equals("") ? "0" : data2[24].Trim();
                item.GROSS_WEIGHT_UOM_CODE = data2[25].Trim();
                item.NET_WEIGHT            = data2[26].Trim().Equals("") ? "0" : data2[26].Trim();
                item.NET_WEIGHT_UOM_CODE   = data2[27].Trim().Equals("") ? "0" : data2[27].Trim();
                item.PACKAGING_CODE        = data2[28].Trim();
                item.INVOICE_NUM           = data2[29].Trim();
                item.INVOICE_DATE          = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[30].Trim());

                item.INVOICE_AMOUNT       = data2[31].Trim().Equals("") ? "0" : data2[31].Trim();
                item.TAX_NAME             = data2[32].Trim();
                item.TAX_AMOUNT           = data2[33].Trim().Equals("") ? "0" : data2[33].Trim();
                item.FREIGHT_AMOUNT       = data2[34].Trim().Equals("") ? "0" : data2[34].Trim();
                item.INVOICE_STATUS_CODE  = data2[35].Trim();
                item.CURRENCY_CODE        = data2[36].Trim();
                item.CONVERSION_RATE_TYPE = data2[37].Trim();
                item.CONVERSION_RATE      = data2[38].Trim().Equals("") ? "0" : data2[38].Trim();
                item.CONVERSION_DATE      = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[39].Trim());
                item.PAYMENT_TERMS_ID     = data2[40].Trim().Equals("") ? "0" : data2[40].Trim();

                item.SHIP_TO_ORG_ID        = data2[41].Trim().Equals("") ? "0" : data2[41].Trim();
                item.CUSTOMER_ID           = data2[42].Trim().Equals("") ? "0" : data2[42].Trim();
                item.CUSTOMER_SITE_ID      = data2[43].Trim().Equals("") ? "0" : data2[43].Trim();
                item.REMIT_TO_SITE_ID      = data2[44].Trim().Equals("") ? "0" : data2[44].Trim();
                item.SHIP_FROM_LOCATION_ID = data2[45].Trim().Equals("") ? "0" : data2[45].Trim(); //CATEGORY
                item.APPROVAL_STATUS       = data2[46].Trim();                                     //CONVERSION_TYPE
                item.RMA_BU_ID             = data2[47].Trim().Equals("") ? "0" : data2[47].Trim();
                item.HEADER_INTERFACE_ID   = data2[48].Trim().Equals("") ? "0" : data2[48].Trim(); //CONVERSION_RATE
                item.RA_ORIG_SYSTEM_REF    = data2[49].Trim();
                item.SHIPMENT_LINE_ID      = data2[50].Trim().Equals("") ? "0" : data2[50].Trim();

                item.LINE_NUM           = data2[51].Trim().Equals("") ? "0" : data2[51].Trim();
                item.CATEGORY_ID        = data2[52].Trim().Equals("") ? "0" : data2[52].Trim();
                item.QUANTITY_SHIPPED   = data2[53].Trim().Equals("") ? "0" : data2[53].Trim();
                item.QUANTITY_RECEIVED  = data2[54].Trim().Equals("") ? "0" : data2[54].Trim();
                item.QUANTITY_DELIVERED = data2[55].Trim().Equals("") ? "0" : data2[55].Trim();
                item.QUANTITY_RETURNED  = data2[56].Trim().Equals("") ? "0" : data2[56].Trim();
                item.QUANTITY_ACCEPTED  = data2[57].Trim().Equals("") ? "0" : data2[57].Trim();
                item.QUANTITY_REJECTED  = data2[58].Trim().Equals("") ? "0" : data2[58].Trim();
                item.UOM_CODE           = data2[59].Trim();
                item.ITEM_DESCRIPTION   = data2[60].Trim();

                item.ITEM_ID                   = data2[61].Trim().Equals("") ? "0" : data2[61].Trim();
                item.ITEM_REVISION             = data2[62].Trim();
                item.SHIPMENT_LINE_STATUS_CODE = data2[63].Trim().Replace(@"""", "");
                item.SOURCE_DOCUMENT_CODE      = data2[64].Trim();
                item.PO_HEADER_ID              = data2[65].Trim().Equals("") ? "0" : data2[65].Trim();
                item.PO_LINE_ID                = data2[66].Trim().Equals("") ? "0" : data2[66].Trim();
                item.PO_LINE_LOCATION_ID       = data2[67].Trim().Equals("") ? "0" : data2[67].Trim();
                item.PO_DISTRIBUTION_ID        = data2[68].Trim().Equals("") ? "0" : data2[68].Trim();
                item.REQUISITION_LINE_ID       = data2[69].Trim().Equals("") ? "0" : data2[69].Trim();
                item.REQ_DISTRIBUTION_ID       = data2[70].Trim().Equals("") ? "0" : data2[70].Trim();

                item.FROM_ORGANIZATION_ID   = data2[71].Trim().Equals("") ? "0" : data2[71].Trim();
                item.DESTINATION_TYPE_CODE  = data2[72].Trim().Equals("") ? "0" : data2[72].Trim();
                item.TO_ORGANIZATION_ID     = data2[73].Trim().Equals("") ? "0" : data2[73].Trim();
                item.TO_SUBINVENTORY        = data2[74].Trim();
                item.LOCATOR_ID             = data2[75].Trim().Equals("") ? "0" : data2[74].Trim();
                item.DELIVER_TO_LOCATION_ID = data2[76].Trim().Equals("") ? "0" : data2[75].Trim();
                item.SHIPMENT_UNIT_PRICE    = data2[77].Trim().Equals("") ? "0" : data2[76].Trim();
                item.TRANSFER_COST          = data2[78].Trim().Equals("") ? "0" : data2[77].Trim();
                item.TRANSPORTATION_COST    = data2[79].Trim().Equals("") ? "0" : data2[78].Trim();
                item.ATTRIBUTE_CATEGORY_L   = data2[80].Trim();

                item.ATTRIBUTE1_L  = data2[81].Trim();
                item.ATTRIBUTE2_L  = data2[82].Trim();
                item.ATTRIBUTE3_L  = data2[83].Trim();
                item.ATTRIBUTE4_L  = data2[84].Trim();
                item.ATTRIBUTE5_L  = data2[85].Trim();
                item.ATTRIBUTE6_L  = data2[86].Trim();
                item.ATTRIBUTE7_L  = data2[87].Trim();
                item.ATTRIBUTE8_L  = data2[88].Trim();
                item.ATTRIBUTE9_L  = data2[89].Trim();
                item.ATTRIBUTE10_L = data2[90].Trim();

                item.ATTRIBUTE_NUMBER1_L  = data2[91].Trim().Equals("") ? "0" : data2[91].Trim();
                item.ATTRIBUTE_NUMBER2_L  = data2[92].Trim().Equals("") ? "0" : data2[92].Trim();
                item.ATTRIBUTE_NUMBER3_L  = data2[93].Trim().Equals("") ? "0" : data2[93].Trim();
                item.ATTRIBUTE_NUMBER4_L  = data2[94].Trim().Equals("") ? "0" : data2[94].Trim();
                item.ATTRIBUTE_NUMBER5_L  = data2[95].Trim().Equals("") ? "0" : data2[95].Trim();
                item.ATTRIBUTE_NUMBER6_L  = data2[96].Trim().Equals("") ? "0" : data2[96].Trim();
                item.ATTRIBUTE_NUMBER7_L  = data2[97].Trim().Equals("") ? "0" : data2[97].Trim();
                item.ATTRIBUTE_NUMBER8_L  = data2[98].Trim().Equals("") ? "0" : data2[98].Trim();
                item.ATTRIBUTE_NUMBER9_L  = data2[99].Trim().Equals("") ? "0" : data2[99].Trim();
                item.ATTRIBUTE_NUMBER10_L = data2[100].Trim().Equals("") ? "0" : data2[100].Trim();

                item.ATTRIBUTE_DATE1_L   = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[101].Trim());
                item.ATTRIBUTE_DATE2_L   = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[102].Trim());
                item.ATTRIBUTE_DATE3_L   = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[103].Trim());
                item.ATTRIBUTE_DATE4_L   = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[104].Trim());
                item.REASON_ID           = data2[105].Trim();
                item.REQUEST_ID_L        = data2[106].Trim();
                item.DESTINATION_CONTEXT = data2[107].Trim();
                item.PRIMARY_UOM_CODE    = data2[108].Trim();
                item.TAX_NAME_L          = data2[109].Trim();
                item.TAX_AMOUNT_L        = data2[110].Trim().Equals("") ? "0" : data2[110].Trim();

                item.INVOICE_STATUS_CODE_L       = data2[111].Trim();
                item.SHIP_TO_LOCATION_ID_L       = data2[112].Trim().Equals("") ? "0" : data2[112].Trim();
                item.SECONDARY_QUANTITY_SHIPPED  = data2[113].Trim().Equals("") ? "0" : data2[113].Trim();
                item.SECONDARY_QUANTITY_RECEIVED = data2[114].Trim().Equals("") ? "0" : data2[114].Trim();
                item.SECONDARY_UOM_CODE          = data2[115].Trim();
                item.MMT_TRANSACTION_ID          = data2[116].Trim().Equals("") ? "0" : data2[116].Trim();
                item.AMOUNT            = data2[117].Trim().Equals("") ? "0" : data2[117].Trim();
                item.AMOUNT_RECEIVED   = data2[118].Trim().Equals("") ? "0" : data2[118].Trim();
                item.ATTRIBUTE_DATE5_L = xCPoRDB.xCPoR.dateTimeYearToDB1(data2[119].Trim());
                item.LOT_NUMBER        = data2[120].Trim();

                //int VALUE_SET_ID = 0, VALUE_SET_CODE = 1, VALUE_ID = 2, VALUE = 3, DESCRIPTION = 4, ENABLED_FLAG = 5, LAST_UPDATE_DATE = 6, CREATION_DATE = 7;

                xCPoRDB.insertxCPoR(item);
            }

            Console.WriteLine(decodedString);
        }
Пример #3
0
        private void initConfig()
        {
            xCPoR = new XcustPoReceiptTbl();

            xCPoR.LAST_UPDATE_DATE    = "LAST_UPDATE_DATE";
            xCPoR.CREATION_DATE       = "CREATION_DATE";
            xCPoR.RECEIPT_SOURCE_CODE = "RECEIPT_SOURCE_CODE";
            xCPoR.VENDOR_ID           = "VENDOR_ID";
            xCPoR.VENDOR_SITE_ID      = "VENDOR_SITE_ID";
            xCPoR.ORGANIZATION_ID     = "ORGANIZATION_ID";
            xCPoR.SHIPMENT_NUM        = "SHIPMENT_NUM";
            xCPoR.RECEIPT_NUM         = "RECEIPT_NUM";
            xCPoR.SHIP_TO_LOCATION_ID = "SHIP_TO_LOCATION_ID";
            xCPoR.PACKING_SLIP        = "PACKING_SLIP";

            xCPoR.SHIPPED_DATE          = "SHIPPED_DATE";
            xCPoR.EXPECTED_RECEIPT_DATE = "EXPECTED_RECEIPT_DATE";
            xCPoR.ATTRIBUTE_CATEGORY    = "ATTRIBUTE_CATEGORY";
            xCPoR.ATTRIBUTE1            = "ATTRIBUTE1";
            xCPoR.ATTRIBUTE2            = "ATTRIBUTE2";
            xCPoR.ATTRIBUTE3            = "ATTRIBUTE3";
            xCPoR.ATTRIBUTE4            = "ATTRIBUTE4";
            xCPoR.ATTRIBUTE5            = "ATTRIBUTE5";
            xCPoR.ATTRIBUTE6            = "ATTRIBUTE6";
            xCPoR.ATTRIBUTE7            = "ATTRIBUTE7";

            xCPoR.ATTRIBUTE8            = "ATTRIBUTE8";
            xCPoR.ATTRIBUTE9            = "ATTRIBUTE9";
            xCPoR.ATTRIBUTE10           = "ATTRIBUTE10";
            xCPoR.REQUEST_ID            = "REQUEST_ID";
            xCPoR.GROSS_WEIGHT          = "GROSS_WEIGHT";
            xCPoR.GROSS_WEIGHT_UOM_CODE = "GROSS_WEIGHT_UOM_CODE";
            xCPoR.NET_WEIGHT            = "NET_WEIGHT";
            xCPoR.NET_WEIGHT_UOM_CODE   = "NET_WEIGHT_UOM_CODE";
            xCPoR.PACKAGING_CODE        = "PACKAGING_CODE";
            xCPoR.INVOICE_NUM           = "INVOICE_NUM";

            xCPoR.INVOICE_DATE         = "INVOICE_DATE";
            xCPoR.INVOICE_AMOUNT       = "INVOICE_AMOUNT";
            xCPoR.TAX_NAME             = "TAX_NAME";
            xCPoR.TAX_AMOUNT           = "TAX_AMOUNT";
            xCPoR.FREIGHT_AMOUNT       = "FREIGHT_AMOUNT";
            xCPoR.INVOICE_STATUS_CODE  = "INVOICE_STATUS_CODE";
            xCPoR.CURRENCY_CODE        = "CURRENCY_CODE";
            xCPoR.CONVERSION_RATE_TYPE = "CONVERSION_RATE_TYPE";
            xCPoR.CONVERSION_RATE      = "CONVERSION_RATE";
            xCPoR.CONVERSION_DATE      = "CONVERSION_DATE";

            xCPoR.PAYMENT_TERMS_ID      = "PAYMENT_TERMS_ID";
            xCPoR.SHIP_TO_ORG_ID        = "SHIP_TO_ORG_ID";
            xCPoR.CUSTOMER_ID           = "CUSTOMER_ID";
            xCPoR.CUSTOMER_SITE_ID      = "CUSTOMER_SITE_ID";
            xCPoR.REMIT_TO_SITE_ID      = "REMIT_TO_SITE_ID";
            xCPoR.SHIP_FROM_LOCATION_ID = "SHIP_FROM_LOCATION_ID";
            xCPoR.APPROVAL_STATUS       = "APPROVAL_STATUS";
            xCPoR.RMA_BU_ID             = "RMA_BU_ID";
            xCPoR.HEADER_INTERFACE_ID   = "HEADER_INTERFACE_ID";

            xCPoR.RA_ORIG_SYSTEM_REF = "RA_ORIG_SYSTEM_REF";
            xCPoR.SHIPMENT_LINE_ID   = "SHIPMENT_LINE_ID";
            xCPoR.LINE_NUM           = "LINE_NUM";
            xCPoR.CATEGORY_ID        = "CATEGORY_ID";
            xCPoR.QUANTITY_SHIPPED   = "QUANTITY_SHIPPED";
            xCPoR.QUANTITY_RECEIVED  = "QUANTITY_RECEIVED";
            xCPoR.QUANTITY_DELIVERED = "QUANTITY_DELIVERED";
            xCPoR.QUANTITY_RETURNED  = "QUANTITY_RETURNED";
            xCPoR.QUANTITY_ACCEPTED  = "QUANTITY_ACCEPTED";
            xCPoR.QUANTITY_REJECTED  = "QUANTITY_REJECTED";

            xCPoR.UOM_CODE                  = "UOM_CODE";
            xCPoR.ITEM_DESCRIPTION          = "ITEM_DESCRIPTION";
            xCPoR.ITEM_ID                   = "ITEM_ID";
            xCPoR.ITEM_REVISION             = "ITEM_REVISION";
            xCPoR.SHIPMENT_LINE_STATUS_CODE = "SHIPMENT_LINE_STATUS_CODE";
            xCPoR.SOURCE_DOCUMENT_CODE      = "SOURCE_DOCUMENT_CODE";
            xCPoR.PO_HEADER_ID              = "PO_HEADER_ID";
            xCPoR.PO_LINE_ID                = "PO_LINE_ID";
            xCPoR.PO_LINE_LOCATION_ID       = "PO_LINE_LOCATION_ID";
            xCPoR.PO_DISTRIBUTION_ID        = "PO_DISTRIBUTION_ID";

            xCPoR.REQUISITION_LINE_ID    = "REQUISITION_LINE_ID";
            xCPoR.REQ_DISTRIBUTION_ID    = "REQ_DISTRIBUTION_ID";
            xCPoR.FROM_ORGANIZATION_ID   = "FROM_ORGANIZATION_ID";
            xCPoR.DESTINATION_TYPE_CODE  = "DESTINATION_TYPE_CODE";
            xCPoR.TO_ORGANIZATION_ID     = "TO_ORGANIZATION_ID";
            xCPoR.TO_SUBINVENTORY        = "TO_SUBINVENTORY";
            xCPoR.LOCATOR_ID             = "LOCATOR_ID";
            xCPoR.DELIVER_TO_LOCATION_ID = "DELIVER_TO_LOCATION_ID";
            xCPoR.SHIPMENT_UNIT_PRICE    = "SHIPMENT_UNIT_PRICE";
            xCPoR.TRANSFER_COST          = "TRANSFER_COST";

            xCPoR.TRANSPORTATION_COST  = "TRANSPORTATION_COST";
            xCPoR.ATTRIBUTE_CATEGORY_L = "ATTRIBUTE_CATEGORY_L";
            xCPoR.ATTRIBUTE1_L         = "ATTRIBUTE1_L";
            xCPoR.ATTRIBUTE2_L         = "ATTRIBUTE2_L";
            xCPoR.ATTRIBUTE3_L         = "ATTRIBUTE3_L";
            xCPoR.ATTRIBUTE4_L         = "ATTRIBUTE4_L";
            xCPoR.ATTRIBUTE5_L         = "ATTRIBUTE5_L";
            xCPoR.ATTRIBUTE6_L         = "ATTRIBUTE6_L";
            xCPoR.ATTRIBUTE7_L         = "ATTRIBUTE7_L";
            xCPoR.ATTRIBUTE8_L         = "ATTRIBUTE8_L";

            xCPoR.ATTRIBUTE9_L        = "ATTRIBUTE9_L";
            xCPoR.ATTRIBUTE10_L       = "ATTRIBUTE10_L";
            xCPoR.ATTRIBUTE_NUMBER1_L = "ATTRIBUTE_NUMBER1_L";
            xCPoR.ATTRIBUTE_NUMBER2_L = "ATTRIBUTE_NUMBER2_L";
            xCPoR.ATTRIBUTE_NUMBER3_L = "ATTRIBUTE_NUMBER3_L";
            xCPoR.ATTRIBUTE_NUMBER4_L = "ATTRIBUTE_NUMBER4_L";
            xCPoR.ATTRIBUTE_NUMBER5_L = "ATTRIBUTE_NUMBER5_L";
            xCPoR.ATTRIBUTE_NUMBER6_L = "ATTRIBUTE_NUMBER6_L";
            xCPoR.ATTRIBUTE_NUMBER7_L = "ATTRIBUTE_NUMBER7_L";
            xCPoR.ATTRIBUTE_NUMBER8_L = "ATTRIBUTE_NUMBER8_L";

            xCPoR.ATTRIBUTE_NUMBER9_L  = "ATTRIBUTE_NUMBER9_L";
            xCPoR.ATTRIBUTE_NUMBER10_L = "ATTRIBUTE_NUMBER10_L";
            xCPoR.ATTRIBUTE_DATE1_L    = "ATTRIBUTE_DATE1_L";
            xCPoR.ATTRIBUTE_DATE2_L    = "ATTRIBUTE_DATE2_L";
            xCPoR.ATTRIBUTE_DATE3_L    = "ATTRIBUTE_DATE3_L";
            xCPoR.ATTRIBUTE_DATE4_L    = "ATTRIBUTE_DATE4_L";
            xCPoR.REASON_ID            = "REASON_ID";
            xCPoR.REQUEST_ID_L         = "REQUEST_ID_L";
            xCPoR.DESTINATION_CONTEXT  = "DESTINATION_CONTEXT";
            xCPoR.PRIMARY_UOM_CODE     = "PRIMARY_UOM_CODE";

            xCPoR.TAX_NAME_L                  = "TAX_NAME_L";
            xCPoR.TAX_AMOUNT_L                = "TAX_AMOUNT_L";
            xCPoR.INVOICE_STATUS_CODE_L       = "INVOICE_STATUS_CODE_L";
            xCPoR.SHIP_TO_LOCATION_ID_L       = "SHIP_TO_LOCATION_ID_L";
            xCPoR.SECONDARY_QUANTITY_SHIPPED  = "SECONDARY_QUANTITY_SHIPPED";
            xCPoR.SECONDARY_QUANTITY_RECEIVED = "SECONDARY_QUANTITY_RECEIVED";
            xCPoR.SECONDARY_UOM_CODE          = "SECONDARY_UOM_CODE";
            xCPoR.MMT_TRANSACTION_ID          = "MMT_TRANSACTION_ID";
            xCPoR.AMOUNT          = "AMOUNT";
            xCPoR.AMOUNT_RECEIVED = "AMOUNT_RECEIVED";

            xCPoR.ATTRIBUTE_DATE5_L = "ATTRIBUTE_DATE5_L";
            xCPoR.LOT_NUMBER        = "LOT_NUMBER";

            xCPoR.table = "XCUST_PO_RECEIPT_TBL_TEST";
        }
Пример #4
0
        public String insert(XcustPoReceiptTbl p)
        {
            String sql = "", chk = "";

            try
            {
                //if (p.OrpChtNum.Equals(""))
                //{
                //    return "";
                //}
                //p.RowNumber = selectMaxRowNumber(p.YearId);
                //p.Active = "1";
                String last_update_by = "0", creation_by = "0";
                p.TAX_AMOUNT = p.TAX_AMOUNT.Equals("") ? "0" : p.TAX_AMOUNT;
                sql          = "Insert Into " + xCPoR.table + "(" + xCPoR.LAST_UPDATE_DATE + "," + xCPoR.CREATION_DATE + "," + xCPoR.RECEIPT_SOURCE_CODE + "," +
                               xCPoR.VENDOR_ID + "," + xCPoR.VENDOR_SITE_ID + "," + xCPoR.ORGANIZATION_ID + "," +
                               xCPoR.SHIPMENT_NUM + "," + xCPoR.RECEIPT_NUM + "," + xCPoR.SHIP_TO_LOCATION_ID + "," +
                               xCPoR.PACKING_SLIP + "," + xCPoR.SHIPPED_DATE + "," + xCPoR.EXPECTED_RECEIPT_DATE + "," +
                               xCPoR.ATTRIBUTE_CATEGORY + "," + xCPoR.ATTRIBUTE1 + "," + xCPoR.ATTRIBUTE2 + "," +
                               xCPoR.ATTRIBUTE3 + "," + xCPoR.ATTRIBUTE4 + "," + xCPoR.ATTRIBUTE5 + "," +
                               xCPoR.ATTRIBUTE6 + "," + xCPoR.ATTRIBUTE7 + "," + xCPoR.ATTRIBUTE8 + "," +
                               xCPoR.ATTRIBUTE9 + "," + xCPoR.ATTRIBUTE10 + "," + xCPoR.REQUEST_ID + "," +
                               xCPoR.GROSS_WEIGHT + "," + xCPoR.GROSS_WEIGHT_UOM_CODE + "," + xCPoR.NET_WEIGHT + "," +
                               xCPoR.NET_WEIGHT_UOM_CODE + "," + xCPoR.PACKAGING_CODE + "," + xCPoR.INVOICE_NUM + "," +
                               xCPoR.INVOICE_DATE + "," + xCPoR.INVOICE_AMOUNT + "," + xCPoR.TAX_NAME + "," +
                               xCPoR.TAX_AMOUNT + "," + xCPoR.FREIGHT_AMOUNT + "," + xCPoR.INVOICE_STATUS_CODE + "," +
                               xCPoR.CURRENCY_CODE + "," + xCPoR.CONVERSION_RATE_TYPE + "," + xCPoR.CONVERSION_RATE + "," +
                               xCPoR.CONVERSION_DATE + "," + xCPoR.PAYMENT_TERMS_ID + "," + xCPoR.SHIP_TO_ORG_ID + "," +
                               xCPoR.CUSTOMER_ID + "," + xCPoR.CUSTOMER_SITE_ID + "," + xCPoR.REMIT_TO_SITE_ID + "," +
                               xCPoR.SHIP_FROM_LOCATION_ID + "," + xCPoR.APPROVAL_STATUS + "," + xCPoR.RMA_BU_ID + "," +
                               xCPoR.HEADER_INTERFACE_ID + "," + xCPoR.RA_ORIG_SYSTEM_REF + "," + xCPoR.SHIPMENT_LINE_ID + "," +
                               xCPoR.LINE_NUM + "," + xCPoR.CATEGORY_ID + "," + xCPoR.QUANTITY_SHIPPED + "," +
                               xCPoR.QUANTITY_RECEIVED + "," + xCPoR.QUANTITY_DELIVERED + "," + xCPoR.QUANTITY_RETURNED + "," +
                               xCPoR.QUANTITY_ACCEPTED + "," + xCPoR.QUANTITY_REJECTED + "," + xCPoR.UOM_CODE + "," +
                               xCPoR.ITEM_DESCRIPTION + "," + xCPoR.ITEM_ID + "," + xCPoR.ITEM_REVISION + "," +
                               xCPoR.SHIPMENT_LINE_STATUS_CODE + "," + xCPoR.SOURCE_DOCUMENT_CODE + "," + xCPoR.PO_HEADER_ID + "," +
                               xCPoR.PO_LINE_ID + "," + xCPoR.PO_LINE_LOCATION_ID + "," + xCPoR.PO_DISTRIBUTION_ID + "," +
                               xCPoR.REQUISITION_LINE_ID + "," + xCPoR.REQ_DISTRIBUTION_ID + "," + xCPoR.FROM_ORGANIZATION_ID + "," +
                               xCPoR.DESTINATION_TYPE_CODE + "," + xCPoR.TO_ORGANIZATION_ID + "," + xCPoR.TO_SUBINVENTORY + "," +
                               xCPoR.LOCATOR_ID + "," + xCPoR.DELIVER_TO_LOCATION_ID + "," + xCPoR.SHIPMENT_UNIT_PRICE + "," +
                               xCPoR.TRANSFER_COST + "," + xCPoR.TRANSPORTATION_COST + "," + xCPoR.ATTRIBUTE_CATEGORY_L + "," +
                               xCPoR.ATTRIBUTE1_L + "," + xCPoR.ATTRIBUTE2_L + "," + xCPoR.ATTRIBUTE3_L + "," +
                               xCPoR.ATTRIBUTE4_L + "," + xCPoR.ATTRIBUTE5_L + "," + xCPoR.ATTRIBUTE6_L + "," +
                               xCPoR.ATTRIBUTE7_L + "," + xCPoR.ATTRIBUTE8_L + "," + xCPoR.ATTRIBUTE9_L + "," +
                               xCPoR.ATTRIBUTE10_L + "," + xCPoR.ATTRIBUTE_NUMBER1_L + "," + xCPoR.ATTRIBUTE_NUMBER2_L + "," +
                               xCPoR.ATTRIBUTE_NUMBER3_L + "," + xCPoR.ATTRIBUTE_NUMBER4_L + "," + xCPoR.ATTRIBUTE_NUMBER5_L + "," +
                               xCPoR.ATTRIBUTE_NUMBER6_L + "," + xCPoR.ATTRIBUTE_NUMBER7_L + "," + xCPoR.ATTRIBUTE_NUMBER8_L + "," +
                               xCPoR.ATTRIBUTE_NUMBER9_L + "," + xCPoR.ATTRIBUTE_NUMBER10_L + "," + xCPoR.ATTRIBUTE_DATE1_L + "," +
                               xCPoR.ATTRIBUTE_DATE2_L + "," + xCPoR.ATTRIBUTE_DATE3_L + "," + xCPoR.ATTRIBUTE_DATE4_L + "," +
                               xCPoR.REASON_ID + "," + xCPoR.REQUEST_ID_L + "," + xCPoR.DESTINATION_CONTEXT + "," +
                               xCPoR.PRIMARY_UOM_CODE + "," + xCPoR.TAX_NAME_L + "," + xCPoR.TAX_AMOUNT_L + "," +
                               xCPoR.INVOICE_STATUS_CODE_L + "," + xCPoR.SHIP_TO_LOCATION_ID_L + "," + xCPoR.SECONDARY_QUANTITY_SHIPPED + "," +
                               xCPoR.SECONDARY_QUANTITY_RECEIVED + "," + xCPoR.SECONDARY_UOM_CODE + "," + xCPoR.MMT_TRANSACTION_ID + "," +
                               xCPoR.AMOUNT + "," + xCPoR.AMOUNT_RECEIVED + "," + xCPoR.ATTRIBUTE_DATE5_L + "," +
                               xCPoR.LOT_NUMBER + " " +

                               ") " +
                               "Values('" + p.LAST_UPDATE_DATE + "','" + p.CREATION_DATE + "','" + p.RECEIPT_SOURCE_CODE + "','" +
                               p.VENDOR_ID + "','" + p.VENDOR_SITE_ID + "','" + p.ORGANIZATION_ID + "','" +
                               p.SHIPMENT_NUM + "','" + p.RECEIPT_NUM + "','" + p.SHIP_TO_LOCATION_ID + "','" +
                               p.PACKING_SLIP + "','" + p.SHIPPED_DATE + "','" + p.EXPECTED_RECEIPT_DATE + "','" +
                               p.ATTRIBUTE_CATEGORY + "','" + p.ATTRIBUTE1 + "','" + p.ATTRIBUTE2 + "','" +
                               p.ATTRIBUTE3 + "','" + p.ATTRIBUTE4 + "','" + p.ATTRIBUTE5 + "','" +
                               p.ATTRIBUTE6 + "','" + p.ATTRIBUTE7 + "','" + p.ATTRIBUTE8 + "','" +
                               p.ATTRIBUTE9 + "','" + p.ATTRIBUTE10 + "','" + p.REQUEST_ID + "','" +
                               p.GROSS_WEIGHT + "','" + p.GROSS_WEIGHT_UOM_CODE + "','" + p.NET_WEIGHT + "','" +
                               p.NET_WEIGHT_UOM_CODE + "','" + p.PACKAGING_CODE + "','" + p.INVOICE_NUM + "','" +
                               p.INVOICE_DATE + "','" + p.INVOICE_AMOUNT + "','" + p.TAX_NAME + "','" +
                               p.TAX_AMOUNT + "','" + p.FREIGHT_AMOUNT + "','" + p.INVOICE_STATUS_CODE + "','" +
                               p.CURRENCY_CODE + "','" + p.CONVERSION_RATE_TYPE + "','" + p.CONVERSION_RATE + "','" +
                               p.CONVERSION_DATE + "','" + p.PAYMENT_TERMS_ID + "','" + p.SHIP_TO_ORG_ID + "','" +
                               p.CUSTOMER_ID + "','" + p.CUSTOMER_SITE_ID + "','" + p.REMIT_TO_SITE_ID + "','" +
                               p.SHIP_FROM_LOCATION_ID + "','" + p.APPROVAL_STATUS + "','" + p.RMA_BU_ID + "','" +
                               p.HEADER_INTERFACE_ID + "','" + p.RA_ORIG_SYSTEM_REF + "','" + p.SHIPMENT_LINE_ID + "','" +
                               p.LINE_NUM + "','" + p.CATEGORY_ID + "','" + p.QUANTITY_SHIPPED + "','" +
                               p.QUANTITY_RECEIVED + "','" + p.QUANTITY_DELIVERED + "','" + p.QUANTITY_RETURNED + "','" +
                               p.QUANTITY_ACCEPTED + "','" + p.QUANTITY_REJECTED + "','" + p.UOM_CODE + "','" +
                               p.ITEM_DESCRIPTION + "','" + p.ITEM_ID + "','" + p.ITEM_REVISION + "','" +
                               p.SHIPMENT_LINE_STATUS_CODE + "','" + p.SOURCE_DOCUMENT_CODE + "','" + p.PO_HEADER_ID + "','" +
                               p.PO_LINE_ID + "','" + p.PO_LINE_LOCATION_ID + "','" + p.PO_DISTRIBUTION_ID + "','" +
                               p.REQUISITION_LINE_ID + "','" + p.REQ_DISTRIBUTION_ID + "','" + p.FROM_ORGANIZATION_ID + "','" +
                               p.DESTINATION_TYPE_CODE + "','" + p.TO_ORGANIZATION_ID + "','" + p.TO_SUBINVENTORY + "','" +
                               p.LOCATOR_ID + "','" + p.DELIVER_TO_LOCATION_ID + "','" + p.SHIPMENT_UNIT_PRICE + "','" +
                               p.TRANSFER_COST + "','" + p.TRANSPORTATION_COST + "','" + p.ATTRIBUTE_CATEGORY_L + "','" +
                               p.ATTRIBUTE1_L + "','" + p.ATTRIBUTE2_L + "','" + p.ATTRIBUTE3_L + "','" +
                               p.ATTRIBUTE4_L + "','" + p.ATTRIBUTE5_L + "','" + p.ATTRIBUTE6_L + "','" +
                               p.ATTRIBUTE7_L + "','" + p.ATTRIBUTE8_L + "','" + p.ATTRIBUTE9_L + "','" +
                               p.ATTRIBUTE10_L + "','" + p.ATTRIBUTE_NUMBER1_L + "','" + p.ATTRIBUTE_NUMBER2_L + "','" +
                               p.ATTRIBUTE_NUMBER3_L + "','" + p.ATTRIBUTE_NUMBER4_L + "','" + p.ATTRIBUTE_NUMBER5_L + "','" +
                               p.ATTRIBUTE_NUMBER6_L + "','" + p.ATTRIBUTE_NUMBER7_L + "','" + p.ATTRIBUTE_NUMBER8_L + "','" +
                               p.ATTRIBUTE_NUMBER9_L + "','" + p.ATTRIBUTE_NUMBER10_L + "','" + p.ATTRIBUTE_DATE1_L + "','" +
                               p.ATTRIBUTE_DATE2_L + "','" + p.ATTRIBUTE_DATE3_L + "','" + p.ATTRIBUTE_DATE4_L + "','" +
                               p.REASON_ID + "','" + p.REQUEST_ID_L + "','" + p.DESTINATION_CONTEXT + "','" +
                               p.PRIMARY_UOM_CODE + "','" + p.TAX_NAME_L + "','" + p.TAX_AMOUNT_L + "','" +
                               p.INVOICE_STATUS_CODE_L + "','" + p.SHIP_TO_LOCATION_ID_L + "','" + p.SECONDARY_QUANTITY_SHIPPED + "','" +
                               p.SECONDARY_QUANTITY_RECEIVED + "','" + p.SECONDARY_UOM_CODE + "','" + p.MMT_TRANSACTION_ID + "','" +
                               p.AMOUNT + "','" + p.AMOUNT_RECEIVED + "','" + p.ATTRIBUTE_DATE5_L + "','" +
                               p.LOT_NUMBER + "'" +

                               ") ";
                chk = conn.ExecuteNonQuery(sql, "kfc_po");
                //chk = p.RowNumber;
                //chk = p.Code;
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Error " + ex.ToString(), "insert Doctor");
            }

            return(chk);
        }