protected void Page_Load(object sender, EventArgs e)
        {
            if (Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn] == null || Convert.ToBoolean(Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn]) == false ||
                (MtbBillCollection.Utility.Screen.IsUserPermitedToAccessScreen(Convert.ToInt32(Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.UserTypeId].ToString()), "ViewCollections")) == false)
            {
                Response.Redirect("/Default.aspx");
            }


            if (!IsPostBack)
            {
                gData = 100;

                txtFromDate.Text = DateTime.Now.ToString("dd-MM-yyyy");
                txtToDate.Text   = DateTime.Now.ToString("dd-MM-yyyy");


                ClientList.DataSource = _bilCollectionManager.GetClientist();
                ClientList.DataBind();

                InstrumentTypeList.DataSource = _bilCollectionManager.GetInstrumentTypeist();
                InstrumentTypeList.DataBind();
                InstrumentTypeList.RepeatDirection = RepeatDirection.Horizontal;


                CollectionStatusType.DataSource = _bilCollectionManager.GetCollectionStatusType();
                CollectionStatusType.DataBind();
                CollectionStatusType.RepeatDirection = RepeatDirection.Horizontal;

                ProducTypeList.DataSource = _bilCollectionManager.GetProductList(1);
                ProducTypeList.DataBind();
                ProducTypeList.RepeatDirection = RepeatDirection.Horizontal;

                txtFromDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
                txtToDate.Text   = DateTime.Now.ToString("dd/MM/yyyy");
            }
            else
            {
                DataTable rptTable = (DataTable)Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.CollectionReport];

                if (rptTable != null)
                {
                    rptTable.TableName = "CollectionStatement";
                    _crystalReport     = new ReportDocument();
                    _crystalReport.Load(Server.MapPath("~/Reports/rptCollectionStatment.rpt"));
                    _crystalReport.SetDataSource(rptTable);
                    CrystalReportViewer1.ReportSource = _crystalReport;
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn] == null || Convert.ToBoolean(Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn]) == false) ||
                (MtbBillCollection.Utility.Screen.IsUserPermitedToAccessScreen(Convert.ToInt32(Session["userTypeId"].ToString()), "Clearing")) == false)
            {
                Response.Redirect("/Default.aspx");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    gridCollList.Enabled  = false;
                    gridCollList.Visible  = false;
                    ClientList.DataSource = _bilCollectionManager.GetClientist();
                    ClientList.DataBind();

                    if (ClientList.Items.Count > 0)
                    {
                        ClientList.SelectedIndex = 0;
                        //lblClient.Text = ClientList.Text;
                        _clientid = ClientList.Items[0].Value;
                    }
                    ViewState.Add(MtbBillCollection.Global.Definitions.SessionVariable.Value.ClientId, _clientid);
                    _authenticationManger.ConnectionString = MtbBillCollection.WebConfigManager.GetCollDBConnString();
                    cboBranch.DataSource = _authenticationManger.GetBranchList();
                    cboBranch.DataBind();

                    InstrumentTypeList.DataSource = _bilCollectionManager.GetInstrumentTypeist();
                    InstrumentTypeList.DataBind();
                    InstrumentTypeList.RepeatDirection = RepeatDirection.Horizontal;

                    ProducTypeList.DataSource = _bilCollectionManager.GetProductList(1);
                    ProducTypeList.DataBind();
                    ProducTypeList.RepeatDirection = RepeatDirection.Horizontal;

                    txtFromDate.Text     = DateTime.Now.ToString("dd/MM/yyyy");
                    txtToDate.Text       = DateTime.Now.ToString("dd/MM/yyyy");
                    txtConfirmation.Text = "";
                }
                else
                {
                    gridCollList.Enabled = true;
                    gridCollList.Visible = true;
                    txtConfirmation.Text = "";
                }
            }
        }