void TakeAction(int ActionCode, string ActionDesc) { PL_GSTR2AAction objpl = new PL_GSTR2AAction(); objpl.Ind = 2; objpl.ClientCode = int.Parse(Session["ClientCode"].ToString()); objpl.ClientCodeOdp = int.Parse(Session["ClientCodeOdp"].ToString()); objpl.GSTIN = Session["ClientGSTNNO"].ToString(); objpl.MonthCD = int.Parse(Session["MonthYrCode"].ToString()); objpl.ActionCode = ActionCode; objpl.ActionDesc = ActionDesc; objpl.UserCode = int.Parse(Session["UserCode"].ToString()); DataTable dt = new DataTable(); dt.Columns.Add("InvoiceNumber"); objpl.dt = dt; int Rowindex = 0; foreach (GridViewRow gvr in grdMismatch.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelect"); Label lblInvoiceNo = (Label)gvr.FindControl("lblInvoiceNo"); if (chk.Checked) { dt.Rows.Add(); dt.Rows[Rowindex][0] = lblInvoiceNo.Text; Rowindex++; } } DataSet dsres = CLSCommon.CallApiPostDS("api/GSTR2AAction/TakeAction", objpl); if (dsres != null) { pnlMsg.Visible = true; lblMEssage.Text = "Action Taken Successfully On " + dt.Rows.Count.ToString() + " Invoices."; grdMismatch.DataSource = dsres.Tables[0]; grdMismatch.DataBind(); lblTotalInvoice.Text = dsres.Tables[2].Rows[0]["TotalInvoices"].ToString(); lblPendingInvoice.Text = dsres.Tables[3].Rows[0]["Pending"].ToString(); lblActionTaken.Text = dsres.Tables[1].Rows[0]["ActionTakenCount"].ToString(); lblAccepted.Text = dsres.Tables[4].Rows[0]["TotalAccept"].ToString(); lblRejected.Text = dsres.Tables[4].Rows[0]["TotalReject"].ToString(); lblModify.Text = dsres.Tables[4].Rows[0]["TotalModify"].ToString(); lblPending.Text = dsres.Tables[4].Rows[0]["TotalPending"].ToString(); lblDelete.Text = dsres.Tables[4].Rows[0]["TotalDelete"].ToString(); } }
protected void btnUpload_Click(object sender, EventArgs e) { if (fuExcelImport.HasFile) { if (Path.GetExtension(fuExcelImport.PostedFile.FileName) == ".json") { PL_GSTR2ImportJson objpl = new PL_GSTR2ImportJson(); objpl.Ind = 1; objpl.ClientCode = int.Parse(Session["ClientCode"].ToString()); objpl.ClientCodeOdp = int.Parse(Session["ClientCodeOdp"].ToString()); objpl.GSTNNO = Session["ClientGSTNNO"].ToString(); objpl.MonthCD = int.Parse(Session["MonthYrCode"].ToString()); objpl.UserCode = int.Parse(Session["UserCode"].ToString()); string inputContent; using (StreamReader inputStreamReader = new StreamReader(fuExcelImport.PostedFile.InputStream)) { inputContent = inputStreamReader.ReadToEnd(); } objpl.JsonData = inputContent; DataSet ds = CLSCommon.CallApiPostDS("api/GSTR2ImportJson/Importjson", objpl); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0][0].ToString() == "1") { Panels.Visible = true; Panels.Attributes.Add("class", "alert alert-success"); DataView view = new DataView(ds.Tables[0]); DataTable distinctValues = view.ToTable(true, "CurrInvoiceNo"); string TotalRows = Convert.ToString(distinctValues.Rows.Count); lblTotalRecords.Text = TotalRows; //dt.Rows.Count.ToString(); lblImported.Text = TotalRows; //dt.Rows.Count.ToString(); lblMessage.Text = "Json File Imported Successfully. \n Total Invoice : " + TotalRows; // dt.Rows.Count.ToString(); lnkbtnViewError.Visible = false; } } } } } }
void TakeAction(int ActionCode, string ActionDesc) { PL_GSTR2Action objpl = new PL_GSTR2Action(); objpl.Ind = 2; objpl.ClientCode = int.Parse(Session["ClientCode"].ToString()); objpl.ClientCodeOdp = int.Parse(Session["ClientCodeOdp"].ToString()); objpl.GSTIN = Session["ClientGSTNNO"].ToString(); objpl.MonthCD = int.Parse(Session["MonthYrCode"].ToString()); objpl.ActionCode = ActionCode; objpl.ActionDesc = ActionDesc; objpl.UserCode = int.Parse(Session["UserCode"].ToString()); objpl.ApiTableCode = int.Parse(Convert.ToString(Request.QueryString["RecordNo"])); DataTable dt = new DataTable(); dt.Columns.Add("InvoiceNumber"); objpl.dt = dt; int Rowindex = 0; foreach (GridViewRow gvr in Gridb2b.Rows) { CheckBox chk = (CheckBox)gvr.FindControl("chkSelect"); Label lblInvoiceNo = (Label)gvr.FindControl("lblInvoiceNo"); if (chk.Checked) { dt.Rows.Add(); dt.Rows[Rowindex][0] = lblInvoiceNo.Text; Rowindex++; } } DataSet dsres = CLSCommon.CallApiPostDS("api/GSTR2Action/TakeAction", objpl); if (dsres != null) { pnlMsg.Visible = true; lblMEssage.Text = "Action Taken Successfully On " + dt.Rows.Count.ToString() + " Invoices."; Gridb2b.DataSource = dsres.Tables[0]; Gridb2b.DataBind(); } }