Пример #1
0
        public void UploadExcel(DataTable dtCust)
        {
            string XMLString = "<NewDataSet>";
            long   Cnt       = 0;

            if (dtCust.Rows[1]["COMPANY"].ToString() == "")
            {
                dtCust.Rows.RemoveAt(1);
            }
            for (int row = 0; row < dtCust.Rows.Count; row++)
            {
                XMLString += "<Table>";
                XMLString += "<CustomerName>" + dtCust.Rows[row]["COMPANY"].ToString() + "</CustomerName>";
                XMLString += "<Address1>" + dtCust.Rows[row]["ADDRESS1"].ToString() + "</Address1>";
                XMLString += "<Address2>" + dtCust.Rows[row]["ADDRESS2"].ToString() + "</Address2>";
                XMLString += "<City>" + dtCust.Rows[row]["CITY"].ToString() + "</City>";
                XMLString += "<PinCode>" + dtCust.Rows[row]["PINCODE"].ToString() + "</PinCode>";
                XMLString += "<Phone1>" + dtCust.Rows[row]["PHONE1"].ToString() + "</Phone1>";
                XMLString += "<Phone2>" + dtCust.Rows[row]["PHONE2"].ToString() + "</Phone2>";
                XMLString += "<Email>" + dtCust.Rows[row]["EMAIL"].ToString() + "</Email>";
                XMLString += "<MobileNo>" + dtCust.Rows[row]["MOBILE"].ToString() + "</MobileNo>";
                XMLString += "<TinNo>" + dtCust.Rows[row][10].ToString() + "</TinNo>";
                XMLString += "<GstNo>" + dtCust.Rows[row][11].ToString() + "</GstNo>";
                XMLString += "<PanNo>" + dtCust.Rows[row][12].ToString() + "</PanNo>";
                XMLString += "<EccNo>" + dtCust.Rows[row][13].ToString() + "</EccNo>";
                XMLString += "<Range>" + dtCust.Rows[row][14].ToString() + "</Range>";
                XMLString += "<Division>" + dtCust.Rows[row][15].ToString() + "</Division>";
                XMLString += "<CreditDays>" + dtCust.Rows[row]["CREADITDAYS"].ToString() + "</CreditDays>";
                XMLString += "<TransDate>" + dtCust.Rows[row]["TRANSDATE"].ToString() + "</TransDate>";
                XMLString += "<CRAmount>" + dtCust.Rows[row]["CRAMOUNT"].ToString() + "</CRAmount>";
                XMLString += "<DBAmount>" + dtCust.Rows[row]["DBAMOUNT"].ToString() + "</DBAmount>";
                XMLString += "</Table>";
                Cnt++;
            }
            XMLString = XMLString.ToString().Replace("&", "&amp;") + "</NewDataSet>";
            objVendorBL.UploadVendor(XMLString, Cnt);
        }