Esempio n. 1
0
 protected void ClientList_SelectedIndexChanged(object sender, EventArgs e)
 {
     //lblClient.Text = ClientList.SelectedItem.Text;
     ProductList.DataSource = _bilCollectionManager.GetProductList(Convert.ToInt32(ClientList.SelectedValue));
     ProductList.DataBind();
     ProductList.SelectedIndex     = (ProductList.Items.Count > 0) ? 0 : -1;
     CollectionTypeList.DataSource = _bilCollectionManager.GetCollectionTypeList(Convert.ToInt32("0" + ClientList.SelectedValue));
     CollectionTypeList.DataBind();
     TranssactionTypeList.DataSource = _bilCollectionManager.GetTransactionTypeList(Convert.ToInt32(ClientList.SelectedValue), Convert.ToInt32("0" + ProductList.SelectedValue.ToString()));
     TranssactionTypeList.DataBind();
     if (TranssactionTypeList.Items.Count > 0)
     {
         TranssactionTypeList.SelectedIndex = 0;
     }
     ProductTypeSelectedIndexChanged();
     EnableOrDisableInstrumentFields();
     //if (TranssactionTypeList.SelectedIndex == MtbBillCollection.Global.Definitions.InstType.Value.CASH)
     //{
     //    InstrumentDate.Enabled = false;
     //    InstrumentNo.Enabled = false;
     //}
     //else
     //{
     //    InstrumentDate.Enabled = true;
     //    InstrumentNo.Enabled = true;
     //}
     //InstrumentAmount.Enabled = true;
 }
Esempio n. 2
0
 protected void ProductList_SelectedIndexChanged(object sender, EventArgs e)
 {
     CollectionTypeList.DataSource = _bilCollectionManager.GetCollectionTypeList(Convert.ToInt32(ClientList.SelectedValue));
     CollectionTypeList.DataBind();
     TranssactionTypeList.DataSource = _bilCollectionManager.GetTransactionTypeList(Convert.ToInt32(ClientList.SelectedValue), Convert.ToInt32(ProductList.SelectedValue));
     TranssactionTypeList.DataBind();
     ProductTypeSelectedIndexChanged();
     EnableOrDisableInstrumentFields();
 }
Esempio n. 3
0
        private void ProductTypeSelectedIndexChanged()
        {
            string pType;

            //lblStatus.Text = "";
            if (ProductList.SelectedItem.Text == MtbBillCollection.Global.Definitions.ProductType.Name.Prepaid)
            {
                isPrepaid = true;
                pType     = MtbBillCollection.Global.Definitions.ProductType.Value.Prepaid.ToString();
                lblCollectionFromID.Text         = "POS Code : ";
                InstrumentNo.Text                = "";
                InstrumentNo.Enabled             = false;
                InstrumentDate.Text              = "";
                InstrumentDate.Enabled           = false;
                InstrumentBankList.SelectedIndex = 0;
                InstrumentBankList.Enabled       = false;
                CollectionTypeList.SelectedValue = Convert.ToString(MtbBillCollection.Global.Definitions.CollectionType.Value.Bill);
                CollectionTypeList.Enabled       = false;
                ImgBntCalc.Enabled               = false;
            }
            else
            {
                isPrepaid = false;
                pType     = ProductList.SelectedValue;
                if (ProductList.SelectedItem.Text == MtbBillCollection.Global.Definitions.ProductType.Name.Fees)
                {
                    lblCollectionFromID.Text = "POS Code : ";
                }
                else
                {
                    lblCollectionFromID.Text = "Mobile No : ";
                }
                InstrumentNo.Enabled             = true;
                InstrumentDate.Enabled           = true;
                InstrumentDate.Text              = DateTime.Now.ToString("dd/MM/yyyy");
                InstrumentBankList.SelectedIndex = 0; //make it MTB by default
                InstrumentBankList.Enabled       = true;
                CollectionTypeList.SelectedIndex = 0;
                CollectionTypeList.Enabled       = true;
                ImgBntCalc.Enabled = true;
            }
            TranssactionTypeList.DataSource = _bilCollectionManager.GetTransactionTypeList(Convert.ToInt32(ClientList.SelectedValue), Int32.Parse("0" + pType));
            TranssactionTypeList.DataBind();
        }
Esempio n. 4
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[MtbBillCollection.Global.Definitions.SessionVariable.Value.UserTypeId].ToString()), "BillCollection")) == false)
            {
                Response.Redirect("/Default.aspx");
            }

            if (!Page.IsPostBack)
            {
                ClientList.DataSource = _bilCollectionManager.GetClientist();
                ClientList.DataBind();

                if (Request.QueryString.Count > 0)
                {
                    _clientid = Server.HtmlDecode(Request.QueryString[MtbBillCollection.Global.Definitions.SessionVariable.Value.ClientId].ToString());
                    ClientList.SelectedValue = _clientid;
                    //lblClient.Text = ClientList.SelectedItem.Text;
                    ViewState.Add(MtbBillCollection.Global.Definitions.SessionVariable.Value.ClientId, _clientid);
                }
                else
                {
                    if (ClientList.Items.Count > 0)
                    {
                        ClientList.SelectedIndex = 0;
                        //lblClient.Text = ClientList.Text;
                        _clientid = ClientList.Items[0].Value;
                    }
                }

                InstrumentDate.Text = DateTime.Now.Date.ToString("dd-MM-yyyy");
                //lblCollectionDateValue.Text = DateTime.Now.Date.ToString("dd/MMM/yyyy");
                //Date.Text = DateTime.Now.ToString("dd-MMM-yyyy");
                if (_clientid != "-1")
                {
                    ProductList.DataSource = _bilCollectionManager.GetProductList(Convert.ToInt32(_clientid));
                    ProductList.DataBind();
                    CollectionTypeList.DataSource = _bilCollectionManager.GetCollectionTypeList(Convert.ToInt32(_clientid));
                    CollectionTypeList.DataBind();
                    TranssactionTypeList.DataSource = _bilCollectionManager.GetTransactionTypeList(Convert.ToInt32(_clientid), Convert.ToInt32(ProductList.Items[0].Value));
                    TranssactionTypeList.DataBind();
                }
                //else
                //{
                //    ProductList.DataSource = _bilCollectionManager.GetProductList(Convert.ToInt32(ClientList.Items[0].Value));
                //    ProductList.DataBind();
                //    CollectionTypeList.DataSource = _bilCollectionManager.GetCollectionTypeList(Convert.ToInt32(ClientList.Items[0].Value));
                //    CollectionTypeList.DataBind();
                //    TranssactionTypeList.DataSource = _bilCollectionManager.GetTransactionTypeList(Convert.ToInt32(ClientList.Items[0].Value), Convert.ToInt32(ProductList.Items[0].Value));
                //    TranssactionTypeList.DataBind();
                //    TranssactionTypeList.SelectedIndex = (TranssactionTypeList.Items.Count > 0) ? 0 : -1;
                //}

                InstrumentBankList.DataSource = _bilCollectionManager.GetBankList();
                InstrumentBankList.DataBind();


                ProductTypeSelectedIndexChanged();
                if (Request.QueryString.Count > 1)
                {
                    _collectionId             = Server.HtmlDecode(Request.QueryString[MtbBillCollection.Global.Definitions.SessionVariable.Value.CollectionId].ToString());
                    _billCollectionInfo       = _bilCollectionManager.GetCollectionInformtion(_collectionId);
                    ProductList.SelectedValue = _billCollectionInfo.ProductId.ToString();
                    ProductTypeSelectedIndexChanged();
                    CollectionTypeList.SelectedValue = _billCollectionInfo.CollectionTypeId.ToString();
                    CollectionFrom.Text = _billCollectionInfo.CollFrom;
                    TranssactionTypeList.SelectedValue = _billCollectionInfo.InstTypeId.ToString();
                    InstrumentNo.Text   = _billCollectionInfo.InstNumber;
                    InstrumentDate.Text = _billCollectionInfo.InstDate;
                    string[] amnt = null;
                    amnt = _billCollectionInfo.CollAmount.ToString().Split('.');
                    if (amnt.Length > 0)
                    {
                        InstrumentAmount.Text = amnt[0];
                        if (amnt.Length == 2)
                        {
                            InstrumentAmount.Text += "." + amnt[1].Substring(0, 2);
                        }
                    }

                    InstrumentBankList.SelectedValue = _billCollectionInfo.InstBankCode.ToString();
                    txtRemarks.Text = _billCollectionInfo.Remarks;
                    //SaveButton.Text = "Update";
                    _previousPage = this.PreviousPage;
                    _saveMode     = false;
                    ViewState.Add(MtbBillCollection.Global.Definitions.SessionVariable.Value.SaveMode, _saveMode);
                    ViewState.Add(MtbBillCollection.Global.Definitions.SessionVariable.Value.CollectionId, _collectionId);
                }
                else
                {
                    CollectionFrom.Focus();
                    initializeFields();
                }
                //TranssactionTypeList.Attributes.Add("onchange", "ShowData()");
            }
            else
            {
                ProductList.Enabled          = true;
                TranssactionTypeList.Enabled = true;

                InstrumentAmount.Enabled   = true;
                InstrumentBankList.Enabled = true;
            }
            EnableOrDisableInstrumentFields();
        }