Beta Release 2.1.0.1

Update: Add TranTypes, Reading Excel Option
This commit is contained in:
2023-04-30 20:33:47 +05:30
parent dd7cb12915
commit afac37bf40
25 changed files with 527 additions and 120 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+105 -101
View File
@@ -30,17 +30,17 @@
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.btnFilePath = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.cbSheet = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cbTransactionTypes = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.pbTallySync = new System.Windows.Forms.ProgressBar();
this.lblPBStatus = new System.Windows.Forms.Label();
this.btnSync = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button();
this.btnSync = new System.Windows.Forms.Button();
this.lblPBStatus = new System.Windows.Forms.Label();
this.pbTallySync = new System.Windows.Forms.ProgressBar();
this.label3 = new System.Windows.Forms.Label();
this.cbTransactionTypes = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cbSheet = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.btnFilePath = new System.Windows.Forms.Button();
this.txtFilePath = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@@ -56,7 +56,7 @@
this.groupBox1.Controls.Add(this.cbSheet); this.groupBox1.Controls.Add(this.cbSheet);
this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnFilePath); this.groupBox1.Controls.Add(this.btnFilePath);
this.groupBox1.Controls.Add(this.textBox1); this.groupBox1.Controls.Add(this.txtFilePath);
this.groupBox1.Location = new System.Drawing.Point(4, 16); this.groupBox1.Location = new System.Drawing.Point(4, 16);
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.groupBox1.Name = "groupBox1"; this.groupBox1.Name = "groupBox1";
@@ -65,95 +65,6 @@
this.groupBox1.TabIndex = 0; this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false; this.groupBox1.TabStop = false;
// //
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(31, 65);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(582, 27);
this.textBox1.TabIndex = 0;
//
// btnFilePath
//
this.btnFilePath.Image = ((System.Drawing.Image)(resources.GetObject("btnFilePath.Image")));
this.btnFilePath.Location = new System.Drawing.Point(630, 65);
this.btnFilePath.Name = "btnFilePath";
this.btnFilePath.Size = new System.Drawing.Size(47, 27);
this.btnFilePath.TabIndex = 1;
this.btnFilePath.UseVisualStyleBackColor = true;
this.btnFilePath.Click += new System.EventHandler(this.btnFilePath_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(38, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 22);
this.label1.TabIndex = 2;
this.label1.Text = "File Path";
//
// cbSheet
//
this.cbSheet.FormattingEnabled = true;
this.cbSheet.Location = new System.Drawing.Point(31, 126);
this.cbSheet.Name = "cbSheet";
this.cbSheet.Size = new System.Drawing.Size(580, 30);
this.cbSheet.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(38, 101);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(89, 22);
this.label2.TabIndex = 4;
this.label2.Text = "Sheet Name";
//
// cbTransactionTypes
//
this.cbTransactionTypes.FormattingEnabled = true;
this.cbTransactionTypes.Location = new System.Drawing.Point(31, 185);
this.cbTransactionTypes.Name = "cbTransactionTypes";
this.cbTransactionTypes.Size = new System.Drawing.Size(580, 30);
this.cbTransactionTypes.TabIndex = 5;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(38, 160);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(127, 22);
this.label3.TabIndex = 6;
this.label3.Text = "Transaction Types";
//
// pbTallySync
//
this.pbTallySync.Location = new System.Drawing.Point(31, 264);
this.pbTallySync.Name = "pbTallySync";
this.pbTallySync.Size = new System.Drawing.Size(575, 23);
this.pbTallySync.TabIndex = 7;
//
// lblPBStatus
//
this.lblPBStatus.AutoSize = true;
this.lblPBStatus.ForeColor = System.Drawing.SystemColors.Highlight;
this.lblPBStatus.Location = new System.Drawing.Point(38, 239);
this.lblPBStatus.Name = "lblPBStatus";
this.lblPBStatus.Size = new System.Drawing.Size(56, 22);
this.lblPBStatus.TabIndex = 8;
this.lblPBStatus.Text = "Status: ";
//
// btnSync
//
this.btnSync.Image = ((System.Drawing.Image)(resources.GetObject("btnSync.Image")));
this.btnSync.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSync.Location = new System.Drawing.Point(128, 325);
this.btnSync.Name = "btnSync";
this.btnSync.Size = new System.Drawing.Size(155, 40);
this.btnSync.TabIndex = 9;
this.btnSync.Text = "&Sync";
this.btnSync.UseVisualStyleBackColor = true;
//
// btnClose // btnClose
// //
this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image"))); this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
@@ -164,6 +75,97 @@
this.btnClose.TabIndex = 10; this.btnClose.TabIndex = 10;
this.btnClose.Text = "&Close"; this.btnClose.Text = "&Close";
this.btnClose.UseVisualStyleBackColor = true; this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnSync
//
this.btnSync.Image = ((System.Drawing.Image)(resources.GetObject("btnSync.Image")));
this.btnSync.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSync.Location = new System.Drawing.Point(128, 325);
this.btnSync.Name = "btnSync";
this.btnSync.Size = new System.Drawing.Size(155, 40);
this.btnSync.TabIndex = 9;
this.btnSync.Text = "&Sync";
this.btnSync.UseVisualStyleBackColor = true;
this.btnSync.Click += new System.EventHandler(this.btnSync_Click);
//
// lblPBStatus
//
this.lblPBStatus.AutoSize = true;
this.lblPBStatus.ForeColor = System.Drawing.SystemColors.Highlight;
this.lblPBStatus.Location = new System.Drawing.Point(38, 239);
this.lblPBStatus.Name = "lblPBStatus";
this.lblPBStatus.Size = new System.Drawing.Size(56, 22);
this.lblPBStatus.TabIndex = 8;
this.lblPBStatus.Text = "Status: ";
//
// pbTallySync
//
this.pbTallySync.Location = new System.Drawing.Point(31, 264);
this.pbTallySync.Name = "pbTallySync";
this.pbTallySync.Size = new System.Drawing.Size(575, 23);
this.pbTallySync.TabIndex = 7;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(38, 160);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(127, 22);
this.label3.TabIndex = 6;
this.label3.Text = "Transaction Types";
//
// cbTransactionTypes
//
this.cbTransactionTypes.FormattingEnabled = true;
this.cbTransactionTypes.Location = new System.Drawing.Point(31, 185);
this.cbTransactionTypes.Name = "cbTransactionTypes";
this.cbTransactionTypes.Size = new System.Drawing.Size(580, 30);
this.cbTransactionTypes.TabIndex = 5;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(38, 101);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(89, 22);
this.label2.TabIndex = 4;
this.label2.Text = "Sheet Name";
//
// cbSheet
//
this.cbSheet.FormattingEnabled = true;
this.cbSheet.Location = new System.Drawing.Point(31, 126);
this.cbSheet.Name = "cbSheet";
this.cbSheet.Size = new System.Drawing.Size(580, 30);
this.cbSheet.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(38, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(65, 22);
this.label1.TabIndex = 2;
this.label1.Text = "File Path";
//
// btnFilePath
//
this.btnFilePath.Image = ((System.Drawing.Image)(resources.GetObject("btnFilePath.Image")));
this.btnFilePath.Location = new System.Drawing.Point(630, 65);
this.btnFilePath.Name = "btnFilePath";
this.btnFilePath.Size = new System.Drawing.Size(47, 27);
this.btnFilePath.TabIndex = 1;
this.btnFilePath.UseVisualStyleBackColor = true;
this.btnFilePath.Click += new System.EventHandler(this.btnFilePath_Click);
//
// txtFilePath
//
this.txtFilePath.Location = new System.Drawing.Point(31, 65);
this.txtFilePath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtFilePath.Name = "txtFilePath";
this.txtFilePath.Size = new System.Drawing.Size(582, 27);
this.txtFilePath.TabIndex = 0;
// //
// FrmMain // FrmMain
// //
@@ -173,8 +175,10 @@
this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox1);
this.Font = new System.Drawing.Font("Arial Narrow", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Arial Narrow", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.MaximizeBox = false;
this.Name = "FrmMain"; this.Name = "FrmMain";
this.Text = "Tally Data Tool - Bajaj Auto"; this.Text = "Tally Data Tool - Bajaj Auto";
this.Load += new System.EventHandler(this.FrmMain_Load);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
@@ -190,7 +194,7 @@
private System.Windows.Forms.ComboBox cbSheet; private System.Windows.Forms.ComboBox cbSheet;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnFilePath; private System.Windows.Forms.Button btnFilePath;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox txtFilePath;
private System.Windows.Forms.ProgressBar pbTallySync; private System.Windows.Forms.ProgressBar pbTallySync;
private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnSync; private System.Windows.Forms.Button btnSync;
+333
View File
@@ -24,6 +24,7 @@ namespace TallyDataTool
string[,] arrExcel = new string[45, 100000]; string[,] arrExcel = new string[45, 100000];
LibDbCommon.LibDBCommon oLibDbCommon = new LibDbCommon.LibDBCommon(); LibDbCommon.LibDBCommon oLibDbCommon = new LibDbCommon.LibDBCommon();
LibFunctionsCommon oLibCommon = new LibFunctionsCommon.LibFunctions();
LIBWebRequest.WebRequest oLibWebRequest = new LIBWebRequest.WebRequest(); LIBWebRequest.WebRequest oLibWebRequest = new LIBWebRequest.WebRequest();
//TallyXMLConverter.TallyXML oLibTallyXML = new TallyXMLConverter.TallyXML(); //TallyXMLConverter.TallyXML oLibTallyXML = new TallyXMLConverter.TallyXML();
System.Diagnostics.Process oProc = null; System.Diagnostics.Process oProc = null;
@@ -84,9 +85,341 @@ namespace TallyDataTool
private void btnFilePath_Click(object sender, EventArgs e) private void btnFilePath_Click(object sender, EventArgs e)
{ {
KillSpecificExcelFileProcess("");
OpenFileDialog oFileDialog = new OpenFileDialog();
oFileDialog.DefaultExt = "*.*";
oFileDialog.Filter = "Excel Files (*.xlsx)|*.xlsx|Excel 2003 (*.xls)|*.xls";
oFileDialog.ShowDialog();
txtFilePath.Text = oFileDialog.FileName;
if (txtFilePath.Text != "")
{
procLoadExcelSheets();
}
}
private void FrmMain_Load(object sender, EventArgs e)
{
procLoadDefaultData();
}
private void procLoadDefaultData()
{
cbTransactionTypes.Items.Add("KTM Vehicle Purchase");
cbTransactionTypes.Items.Add("KTM Parts Purchase");
cbTransactionTypes.Items.Add("Chetak Vehicle Purchase");
cbTransactionTypes.Items.Add("Chetak Parts Purchase");
cbTransactionTypes.Items.Add("KTM Vehicle Sales");
cbTransactionTypes.Items.Add("KTM Parts Sales");
cbTransactionTypes.Items.Add("Chetak Vehicle Sales");
cbTransactionTypes.Items.Add("Chetak Parts Sales");
cbTransactionTypes.Items.Add("Chetak Service Sales");
cbTransactionTypes.Items.Add("Chetak Receipt");
} }
private void btnSync_Click(object sender, EventArgs e)
{
if (cbTransactionTypes.Text == "KTM Vehicle Purchase")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("KTM Vehicle Purchase Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
procImportExcelDataToDatatable();
}
else if (cbTransactionTypes.Text == "KTM Parts Purchase")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("KTM Parts Purchase Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Vehicle Purchase")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Vehicle Purchase Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Parts Purchase")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Parts Purchase Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "KTM Vehicle Sales")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("KTM Vehicle Sales Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "KTM Parts Sales")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("KTM Parts Sales Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Vehicle Sales")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Vehicle Sales Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Parts Sales")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Parts Sales Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Service Sales")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Service Sales Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
else if (cbTransactionTypes.Text == "Chetak Receipt")
{
pSWTallySyncLogs.WriteLine("================================================================================");
pSWTallySyncLogs.WriteLine("Chetak Receitps Data Import on " + System.DateTime.Now.ToShortDateString() + " @ " + System.DateTime.Now.ToShortTimeString());
pSWTallySyncLogs.WriteLine("================================================================================");
}
}
private void procImportExcelPurchaseToDataTableGST()
{
int i = 0;
string pStrData = "";
string pStrInvNo = "",
pStrDocDate = "",
pStrCustomerCode = "",
pStrInvDate = "",
pStrCustomerName = "";
decimal pDecTotalAmount = 0,
pDecTotalCGST14 = 0,
pDecTotalSGST14 = 0,
pDecTotalCGST9 = 0,
pDecTotalSGST9 = 0,
pDecTotalIGST28 = 0,
pDecTotalIGST18 = 0,
pDecTotalInBillDisc = 0,
pDecTotalCashDisc = 0,
pDecTotalDbMargin = 0,
pDecTotalProjectDisc = 0;
// 1 2 3 4 5 6 7 8 9 10 11 12 13
string pStrDataCols = "Supplier_InvoiceNo;Supplier_Code;Supplier_INvoiceDate;Supplier_Name;Purchase_TotalAmount;Purchase_CGST14;Purchase_SGST14;Purchase_CGST9;Purchase_SGST9;Purchase_IGST28;Purchase_IGST18;InBillDiscAmt;CashDiscAmt;DocDate;DBMarginAmt;ProjectDiscount";
dtExcelSource = oLibDbCommon.CreateTable(pStrDataCols);
pStrDataCols = "Supplier_InvoiceNo;Product_code;Product_Qty;Product_Price;Product_Amount";
dtPurchaseDetails = oLibDbCommon.CreateTable(pStrDataCols);
for (i = 0; i <= dtExcelData.Rows.Count - 1; i++)
{
if (dtExcelData.Rows[i][0].ToString().Contains("PRD") == false)
{
if (dtExcelData.Rows[i][0] == null || dtExcelData.Rows[i][0].ToString() == "")
{
pDecTotalAmount = pDecTotalAmount + pDecTotalCGST14 + pDecTotalCGST9 + pDecTotalSGST14 + pDecTotalSGST9 + pDecTotalIGST18 + pDecTotalIGST28 - (pDecTotalInBillDisc + pDecTotalCashDisc + pDecTotalDbMargin + pDecTotalProjectDisc);
pStrData = pStrInvNo;
pStrData = pStrData + "|" + pStrCustomerCode;
pStrData = pStrData + "|" + pStrInvDate;
pStrData = pStrData + "|" + pStrCustomerName;
pStrData = pStrData + "|" + Math.Round(pDecTotalAmount, 0);
pStrData = pStrData + "|" + pDecTotalCGST14.ToString();
pStrData = pStrData + "|" + pDecTotalSGST14.ToString();
pStrData = pStrData + "|" + pDecTotalCGST9.ToString();
pStrData = pStrData + "|" + pDecTotalSGST9.ToString();
pStrData = pStrData + "|" + pDecTotalIGST28.ToString();
pStrData = pStrData + "|" + pDecTotalIGST18.ToString();
pStrData = pStrData + "|" + pDecTotalInBillDisc.ToString();
pStrData = pStrData + "|" + pDecTotalCashDisc.ToString();
pStrData = pStrData + "|" + pStrDocDate;
pStrData = pStrData + "|" + pDecTotalDbMargin;
pStrData = pStrData + "|" + pDecTotalProjectDisc;
oLibDbCommon.AddRowToDataTable(dtExcelSource, pStrData);
break;
}
if (pStrInvNo != "" && pStrInvNo != dtExcelData.Rows[i][20].ToString())
{
pDecTotalAmount = pDecTotalAmount + pDecTotalCGST14 + pDecTotalCGST9 + pDecTotalSGST14 + pDecTotalSGST9 + pDecTotalIGST18 + pDecTotalIGST28 - (pDecTotalInBillDisc + pDecTotalCashDisc + pDecTotalDbMargin + pDecTotalProjectDisc);
pStrData = pStrInvNo;
pStrData = pStrData + "|" + pStrCustomerCode;
pStrData = pStrData + "|" + pStrInvDate;
pStrData = pStrData + "|" + pStrCustomerName;
pStrData = pStrData + "|" + Math.Round(pDecTotalAmount, 0);
pStrData = pStrData + "|" + pDecTotalCGST14.ToString();
pStrData = pStrData + "|" + pDecTotalSGST14.ToString();
pStrData = pStrData + "|" + pDecTotalCGST9.ToString();
pStrData = pStrData + "|" + pDecTotalSGST9.ToString();
pStrData = pStrData + "|" + pDecTotalIGST28.ToString();
pStrData = pStrData + "|" + pDecTotalIGST18.ToString();
pStrData = pStrData + "|" + pDecTotalInBillDisc.ToString();
pStrData = pStrData + "|" + pDecTotalCashDisc.ToString();
pStrData = pStrData + "|" + pStrDocDate;
pStrData = pStrData + "|" + pDecTotalDbMargin;
pStrData = pStrData + "|" + pDecTotalProjectDisc;
oLibDbCommon.AddRowToDataTable(dtExcelSource, pStrData);
pDecTotalAmount = 0;
pDecTotalCGST14 = 0;
pDecTotalSGST14 = 0;
pDecTotalCGST9 = 0;
pDecTotalSGST9 = 0;
pDecTotalIGST18 = 0;
pDecTotalIGST28 = 0;
pDecTotalCashDisc = 0;
pDecTotalInBillDisc = 0;
pDecTotalDbMargin = 0;
pDecTotalProjectDisc = 0;
}
pStrInvNo = dtExcelData.Rows[i]["AkzoNobel Invoice No"].ToString();
pStrInvDate = dtExcelData.Rows[i]["AkzoNobel Invoice Date"].ToString().Substring(0, 10);
pStrDocDate = dtExcelData.Rows[i]["Document Date"].ToString().Substring(0, 10);
pStrCustomerCode = "P0001";
pStrCustomerName = "Akzo Nobel India Limited";
decimal pDecItemAmount = Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["Amount"].ToString()) ? "0" : dtExcelData.Rows[i]["Amount"].ToString()); //- (Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][21].ToString()) ? "0" : dtExcelData.Rows[i][21].ToString()) + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][22].ToString()) ? "0" : dtExcelData.Rows[i][22].ToString()));
pStrData = dtExcelData.Rows[i]["AkzoNobel Invoice No"].ToString();
pStrData = pStrData + "|" + dtExcelData.Rows[i]["Material"].ToString();
pStrData = pStrData + "|" + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["QTY"].ToString()) ? "0" : dtExcelData.Rows[i]["QTY"].ToString());
pStrData = pStrData + "|" + (Convert.ToDecimal(pDecItemAmount) / Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["QTY"].ToString()) ? "0" : dtExcelData.Rows[i]["QTY"].ToString())).ToString("0.00");
pStrData = pStrData + "|" + pDecItemAmount;
pDecTotalAmount = pDecTotalAmount + pDecItemAmount;
if (dtExcelData.Columns.Contains("CGST%") == true)
{
if (Convert.ToDecimal(dtExcelData.Rows[i]["CGST%"] = string.IsNullOrEmpty(dtExcelData.Rows[i]["CGST%"].ToString()) ? "0" : dtExcelData.Rows[i]["CGST%"].ToString()) == 14)
{
pDecTotalCGST14 = pDecTotalCGST14 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][34].ToString()) ? "0" : dtExcelData.Rows[i][34].ToString());
pDecTotalSGST14 = pDecTotalSGST14 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][37].ToString()) ? "0" : dtExcelData.Rows[i][37].ToString());
}
if (Convert.ToDecimal(dtExcelData.Rows[i]["CGST%"] = string.IsNullOrEmpty(dtExcelData.Rows[i]["CGST%"].ToString()) ? "0" : dtExcelData.Rows[i]["CGST%"].ToString()) == 9)
{
pDecTotalCGST9 = pDecTotalCGST9 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["CGST"].ToString()) ? "0" : dtExcelData.Rows[i]["CGST"].ToString());
pDecTotalSGST9 = pDecTotalSGST9 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["SGST/UTGST"].ToString()) ? "0" : dtExcelData.Rows[i]["SGST/UTGST"].ToString());
}
}
//Cash Discount
if (dtExcelData.Columns.Contains("CashDiscount") == true || dtExcelData.Columns.Contains("HODiscount") == true)
{
if (decimal.Parse(string.IsNullOrEmpty(dtExcelData.Rows[i]["CashDiscount"].ToString()) ? "0" : dtExcelData.Rows[i]["CashDiscount"].ToString()) > 0)
{
pDecTotalCashDisc = pDecTotalCashDisc + decimal.Parse(dtExcelData.Rows[i]["CashDiscount"].ToString());
}
}
if (dtExcelData.Columns.Contains("HODiscount") == true)
{
if (decimal.Parse(string.IsNullOrEmpty(dtExcelData.Rows[i]["HODiscount"].ToString()) ? "0" : dtExcelData.Rows[i]["HODiscount"].ToString()) > 0)
{
pDecTotalCashDisc = pDecTotalCashDisc + decimal.Parse(dtExcelData.Rows[i]["HODiscount"].ToString());
}
}
//DB Margin - in bill discount
if (dtExcelData.Columns.Contains("DBMargin") == true)
{
if (decimal.Parse(string.IsNullOrEmpty(dtExcelData.Rows[i]["DBMargin"].ToString()) ? "0" : dtExcelData.Rows[i]["DBMargin"].ToString()) > 0)
{
pDecTotalDbMargin = pDecTotalDbMargin + decimal.Parse(dtExcelData.Rows[i]["DBMargin"].ToString());
}
}
if (dtExcelData.Columns.Contains("InBillDiscount") == true)
{
if (decimal.Parse(string.IsNullOrEmpty(dtExcelData.Rows[i]["InBillDiscount"].ToString()) ? "0" : dtExcelData.Rows[i]["InBillDiscount"].ToString()) > 0)
{
pDecTotalInBillDisc = pDecTotalInBillDisc + decimal.Parse(dtExcelData.Rows[i]["InBillDiscount"].ToString());
}
}
if (dtExcelData.Columns.Contains("ProjectDiscount") == true)
{
if (decimal.Parse(string.IsNullOrEmpty(dtExcelData.Rows[i]["ProjectDiscount"].ToString()) ? "0" : dtExcelData.Rows[i]["ProjectDiscount"].ToString()) > 0)
{
pDecTotalProjectDisc = pDecTotalProjectDisc + decimal.Parse(dtExcelData.Rows[i]["ProjectDiscount"].ToString());
}
}
if (Convert.ToDecimal(dtExcelData.Rows[i]["TCS"] = string.IsNullOrEmpty(dtExcelData.Rows[i]["TCS"].ToString()) ? "0" : dtExcelData.Rows[i]["TCS"].ToString()) > 0)
{
pDecTotalIGST28 = pDecTotalIGST28 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["TCS"].ToString()) ? "0" : dtExcelData.Rows[i]["TCS"].ToString());
//pDecTotalAmount = pDecTotalAmount +Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][35].ToString()) ? "0" : dtExcelData.Rows[i][35].ToString());
}
if (dtExcelData.Columns.Contains("IGST") == true)
{
if (Convert.ToDecimal(dtExcelData.Rows[i]["IGST"] = string.IsNullOrEmpty(dtExcelData.Rows[i]["IGST"].ToString()) ? "0" : dtExcelData.Rows[i]["IGST"].ToString()) > 0)
{
pDecTotalIGST18 = pDecTotalIGST18 + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i]["IGST"].ToString()) ? "0" : dtExcelData.Rows[i]["IGST"].ToString());
//pDecTotalAmount = pDecTotalAmount + Convert.ToDecimal(string.IsNullOrEmpty(dtExcelData.Rows[i][35].ToString()) ? "0" : dtExcelData.Rows[i][35].ToString());
}
}
oLibDbCommon.AddRowToDataTable(dtPurchaseDetails, pStrData);
}
}
}
private void procImportExcelDataToDatatable()
{
string sourceConnectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 12.0;Persist Security Info=False'", txtFilePath.Text);
OleDbDataAdapter adapter = new OleDbDataAdapter(("SELECT * FROM [" + cbSheet.SelectedItem.ToString() + "$]"), sourceConnectionString);
dtExcelData = new DataTable();
adapter.Fill(dtExcelData);
adapter.Dispose();
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
} }
} }
+17 -17
View File
@@ -120,23 +120,23 @@
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAA
YQUAAAAJcEhZcwAAAOAAAADgAaJf/soAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwa 4AAAAOABol/+ygAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANMSURBVFhHtZfB
AAADTElEQVRYR7WXwU/TUBzHd9MTEIhOgpCAGhXBCSpEA+rNdIkRRzgYPXjxoAlcOcnJP4CEBDl5gYRI T9NQHMd30xMQiE6CkIAaFcEJKkQD6s10iRFHOBg9ePGgCVw5yck/gIQEOXmBhEgEAcMSkYkmBkgwKCJs
BAHDEpGJJgZIMCgibGw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C
</value> </value>
</data> </data>
<data name="btnSync.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="btnSync.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+6
View File
@@ -36,6 +36,9 @@
<Reference Include="LibDbCommon"> <Reference Include="LibDbCommon">
<HintPath>..\..\..\..\..\CommnFuncLibs\.Net 2.0\DLL\LibDbCommon.dll</HintPath> <HintPath>..\..\..\..\..\CommnFuncLibs\.Net 2.0\DLL\LibDbCommon.dll</HintPath>
</Reference> </Reference>
<Reference Include="LibFunctionsCommon">
<HintPath>..\..\..\..\..\CommnFuncLibs\.Net 2.0\DLL\LibFunctionsCommon.dll</HintPath>
</Reference>
<Reference Include="LIBWebRequest"> <Reference Include="LIBWebRequest">
<HintPath>E:\Projects_Repo\VS2013\CommonLIBS\LIBWebRequest\Development\LIBWebRequest\bin\Debug\LIBWebRequest.dll</HintPath> <HintPath>E:\Projects_Repo\VS2013\CommonLIBS\LIBWebRequest\Development\LIBWebRequest\bin\Debug\LIBWebRequest.dll</HintPath>
</Reference> </Reference>
@@ -88,5 +91,8 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
Binary file not shown.
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.WebRequest" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.6.10.0" newVersion="2.6.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
Binary file not shown.
@@ -1 +1 @@
fd575016e264523293ad5fc969c056ccb077753d 3f6f45b58b2fc632b1522cf8564617d896a3dac5
@@ -0,0 +1,16 @@
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.csprojAssemblyReference.cache
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.FrmMain.resources
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.Properties.Resources.resources
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.csproj.GenerateResource.cache
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.csproj.CoreCompileInputs.cache
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\TallyDataTool.exe.config
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\TallyDataTool.exe
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\TallyDataTool.pdb
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\LibDbCommon.dll
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\LIBWebRequest.dll
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\LibConfigCommon.dll
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\LIBWebRequest.pdb
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\bin\Debug\LIBWebRequest.dll.config
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.csproj.CopyComplete
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.exe
D:\Projects\TallyDataTool\BALDealers\CrystalTrradeLinks\TallyDataTool\TallyDataTool\obj\Debug\TallyDataTool.pdb
Binary file not shown.
Binary file not shown.