示例#1
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            string ExcelFile        = "";
            string SelectedFileName = "";

            OpenFileDialog ofd    = new OpenFileDialog();
            DialogResult   result = ofd.ShowDialog(); // Show the dialog.

            if (result == DialogResult.OK)            // Test result.
            {
                ExcelFile        = ofd.SafeFileName;
                SelectedFileName = ofd.FileName;
            }

            // objDataAccess.Upload("Temp_Vendor", SelectedFileName);
            FileInfo         f      = new FileInfo(SelectedFileName);
            FileStream       fstr   = f.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite);
            Stream           stream = fstr;
            IExcelDataReader reader = ExcelReaderFactory.CreateBinaryReader(stream);

            reader.IsFirstRowAsColumnNames = true;

            DataSet dsExcel = reader.AsDataSet();

            reader.Close();
            DataTable dtExcel = dsExcel.Tables[0];
            string    drop    = "";

            drop = "Delete FROM Temp_Vendor";
            SqlCommand cmddrop = new SqlCommand(drop, DataAccess.DataAccess.cnnConnection);

            DataAccess.DataAccess.cnnConnection.Open();
            cmddrop.ExecuteNonQuery();
            DataAccess.DataAccess.cnnConnection.Close();
            UploadExcel(dtExcel);
            DataTable dtblImport = new DataTable();

            dtblImport = objList.ListOfRecord("usp_Import_Vendor_List", null, "Import Vendor - LoadList");

            for (int i = 0; i < dtblImport.Rows.Count; i++)
            {
                if (dtblImport.Rows[i]["COMPANY"].ToString().Trim() != "" && dtblImport.Rows[i]["COMPANY"].ToString() != null)
                {
                    Int16     CityID;
                    int       CREADITDAYS;
                    decimal   CRAMOUNT, DBAMOUNT;
                    DateTime  TRANSDATE;
                    string    CODE      = "";
                    DataTable dtMaxCode = new DataTable();
                    dtMaxCode = objList.ListOfRecord("usp_Select_Max_Code_Vendor", null, "MAX Vendor - LoadList");

                    //if (dtMaxCode.Rows[0][0].ToString() == null || dtMaxCode.Rows[0][0].ToString().Trim() == "")
                    //{
                    //    CODE = "VEN-00001";
                    //}
                    //else
                    //{
                    //    CODE = "VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0].ToString().Substring(4, 5).TrimStart('0')) + 1).ToString().PadLeft(5, '0');
                    //}

                    DataTable           dtCityId = new DataTable();
                    NameValueCollection ParaCity = new NameValueCollection();
                    ParaCity.Add("@i_City", dtblImport.Rows[i]["CITY"].ToString());
                    dtCityId = objList.ListOfRecord("usp_Select_CityID", ParaCity, "City Customer - LoadList");
                    if (dtCityId.Rows.Count > 0)
                    {
                        CityID = Convert.ToInt16(dtCityId.Rows[0][0].ToString());
                    }
                    else
                    {
                        CityID = 0;
                    }

                    if (dtblImport.Rows[i]["CREADITDAYS"].ToString() == null || dtblImport.Rows[i]["CREADITDAYS"].ToString().Trim() == "")
                    {
                        CREADITDAYS = 0;
                    }
                    else
                    {
                        CREADITDAYS = Convert.ToInt16(dtblImport.Rows[i]["CREADITDAYS"].ToString());
                    }

                    if (dtblImport.Rows[i]["TRANSDATE"].ToString() == null || dtblImport.Rows[i]["TRANSDATE"].ToString().Trim() == "")
                    {
                        TRANSDATE = Convert.ToDateTime(System.DateTime.Now.Date);
                    }
                    else
                    {
                        TRANSDATE = Convert.ToDateTime(dtblImport.Rows[i]["TRANSDATE"].ToString());
                    }

                    if (dtblImport.Rows[i]["CRAMOUNT"].ToString() == null || dtblImport.Rows[i]["CRAMOUNT"].ToString().Trim() == "")
                    {
                        CRAMOUNT = 0;
                    }
                    else
                    {
                        CRAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["CRAMOUNT"].ToString());
                    }
                    if (dtblImport.Rows[i]["DBAMOUNT"].ToString() == null || dtblImport.Rows[i]["DBAMOUNT"].ToString().Trim() == "")
                    {
                        DBAMOUNT = 0;
                    }
                    else
                    {
                        DBAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["DBAMOUNT"].ToString());
                    }

                    objVendorBL.InsertFILE(("VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0]) + 1).ToString().PadLeft(5, '0')),
                                           //CODE,
                                           dtblImport.Rows[i]["COMPANY"].ToString(),
                                           dtblImport.Rows[i]["ADDRESS1"].ToString(),
                                           dtblImport.Rows[i]["ADDRESS2"].ToString(),
                                           (long)CityID,
                                           dtblImport.Rows[i]["PINCODE"].ToString(),
                                           dtblImport.Rows[i]["PHONE1"].ToString(),
                                           dtblImport.Rows[i]["PHONE2"].ToString(),
                                           dtblImport.Rows[i]["EMAIL"].ToString(),
                                           dtblImport.Rows[i]["MOBILE"].ToString(),
                                           dtblImport.Rows[i]["TINNO"].ToString(),
                                           dtblImport.Rows[i]["GSTNO"].ToString(),
                                           dtblImport.Rows[i]["PANNO"].ToString(),
                                           dtblImport.Rows[i]["ECCNO"].ToString(),
                                           CREADITDAYS,
                                           dtblImport.Rows[i]["RANGE"].ToString(),
                                           dtblImport.Rows[i]["DIVISION"].ToString(),
                                           TRANSDATE,
                                           CRAMOUNT,
                                           DBAMOUNT);
                }
            }

            MessageBox.Show("Data Uploded Successfully..!!");



            //----------------------

            //string ExcelFile = "";
            //string SelectedFileName = "";

            //OpenFileDialog ofd = new OpenFileDialog();
            //DialogResult result = ofd.ShowDialog(); // Show the dialog.
            //if (result == DialogResult.OK)
            //{
            //    if (result == DialogResult.OK) // Test result.
            //    {
            //        ExcelFile = ofd.SafeFileName;
            //        SelectedFileName = ofd.FileName;
            //    }
            //    if (ExcelFile.ToString() == "Vendor.xls")
            //    {
            //        objDataAccess.Upload("Temp_Vendor", SelectedFileName);

            //        DataTable dtblImport = new DataTable();
            //        dtblImport = objList.ListOfRecord("usp_Import_Vendor_List", null, "Import Vendor - LoadList");

            //        for (int i = 0; i < dtblImport.Rows.Count; i++)
            //        {
            //            if (dtblImport.Rows[i]["COMPANY"].ToString().Trim() != "" && dtblImport.Rows[i]["COMPANY"].ToString() != null)
            //            {
            //                Int16 CityID;
            //                int CREADITDAYS;
            //                decimal CRAMOUNT, DBAMOUNT;
            //                DateTime TRANSDATE;
            //                string CODE = "";
            //                DataTable dtMaxCode = new DataTable();
            //                dtMaxCode = objList.ListOfRecord("usp_Select_Max_Code_Vendor", null, "MAX Vendor - LoadList");

            //                if (dtMaxCode.Rows[0][0].ToString() == null || dtMaxCode.Rows[0][0].ToString().Trim() == "")
            //                {
            //                    CODE = "VEN-00001";
            //                }
            //                else
            //                {
            //                    CODE = "VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0].ToString().Substring(4, 5).TrimStart('0')) + 1).ToString().PadLeft(5, '0');
            //                }

            //                DataTable dtCityId = new DataTable();
            //                NameValueCollection ParaCity = new NameValueCollection();
            //                ParaCity.Add("@i_City", dtblImport.Rows[i]["CITY"].ToString());
            //                dtCityId = objList.ListOfRecord("usp_Select_CityID", ParaCity, "City Customer - LoadList");
            //                if (dtCityId.Rows.Count > 0)
            //                {
            //                    CityID = Convert.ToInt16(dtCityId.Rows[0][0].ToString());
            //                }
            //                else
            //                {
            //                    CityID = 0;
            //                }

            //                if (dtblImport.Rows[i]["CREADITDAYS"].ToString() == null || dtblImport.Rows[i]["CREADITDAYS"].ToString().Trim() == "")
            //                {
            //                    CREADITDAYS = 0;
            //                }
            //                else
            //                {
            //                    CREADITDAYS = Convert.ToInt16(dtblImport.Rows[i]["CREADITDAYS"].ToString());
            //                }

            //                if (dtblImport.Rows[i]["TRANSDATE"].ToString() == null || dtblImport.Rows[i]["TRANSDATE"].ToString().Trim() == "")
            //                {
            //                    TRANSDATE = Convert.ToDateTime(System.DateTime.Now.Date);
            //                }
            //                else
            //                {
            //                    TRANSDATE = Convert.ToDateTime(dtblImport.Rows[i]["TRANSDATE"].ToString());
            //                }

            //                if (dtblImport.Rows[i]["CRAMOUNT"].ToString() == null || dtblImport.Rows[i]["CRAMOUNT"].ToString().Trim() == "")
            //                {
            //                    CRAMOUNT = 0;
            //                }
            //                else
            //                {
            //                    CRAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["CRAMOUNT"].ToString());
            //                }
            //                if (dtblImport.Rows[i]["DBAMOUNT"].ToString() == null || dtblImport.Rows[i]["DBAMOUNT"].ToString().Trim() == "")
            //                {
            //                    DBAMOUNT = 0;
            //                }
            //                else
            //                {
            //                    DBAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["DBAMOUNT"].ToString());
            //                }

            //                string COMPANY = "";
            //                string ADDRESS1 = "";
            //                string ADDRESS2 = "";
            //                if (dtblImport.Rows[i]["COMPANY"].ToString() == null || dtblImport.Rows[i]["COMPANY"].ToString().Trim() == "")
            //                {
            //                    COMPANY = "";
            //                }
            //                else
            //                {
            //                    COMPANY = dtblImport.Rows[i]["COMPANY"].ToString();
            //                }
            //                if (dtblImport.Rows[i]["ADDRESS1"].ToString() == null || dtblImport.Rows[i]["ADDRESS1"].ToString().Trim() == "")
            //                {
            //                    ADDRESS1 = "";
            //                }
            //                else
            //                {
            //                    ADDRESS1 = dtblImport.Rows[i]["ADDRESS1"].ToString();
            //                }
            //                if (dtblImport.Rows[i]["ADDRESS2"].ToString() == null || dtblImport.Rows[i]["ADDRESS2"].ToString().Trim() == "")
            //                {
            //                    ADDRESS2 = "";
            //                }
            //                else
            //                {
            //                    ADDRESS2 = dtblImport.Rows[i]["ADDRESS2"].ToString();
            //                }
            //                string PINCODE = "";

            //                if (dtblImport.Rows[i]["PINCODE"].ToString() == null || dtblImport.Rows[i]["PINCODE"].ToString().Trim() == "")
            //                {
            //                    PINCODE = "";
            //                }
            //                else
            //                {
            //                    PINCODE = dtblImport.Rows[i]["PINCODE"].ToString();
            //                }
            //                string PHONE1 = "";
            //                if (dtblImport.Rows[i]["PHONE1"].ToString() == null || dtblImport.Rows[i]["PHONE1"].ToString().Trim() == "")
            //                {
            //                    PHONE1 = "";
            //                }
            //                else
            //                {
            //                    PHONE1 = dtblImport.Rows[i]["PHONE1"].ToString();
            //                }
            //                string PHONE2 = "";
            //                if (dtblImport.Rows[i]["PHONE2"].ToString() == null || dtblImport.Rows[i]["PHONE2"].ToString().Trim() == "")
            //                {
            //                    PHONE2 = "";
            //                }
            //                else
            //                {
            //                    PHONE2 = (dtblImport.Rows[i]["PHONE2"].ToString());
            //                }
            //                string EMAIL = "";
            //                if (dtblImport.Rows[i]["EMAIL"].ToString() == null || dtblImport.Rows[i]["EMAIL"].ToString().Trim() == "")
            //                {
            //                    EMAIL = "";
            //                }
            //                else
            //                {
            //                    EMAIL = (dtblImport.Rows[i]["EMAIL"].ToString());
            //                }
            //                string MOBILE = "";
            //                if (dtblImport.Rows[i]["MOBILE"].ToString() == null || dtblImport.Rows[i]["MOBILE"].ToString().Trim() == "")
            //                {
            //                    MOBILE = "";
            //                }
            //                else
            //                {
            //                    MOBILE = (dtblImport.Rows[i]["MOBILE"].ToString());
            //                }
            //                string TINNO = "";
            //                if (dtblImport.Rows[i]["TINNO"].ToString() == null || dtblImport.Rows[i]["TINNO"].ToString().Trim() == "")
            //                {
            //                    MOBILE = "";
            //                }
            //                else
            //                {
            //                    MOBILE = (dtblImport.Rows[i]["TINNO"].ToString());
            //                }
            //                string CSTNO = "";
            //                if (dtblImport.Rows[i]["CSTNO"].ToString() == null || dtblImport.Rows[i]["CSTNO"].ToString().Trim() == "")
            //                {
            //                    CSTNO = "";
            //                }
            //                else
            //                {
            //                    CSTNO = (dtblImport.Rows[i]["CSTNO"].ToString());
            //                }
            //                string PANO = "";
            //                if (dtblImport.Rows[i]["PANO"].ToString() == null || dtblImport.Rows[i]["PANO"].ToString().Trim() == "")
            //                {
            //                    PANO = "";
            //                }
            //                else
            //                {
            //                    PANO = (dtblImport.Rows[i]["PANO"].ToString());
            //                }
            //                string ECCNO = "";
            //                if (dtblImport.Rows[i]["ECCNO"].ToString() == null || dtblImport.Rows[i]["ECCNO"].ToString().Trim() == "")
            //                {
            //                    ECCNO = "";
            //                }
            //                else
            //                {
            //                    ECCNO = (dtblImport.Rows[i]["ECCNO"].ToString());
            //                }
            //                string RANGE = "";
            //                if (dtblImport.Rows[i]["RANGE"].ToString() == null || dtblImport.Rows[i]["RANGE"].ToString().Trim() == "")
            //                {
            //                    RANGE = "";
            //                }
            //                else
            //                {
            //                    RANGE = (dtblImport.Rows[i]["RANGE"].ToString());
            //                }
            //                string DIVISION = "";
            //                if (dtblImport.Rows[i]["DIVISION"].ToString() == null || dtblImport.Rows[i]["DIVISION"].ToString().Trim() == "")
            //                {
            //                    DIVISION = "";
            //                }
            //                else
            //                {
            //                    DIVISION = (dtblImport.Rows[i]["DIVISION"].ToString());
            //                }
            //                objVendorBL.Insert(CODE,
            //                                        COMPANY,
            //                                        ADDRESS1,
            //                                        ADDRESS2,
            //                                        (long)CityID,
            //                                        PINCODE,
            //                                        PHONE1,
            //                                        PHONE2,
            //                                        EMAIL,
            //                                        MOBILE,
            //                                        TINNO,
            //                                        CSTNO,
            //                                        PANO,
            //                                        ECCNO,
            //                                        CREADITDAYS,
            //                                        RANGE,
            //                                        DIVISION,
            //                                        TRANSDATE,
            //                                        CRAMOUNT,
            //                                        DBAMOUNT);

            //            }
            //        }

            //        MessageBox.Show("Data Uploded Successfully..!!");
            //    }
            //}
        }
示例#2
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            string ExcelFile        = "";
            string SelectedFileName = "";

            OpenFileDialog ofd    = new OpenFileDialog();
            DialogResult   result = ofd.ShowDialog(); // Show the dialog.

            if (result == DialogResult.OK)            // Test result.
            {
                ExcelFile        = ofd.SafeFileName;
                SelectedFileName = ofd.FileName;
            }

            objDataAccess.Upload("Temp_Vendor", SelectedFileName);

            DataTable dtblImport = new DataTable();

            dtblImport = objList.ListOfRecord("usp_Import_Vendor_List", null, "Import Vendor - LoadList");

            for (int i = 0; i < dtblImport.Rows.Count; i++)
            {
                if (dtblImport.Rows[i]["COMPANY"].ToString().Trim() != "" && dtblImport.Rows[i]["COMPANY"].ToString() != null)
                {
                    Int16     CityID;
                    int       CREADITDAYS;
                    decimal   CRAMOUNT, DBAMOUNT;
                    DateTime  TRANSDATE;
                    string    CODE      = "";
                    DataTable dtMaxCode = new DataTable();
                    dtMaxCode = objList.ListOfRecord("usp_Select_Max_Code_Vendor", null, "MAX Vendor - LoadList");

                    //if (dtMaxCode.Rows[0][0].ToString() == null || dtMaxCode.Rows[0][0].ToString().Trim() == "")
                    //{
                    //    CODE = "VEN-00001";
                    //}
                    //else
                    //{
                    //    CODE = "VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0].ToString().Substring(4, 5).TrimStart('0')) + 1).ToString().PadLeft(5, '0');
                    //}

                    DataTable           dtCityId = new DataTable();
                    NameValueCollection ParaCity = new NameValueCollection();
                    ParaCity.Add("@i_City", dtblImport.Rows[i]["CITY"].ToString());
                    dtCityId = objList.ListOfRecord("usp_Select_CityID", ParaCity, "City Customer - LoadList");
                    if (dtCityId.Rows.Count > 0)
                    {
                        CityID = Convert.ToInt16(dtCityId.Rows[0][0].ToString());
                    }
                    else
                    {
                        CityID = 0;
                    }

                    if (dtblImport.Rows[i]["CREADITDAYS"].ToString() == null || dtblImport.Rows[i]["CREADITDAYS"].ToString().Trim() == "")
                    {
                        CREADITDAYS = 0;
                    }
                    else
                    {
                        CREADITDAYS = Convert.ToInt16(dtblImport.Rows[i]["CREADITDAYS"].ToString());
                    }

                    if (dtblImport.Rows[i]["TRANSDATE"].ToString() == null || dtblImport.Rows[i]["TRANSDATE"].ToString().Trim() == "")
                    {
                        TRANSDATE = Convert.ToDateTime(System.DateTime.Now.Date);
                    }
                    else
                    {
                        TRANSDATE = Convert.ToDateTime(dtblImport.Rows[i]["TRANSDATE"].ToString());
                    }

                    if (dtblImport.Rows[i]["CRAMOUNT"].ToString() == null || dtblImport.Rows[i]["CRAMOUNT"].ToString().Trim() == "")
                    {
                        CRAMOUNT = 0;
                    }
                    else
                    {
                        CRAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["CRAMOUNT"].ToString());
                    }
                    if (dtblImport.Rows[i]["DBAMOUNT"].ToString() == null || dtblImport.Rows[i]["DBAMOUNT"].ToString().Trim() == "")
                    {
                        DBAMOUNT = 0;
                    }
                    else
                    {
                        DBAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["DBAMOUNT"].ToString());
                    }

                    objVendorBL.InsertFILE(("VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0]) + 1).ToString().PadLeft(5, '0')),
                                           //CODE,
                                           dtblImport.Rows[i]["COMPANY"].ToString(),
                                           dtblImport.Rows[i]["ADDRESS1"].ToString(),
                                           dtblImport.Rows[i]["ADDRESS2"].ToString(),
                                           (long)CityID,
                                           dtblImport.Rows[i]["PINCODE"].ToString(),
                                           dtblImport.Rows[i]["PHONE1"].ToString(),
                                           dtblImport.Rows[i]["PHONE2"].ToString(),
                                           dtblImport.Rows[i]["EMAIL"].ToString(),
                                           dtblImport.Rows[i]["MOBILE"].ToString(),
                                           dtblImport.Rows[i]["TINNO"].ToString(),
                                           dtblImport.Rows[i]["CSTNO"].ToString(),
                                           dtblImport.Rows[i]["PANO"].ToString(),
                                           dtblImport.Rows[i]["ECCNO"].ToString(),
                                           CREADITDAYS,
                                           dtblImport.Rows[i]["RANGE"].ToString(),
                                           dtblImport.Rows[i]["DIVISION"].ToString(),
                                           TRANSDATE,
                                           CRAMOUNT,
                                           DBAMOUNT);
                }
            }

            MessageBox.Show("Data Uploded Successfully..!!");



            //----------------------

            //string ExcelFile = "";
            //string SelectedFileName = "";

            //OpenFileDialog ofd = new OpenFileDialog();
            //DialogResult result = ofd.ShowDialog(); // Show the dialog.
            //if (result == DialogResult.OK)
            //{
            //    if (result == DialogResult.OK) // Test result.
            //    {
            //        ExcelFile = ofd.SafeFileName;
            //        SelectedFileName = ofd.FileName;
            //    }
            //    if (ExcelFile.ToString() == "Vendor.xls")
            //    {
            //        objDataAccess.Upload("Temp_Vendor", SelectedFileName);

            //        DataTable dtblImport = new DataTable();
            //        dtblImport = objList.ListOfRecord("usp_Import_Vendor_List", null, "Import Vendor - LoadList");

            //        for (int i = 0; i < dtblImport.Rows.Count; i++)
            //        {
            //            if (dtblImport.Rows[i]["COMPANY"].ToString().Trim() != "" && dtblImport.Rows[i]["COMPANY"].ToString() != null)
            //            {
            //                Int16 CityID;
            //                int CREADITDAYS;
            //                decimal CRAMOUNT, DBAMOUNT;
            //                DateTime TRANSDATE;
            //                string CODE = "";
            //                DataTable dtMaxCode = new DataTable();
            //                dtMaxCode = objList.ListOfRecord("usp_Select_Max_Code_Vendor", null, "MAX Vendor - LoadList");

            //                if (dtMaxCode.Rows[0][0].ToString() == null || dtMaxCode.Rows[0][0].ToString().Trim() == "")
            //                {
            //                    CODE = "VEN-00001";
            //                }
            //                else
            //                {
            //                    CODE = "VEN-" + (Convert.ToInt16(dtMaxCode.Rows[0][0].ToString().Substring(4, 5).TrimStart('0')) + 1).ToString().PadLeft(5, '0');
            //                }

            //                DataTable dtCityId = new DataTable();
            //                NameValueCollection ParaCity = new NameValueCollection();
            //                ParaCity.Add("@i_City", dtblImport.Rows[i]["CITY"].ToString());
            //                dtCityId = objList.ListOfRecord("usp_Select_CityID", ParaCity, "City Customer - LoadList");
            //                if (dtCityId.Rows.Count > 0)
            //                {
            //                    CityID = Convert.ToInt16(dtCityId.Rows[0][0].ToString());
            //                }
            //                else
            //                {
            //                    CityID = 0;
            //                }

            //                if (dtblImport.Rows[i]["CREADITDAYS"].ToString() == null || dtblImport.Rows[i]["CREADITDAYS"].ToString().Trim() == "")
            //                {
            //                    CREADITDAYS = 0;
            //                }
            //                else
            //                {
            //                    CREADITDAYS = Convert.ToInt16(dtblImport.Rows[i]["CREADITDAYS"].ToString());
            //                }

            //                if (dtblImport.Rows[i]["TRANSDATE"].ToString() == null || dtblImport.Rows[i]["TRANSDATE"].ToString().Trim() == "")
            //                {
            //                    TRANSDATE = Convert.ToDateTime(System.DateTime.Now.Date);
            //                }
            //                else
            //                {
            //                    TRANSDATE = Convert.ToDateTime(dtblImport.Rows[i]["TRANSDATE"].ToString());
            //                }

            //                if (dtblImport.Rows[i]["CRAMOUNT"].ToString() == null || dtblImport.Rows[i]["CRAMOUNT"].ToString().Trim() == "")
            //                {
            //                    CRAMOUNT = 0;
            //                }
            //                else
            //                {
            //                    CRAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["CRAMOUNT"].ToString());
            //                }
            //                if (dtblImport.Rows[i]["DBAMOUNT"].ToString() == null || dtblImport.Rows[i]["DBAMOUNT"].ToString().Trim() == "")
            //                {
            //                    DBAMOUNT = 0;
            //                }
            //                else
            //                {
            //                    DBAMOUNT = Convert.ToDecimal(dtblImport.Rows[i]["DBAMOUNT"].ToString());
            //                }

            //                string COMPANY = "";
            //                string ADDRESS1 = "";
            //                string ADDRESS2 = "";
            //                if (dtblImport.Rows[i]["COMPANY"].ToString() == null || dtblImport.Rows[i]["COMPANY"].ToString().Trim() == "")
            //                {
            //                    COMPANY = "";
            //                }
            //                else
            //                {
            //                    COMPANY = dtblImport.Rows[i]["COMPANY"].ToString();
            //                }
            //                if (dtblImport.Rows[i]["ADDRESS1"].ToString() == null || dtblImport.Rows[i]["ADDRESS1"].ToString().Trim() == "")
            //                {
            //                    ADDRESS1 = "";
            //                }
            //                else
            //                {
            //                    ADDRESS1 = dtblImport.Rows[i]["ADDRESS1"].ToString();
            //                }
            //                if (dtblImport.Rows[i]["ADDRESS2"].ToString() == null || dtblImport.Rows[i]["ADDRESS2"].ToString().Trim() == "")
            //                {
            //                    ADDRESS2 = "";
            //                }
            //                else
            //                {
            //                    ADDRESS2 = dtblImport.Rows[i]["ADDRESS2"].ToString();
            //                }
            //                string PINCODE = "";

            //                if (dtblImport.Rows[i]["PINCODE"].ToString() == null || dtblImport.Rows[i]["PINCODE"].ToString().Trim() == "")
            //                {
            //                    PINCODE = "";
            //                }
            //                else
            //                {
            //                    PINCODE = dtblImport.Rows[i]["PINCODE"].ToString();
            //                }
            //                string PHONE1 = "";
            //                if (dtblImport.Rows[i]["PHONE1"].ToString() == null || dtblImport.Rows[i]["PHONE1"].ToString().Trim() == "")
            //                {
            //                    PHONE1 = "";
            //                }
            //                else
            //                {
            //                    PHONE1 = dtblImport.Rows[i]["PHONE1"].ToString();
            //                }
            //                string PHONE2 = "";
            //                if (dtblImport.Rows[i]["PHONE2"].ToString() == null || dtblImport.Rows[i]["PHONE2"].ToString().Trim() == "")
            //                {
            //                    PHONE2 = "";
            //                }
            //                else
            //                {
            //                    PHONE2 = (dtblImport.Rows[i]["PHONE2"].ToString());
            //                }
            //                string EMAIL = "";
            //                if (dtblImport.Rows[i]["EMAIL"].ToString() == null || dtblImport.Rows[i]["EMAIL"].ToString().Trim() == "")
            //                {
            //                    EMAIL = "";
            //                }
            //                else
            //                {
            //                    EMAIL = (dtblImport.Rows[i]["EMAIL"].ToString());
            //                }
            //                string MOBILE = "";
            //                if (dtblImport.Rows[i]["MOBILE"].ToString() == null || dtblImport.Rows[i]["MOBILE"].ToString().Trim() == "")
            //                {
            //                    MOBILE = "";
            //                }
            //                else
            //                {
            //                    MOBILE = (dtblImport.Rows[i]["MOBILE"].ToString());
            //                }
            //                string TINNO = "";
            //                if (dtblImport.Rows[i]["TINNO"].ToString() == null || dtblImport.Rows[i]["TINNO"].ToString().Trim() == "")
            //                {
            //                    MOBILE = "";
            //                }
            //                else
            //                {
            //                    MOBILE = (dtblImport.Rows[i]["TINNO"].ToString());
            //                }
            //                string CSTNO = "";
            //                if (dtblImport.Rows[i]["CSTNO"].ToString() == null || dtblImport.Rows[i]["CSTNO"].ToString().Trim() == "")
            //                {
            //                    CSTNO = "";
            //                }
            //                else
            //                {
            //                    CSTNO = (dtblImport.Rows[i]["CSTNO"].ToString());
            //                }
            //                string PANO = "";
            //                if (dtblImport.Rows[i]["PANO"].ToString() == null || dtblImport.Rows[i]["PANO"].ToString().Trim() == "")
            //                {
            //                    PANO = "";
            //                }
            //                else
            //                {
            //                    PANO = (dtblImport.Rows[i]["PANO"].ToString());
            //                }
            //                string ECCNO = "";
            //                if (dtblImport.Rows[i]["ECCNO"].ToString() == null || dtblImport.Rows[i]["ECCNO"].ToString().Trim() == "")
            //                {
            //                    ECCNO = "";
            //                }
            //                else
            //                {
            //                    ECCNO = (dtblImport.Rows[i]["ECCNO"].ToString());
            //                }
            //                string RANGE = "";
            //                if (dtblImport.Rows[i]["RANGE"].ToString() == null || dtblImport.Rows[i]["RANGE"].ToString().Trim() == "")
            //                {
            //                    RANGE = "";
            //                }
            //                else
            //                {
            //                    RANGE = (dtblImport.Rows[i]["RANGE"].ToString());
            //                }
            //                string DIVISION = "";
            //                if (dtblImport.Rows[i]["DIVISION"].ToString() == null || dtblImport.Rows[i]["DIVISION"].ToString().Trim() == "")
            //                {
            //                    DIVISION = "";
            //                }
            //                else
            //                {
            //                    DIVISION = (dtblImport.Rows[i]["DIVISION"].ToString());
            //                }
            //                objVendorBL.Insert(CODE,
            //                                        COMPANY,
            //                                        ADDRESS1,
            //                                        ADDRESS2,
            //                                        (long)CityID,
            //                                        PINCODE,
            //                                        PHONE1,
            //                                        PHONE2,
            //                                        EMAIL,
            //                                        MOBILE,
            //                                        TINNO,
            //                                        CSTNO,
            //                                        PANO,
            //                                        ECCNO,
            //                                        CREADITDAYS,
            //                                        RANGE,
            //                                        DIVISION,
            //                                        TRANSDATE,
            //                                        CRAMOUNT,
            //                                        DBAMOUNT);

            //            }
            //        }

            //        MessageBox.Show("Data Uploded Successfully..!!");
            //    }
            //}
        }