protected void lkbJson_Click(object sender, EventArgs e)
        {
            cls_Invoice_JSON       jsonData    = new cls_Invoice_JSON();
            List <GST_TRN_INVOICE> invoicelist = new List <GST_TRN_INVOICE>();
            var loggedInUser = Common.LoggedInUserID();
            var SellerUserId = uc_GSTNUsers.GetSellerProfile;
            int mName        = Convert.ToInt16(uc_GSTR_Taxpayer.SelectedMonth);


            ////for single list view
            //foreach (ListViewDataItem item in lv_GSTR1_4B.Items)
            //{
            //    string invoiceno = (lv_GSTR1_4B.DataKeys[item.DisplayIndex].Values["InvoiceNo"].ToString());
            //    var data = unitOfWork.InvoiceRepository.Filter(f => f.InvoiceNo == invoiceno).Where(x => x.InvoiceUserID == SellerUserId && x.InvoiceMonth == 5).ToList();
            //    var invid = unitOfWork.InvoiceRepository.Find(f => f.InvoiceNo == invoiceno).InvoiceID;
            //    clsMessageAttribute attribute = new clsMessageAttribute();
            //    var invoiceDetail = unitOfWork.InvoiceRepository.Find(f => f.InvoiceID == invid);
            //    invoicelist.Add(invoiceDetail);
            //}

            ////for all data
            var InvoiceJson = unitOfWork.InvoiceRepository.Filter(f => f.InvoiceUserID == SellerUserId).Where(x => x.InvoiceUserID == SellerUserId && x.InvoiceMonth == mName).ToList();

            string text = jsonData.GetInvoiceJSONData(InvoiceJson);

            Response.Clear();
            Response.ClearHeaders();
            Response.AddHeader("Content-Length", text.Length.ToString());
            Response.ContentType = "text/plain";
            Response.AppendHeader("content-disposition", "attachment;filename=\"data.json\"");
            Response.Write(text);
            Response.End();
        }
Beispiel #2
0
        public void lkbDownload3B_Click(object sender, EventArgs e)
        {
            cls_Invoice_JSON       jsonData    = new cls_Invoice_JSON();
            List <GST_TRN_INVOICE> invoicelist = new List <GST_TRN_INVOICE>();
            var loggedInUser = Common.LoggedInUserID();
            var SellerUserId = uc_GSTNUsers.GetSellerProfile;
            int mName        = Convert.ToInt16(uc_GSTR_Taxpayer.SelectedMonth);

            ////for all data
            var InvoiceJson = unitOfWork.InvoiceRepository.Filter(f => f.InvoiceUserID == SellerUserId).Where(x => x.InvoiceUserID == SellerUserId && x.InvoiceMonth == mName).ToList();

            string text = jsonData.GetInvoiceJSONData(InvoiceJson);

            Response.Clear();
            Response.ClearHeaders();
            Response.AddHeader("Content-Length", text.Length.ToString());
            Response.ContentType = "text/plain";
            Response.AppendHeader("content-disposition", "attachment;filename=\"data.json\"");
            Response.Write(text);
            Response.End();
            //try
            //{
            //    //LinkButton lkbdownload = (LinkButton)sender;
            //    ////String UserID = Convert.ToString(lkbdownload.CommandArgument.ToString());
            //    //var userId = Common.LoggedInUserID();
            //    ////var Month = Convert.ToByte(uc_invoiceMonth.GetValue);
            //    //int mName = Convert.ToInt16(uc_GSTR_Taxpayer.MonthName);
            //    //var SelectedMonth = mName;
            //    ///// var invoice = unitOfWork.OfflineAudittrailRepository.Filter(f => f.UserID == userId).FirstOrDefault();

            //    //ReportGenerate.DownloadGstr_3B(userId, SelectedMonth);
            //}
            //catch (Exception ex)
            //{
            //    cls_ErrorLog ob = new cls_ErrorLog();
            //    cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
            //}
        }