// [Conditional("max")]
        protected void ShowReport()
        {
            SetData();
            Ob.DatasetMain       = BAL.BALFactory.Instance.Bal_Report.GetProcessWiseSummary(Ob);
            grdReport.DataSource = Ob.DatasetMain;
            grdReport.DataBind();
            AppClass.CalcuateAndSetGridFooter(ref grdReport);
            //SetCoputedDataSet(Ob, grdReport);

            btnExportExcel.Visible = grdReport.Rows.Count > 1;
            if (grdReport.Rows.Count > 0)
            {
                blnRight = AppClass.CheckExportToExcelRightOnPage();
                if (blnRight)
                {
                    btnExportExcel.Visible = true;
                }
                else
                {
                    btnExportExcel.Visible = false;
                }
            }
        }
Esempio n. 2
0
        protected void ShowReport()
        {
            grdReport.DataSource = null;
            grdReport.DataBind();
            Ob.DatasetMain = BAL.BALFactory.Instance.Bal_Report.GetDurationWiseReport(Ob);
            if (Ob.DatasetMain == null || Ob.DatasetMain.Tables.Count == 0 || Ob.DatasetMain.Tables[0].Rows.Count == 0)
            {
                return;
            }

            // SetComputedColumn(Ob, grdReport);
            grdReport.DataSource = Ob.DatasetMain;
            grdReport.DataBind();
            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExport.Visible = true;
            }
            else
            {
                btnExport.Visible = false;
            }
            AppClass.CalcuateAndSetGridFooter(ref grdReport);
        }
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID);

        DTO.Report Ob = new DTO.Report();
        Ob = SetValue();
        DataSet ds = new DataSet();

        if (txtInvoiceNo.Text.Trim() != "")
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryByInvoiceNo(Ob);
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetSaleByInvoiceNo(Ob);
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetDeliveryAndSalesInvoiceNo(Ob);
            }
        }
        else
        {
            var DateFromAndToTmp = hdnDateFromAndTo.Value.Split('-');
            Ob.FromDate = DateFromAndToTmp[0].Trim();
            Ob.UptoDate = DateFromAndToTmp[1].Trim();
            ds          = GetData(Ob);
        }

        ReportViewer1.Reset();
        if (ds.Tables[0].Rows.Count > 0)
        {
            ReportViewer1.Visible = true;
            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                ReportViewer1.ShowExportControls = true;
            }
            else
            {
                ReportViewer1.ShowExportControls = false;
            }
            btnPrint.Visible = true;
            if (drpSelectOption.SelectedValue == "1")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/DeliveryReport.rdlc";
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/SalesReport.rdlc";
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ReportViewer1.LocalReport.ReportPath = "RDLC/SalesDel.rdlc";
            }
            ReportViewer1.LocalReport.EnableHyperlinks = true;
            bool   rights = AppClass.GetShowFooterRightsUser();
            string rvalue = string.Empty;
            if (rights == true)
            {
                rvalue = "1";
            }
            else
            {
                rvalue = "0";
            }
            ReportParameter[] parameters = new ReportParameter[7];
            string            str        = Request.Url.Authority;
            string            newstr     = str + Request.ApplicationPath;
            parameters[0] = new ReportParameter("FromDate", Ob.FromDate);
            parameters[1] = new ReportParameter("ToDate", Ob.UptoDate);
            parameters[2] = new ReportParameter("StrLink", newstr);
            parameters[3] = new ReportParameter("UserName", Globals.UserName);
            parameters[4] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res);
            parameters[5] = new ReportParameter("UserTypeId", Globals.UserType);
            parameters[6] = new ReportParameter("TotalFooter", rvalue);
            ReportViewer1.LocalReport.SetParameters(parameters);
            ReportDataSource rds = new ReportDataSource();
            if (drpSelectOption.SelectedValue == "1")
            {
                rds.Name = "ReportDelivery_Delivery";
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                rds.Name = "ReportDelivery_Sales";
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                rds.Name = "ReportDelivery_SalesDel";
            }
            rds.Value = ds.Tables[0];

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);
            ReportViewer1.DataBind();
            ReportViewer1.LocalReport.Refresh();
            string drpvalue = drpSelectOption.SelectedValue;
            hdp_arr.Value   = "";
            hdd_arr.Value   = "";
            hdDateB.Value   = "";
            hdAmountB.Value = "";
            for (int i = 0; i < ds.Tables["table"].Rows.Count; i++)
            {
                if (drpvalue == "1")
                {
                    hdp_arr.Value += (Convert.ToDateTime(ds.Tables["table"].Rows[i][7].ToString())).ToString("dd/MM/yyyy") + ',';
                    hdd_arr.Value += ds.Tables["table"].Rows[i][5].ToString() + ',';
                }
                else if (drpvalue == "2")
                {
                    hdp_arr.Value += (Convert.ToDateTime(ds.Tables["table"].Rows[i][6].ToString())).ToString("dd/MM/yyyy") + ',';
                    hdd_arr.Value += ds.Tables["table"].Rows[i][5].ToString() + ',';
                }
                else if (drpvalue == "3")
                {
                    hdp_arr.Value   += ds.Tables["table"].Rows[i][12].ToString() + ',';
                    hdd_arr.Value   += ds.Tables["table"].Rows[i][5].ToString() + ',';
                    hdDateB.Value   += ds.Tables["table"].Rows[i][12].ToString() + ',';
                    hdAmountB.Value += ds.Tables["table"].Rows[i][10].ToString() + ',';
                }
            }
        }
        else
        {
            lblMsg.Text = "No delivery and sales  entry found.";
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "setDivMouseOver('Red', '#999999');", true);
            ReportViewer1.Visible = false;
            btnPrint.Visible      = false;
        }
    }
    protected void btnShowReport_Click(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();

        Grdpayment.DataSource = null;
        Grdpayment.DataBind();
        var DateFromAndTo = hdnDateFromAndTo.Value.Split('-');

        strFromDate            = DateFromAndTo[0].Trim();
        strToDate              = DateFromAndTo[1].Trim();
        hdnFromDate.Value      = strFromDate;
        hdnToDate.Value        = strToDate;
        btnExportExcel.Visible = false;
        DTO.Report Ob = new DTO.Report();
        Ob.FromDate = strFromDate;
        Ob.UptoDate = strToDate;
        Ob.CustId   = hdnCustId.Value.Trim();
        Ob.BranchId = Globals.BranchID;
        if (txtCName.Text.Trim() != "")
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleDeliveryByCustomer(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultiplePaymentByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleBothOutPutByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = true;
            }
            if (drpSelectOption.SelectedValue == "4")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleOutstandingGarmentByCustomer(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "5")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetOutstandingPaymentByCustomer(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
        }
        else
        {
            if (drpSelectOption.SelectedValue == "1")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleDeliveryByFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "2")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultiplePaymentByFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "3")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetMultipleBothOutPutFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = true;
            }
            if (drpSelectOption.SelectedValue == "4")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetOutstandinGarmentFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = true;
                btnAcceptPayment.Visible     = false;
                btnDeliverAndPayment.Visible = false;
            }
            if (drpSelectOption.SelectedValue == "5")
            {
                ds = BAL.BALFactory.Instance.Bal_Report.GetPendingPaymentFromToUptoDate(Ob);
                btnDeliverClothes.Visible    = false;
                btnAcceptPayment.Visible     = true;
                btnDeliverAndPayment.Visible = false;
            }
        }
        if (ds.Tables[0].Rows.Count > 0)
        {
            Grdpayment.DataSource = ds;
            Grdpayment.DataBind();
            txtCName.Text = "";
            txtSearchInoviceNo.Focus();
            // btnExportExcel.Visible = true;
            bool blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExportExcel.Visible = true;
            }
            else
            {
                btnExportExcel.Visible = false;
            }
            CalculateGridReport();
            // tblBarcode.Visible = true;
        }
        else
        {
            btnDeliverClothes.Visible    = false;
            btnAcceptPayment.Visible     = false;
            btnDeliverAndPayment.Visible = false;
            // tblBarcode.Visible = false;
        }
        ButtonTrueFalse(drpSelectOption.SelectedValue);
    }
Esempio n. 5
0
        private void ShowBookingDetails(string strStartDate, string strToDate, bool bIsBooking = true)
        {
            DataSet ds = new DataSet();

            grdReport.DataSource = null;
            grdReport.DataBind();
            ob.BranchId       = Globals.BranchID;
            ob.FromDate       = strStartDate;
            ob.UptoDate       = strToDate;
            hdnFromDate.Value = ob.FromDate;
            hdnToDate.Value   = ob.UptoDate;
            ob.InvoiceNo      = (bIsBooking) ? "1" : "2";
            if (drpReportFrom.SelectedItem.Value == "Summarised Booking")
            {
                ob.InvoiceNo = "3";
            }
            else if (drpReportFrom.SelectedItem.Value == "Summarised Delivery")
            {
                ob.InvoiceNo = "4";
            }
            ds = BAL.BALFactory.Instance.Bal_Report.BindServiceTax(ob);
            if (ob.InvoiceNo == "3" || ob.InvoiceNo == "4")
            {
                grdReportSummary.DataSource = ds;
                grdReport.DataSource        = null;
                grdReport.Visible           = false;
                grdReportSummary.Visible    = true;
            }
            else
            {
                grdReportSummary.DataSource = null;
                grdReport.DataSource        = ds;
                grdReport.Visible           = true;
                grdReportSummary.Visible    = false;
            }
            grdReportSummary.DataBind();
            grdReport.DataBind();

            blnRight = AppClass.CheckExportToExcelRightOnPage();
            if (blnRight)
            {
                btnExport.Visible = true;
                if (ds.Tables[0].Rows.Count > 0)
                {
                    btnExport.Visible = true;
                }
                else
                {
                    btnExport.Visible = false;
                }
            }
            else
            {
                btnExport.Visible = false;
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                btnPrint.Visible = true;
            }
            else
            {
                btnPrint.Visible = false;
            }


            ds = BAL.BALFactory.Instance.Bal_Report.BindServiceTax(ob);
            string res = BAL.BALFactory.Instance.BAL_RemoveReason.GetDateTime(Globals.BranchID);

            if (grdReport.Rows.Count > 0)
            {
                //CalculateGridReport();
                AppClass.CalcuateAndSetGridFooter(ref grdReport);
            }
            else if (grdReportSummary.Rows.Count > 0)
            {
                //CalculateGridReportSummary();
                AppClass.CalcuateAndSetGridFooter(ref grdReportSummary, 0, drpReportFrom.SelectedItem.Value == "Summarised Booking" ? 1 : 2);
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ob.InvoiceNo == "1")
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/BookingServiceTax.rdlc";
                }
                else
                if (ob.InvoiceNo == "2")
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/DeliveryServiceTax.rdlc";
                }
                else
                if (ob.InvoiceNo == "3")
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/SumBookingServiceTax.rdlc";
                }
                else
                {
                    ReportViewer1.LocalReport.ReportPath = "RDLC/SumDeliveryServiceTax.rdlc";
                }
                ReportDataSource  rds        = new ReportDataSource();
                ReportParameter[] parameters = new ReportParameter[7];
                parameters[0] = new ReportParameter("UserName", Globals.UserName);
                parameters[1] = new ReportParameter("GeneratedDate", "@" + " " + DateTime.Today.ToString("dd MMM yyyy") + " " + res);
                parameters[2] = new ReportParameter("FromDate", ob.FromDate);
                parameters[3] = new ReportParameter("ToDate", ob.UptoDate);
                parameters[4] = new ReportParameter("Tax1", _LabelTax1);
                parameters[5] = new ReportParameter("Tax2", _LabelTax2);
                parameters[6] = new ReportParameter("Tax3", _LabelTax3);

                //parameters[2] = new ReportParameter("Link", str);
                ReportViewer1.LocalReport.SetParameters(parameters);
                rds.Name  = "DataSet1";
                rds.Value = ds.Tables[0];
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.LocalReport.Refresh();
            }
        }
Esempio n. 6
0
        private void ShowBookingDetails(string strStartDate, string strToDate)
        {
            grdReport.DataSource = null;
            grdReport.DataBind();
            btnExport.Visible = false;
            DTO.Report.BFlag  = false;

            if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
            {
                HttpContext.Current.Items.Add("IsPrintingForMany", "false");
            }
            else
            {
                HttpContext.Current.Items["IsPrintingForMany"] = "false";
            }

            hdnDTOReportsBFlag.Value = "false";

            DTO.Report ObMain = new DTO.Report();
            ObMain.FromDate  = strStartDate;
            ObMain.UptoDate  = strToDate;
            ObMain.InvoiceNo = txtInvoiceNo.Text;
            ObMain.BranchId  = Globals.BranchID;
            if (txtInvoiceNo.Text != "")
            {
                ObMain.Description = "6";
            }
            else
            {
                ObMain.Description = "5";
            }
            DataSet dsMain = new DataSet();

            dsMain = BAL.BALFactory.Instance.Bal_Report.GetDataMainReport(ObMain);
            try
            {
                if (dsMain.Tables.Count > 0)
                {
                    if (dsMain.Tables[0].Rows.Count > 0)
                    {
                        if (dsMain.Tables[0].Columns[0].ColumnName == "Error")
                        {
                            throw new Exception(dsMain.Tables[0].Rows[0][1].ToString());
                        }
                        grdReport.DataSource = dsMain.Tables[0];
                        grdReport.DataBind();
                        DTO.Report.BFlag = false;

                        if (!HttpContext.Current.Items.Contains("IsPrintingForMany"))
                        {
                            HttpContext.Current.Items.Add("IsPrintingForMany", "false");
                        }
                        else
                        {
                            HttpContext.Current.Items["IsPrintingForMany"] = "false";
                        }

                        hdnDTOReportsBFlag.Value = "false";
                        ViewState["SavedDS"]     = dsMain;
                        AppClass.CalcuateAndSetGridFooter(ref grdReport);
                        bool blnRight = AppClass.CheckExportToExcelRightOnPage();
                        if (blnRight)
                        {
                            btnExport.Visible = true;
                        }
                        else
                        {
                            btnExport.Visible = false;
                        }
                    }
                }
            }
            catch (Exception excp)
            {
                lblErr.Text = "Error : " + excp.Message;
            }
            finally
            {
                txtInvoiceNo.Focus();
            }
        }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ArrayList Date = BAL.BALFactory.Instance.BAL_DateAndTime.getDateAndTimeAccordingToZoneTime(Session["BID"].ToString());
         if (Request.QueryString["Acess"] != null)
         {
             Session["ReturnMsg"] = "You are not authorized !";
             return;
         }
         if (Request.QueryString["Tab"] != null)
         {
             Session["ReturnMsg"] = "Stock reconcilliation is already open.";
             return;
         }
         bool status = DAL.DALFactory.Instance.DAL_NewChallan.DefaultFactory(Globals.BranchID);
         strCurrentDate = Date[0].ToString();
         if (status == true)
         {
             grdReport.Visible              = false;
             grdDelivery.Visible            = false;
             grdHomeDelivery.Visible        = false;
             grdCustomerAnniversary.Visible = false;
             grdCustomerBirthDay.Visible    = false;
             btnUrgentBookingShow.Visible   = false;
             btnTodayDelivered.Visible      = false;
             btnHomeDelivery.Visible        = false;
             btnCustomerBirthday.Visible    = false;
             btnAnniversary.Visible         = false;
             lblCustAni.Visible             = false;
             Label4.Visible      = false;
             lblCustBirt.Visible = false;
             Label3.Visible      = false;
             lblHomDel.Visible   = false;
             Label2.Visible      = false;
             Label6.Visible      = false;
             LblUBook.Visible    = false;
             Label1.Visible      = false;
         }
         else
         {
             strFromDate = strCurrentDate;
             ShowBookingDetails1(strFromDate);
             ShowBookingDetails2(strFromDate);
             ShowCustomerBirthday(strFromDate);
             ShowCustomerAnniversary(strFromDate);
             ShowBookingDetails(strFromDate);
             blnRight = AppClass.CheckExportToExcelRightOnPage();
             if (blnRight)
             {
                 btnHomeDelivery.Visible      = true;
                 btnCustomerBirthday.Visible  = true;
                 btnAnniversary.Visible       = true;
                 btnTodayDelivered.Visible    = true;
                 btnUrgentBookingShow.Visible = true;
             }
             else
             {
                 btnHomeDelivery.Visible      = false;
                 btnCustomerBirthday.Visible  = false;
                 btnAnniversary.Visible       = false;
                 btnTodayDelivered.Visible    = false;
                 btnUrgentBookingShow.Visible = false;
             }
         }
         if (Request.QueryString["Backup"] != null)
         {
             SetBackup();
         }
     }
 }