private void LoadCustomer()
        {
            CustomerBLL customer = new CustomerBLL();

            try
            {
                customer.WarehouseId = LumexSessionManager.Get("UserWareHouseId").ToString();
               // DataTable dt = customer.GetActiveCustomerListByWHId();
                DataTable dt = customer.GetActiveCustomerList();
                customerDropDownList.DataSource = dt;
                customerDropDownList.DataValueField = "CustomerId";
                customerDropDownList.DataTextField = "CustomerIdName";
                customerDropDownList.DataBind();
                customerDropDownList.Items.Insert(0, "Select..");
                customerDropDownList.SelectedIndex = 0;


                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true;
                    msgTitleLabel.Text = "Customer are not available !!!";
                    msgDetailLabel.Text = "";
                }
            }
            catch (Exception ex)
            {
                //
            }
        }
예제 #2
0
        //http://service.aaqa.co/sms.asmx/AaqaSMSApi?username=lumextech&pass=dkVBwKnE&MobNo=8801xxxxxxxxx&Sender=xxxxxxxxxxx&msg=xxxxxx
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                msgbox.Visible = false;
                if (!IsPostBack)
                {
                    CustomerBLL customerBll = new CustomerBLL();
                    DataTable dt = new DataTable();
                    dt = customerBll.GetActiveCustomerList();
                    customerListGridView.Visible = true;
                    customerListGridView.DataSource = dt;
                    customerListGridView.DataBind();

                }
                if (customerListGridView.Rows.Count > 0)
                {
                    customerListGridView.UseAccessibleHeader = true;
                    customerListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
            }
            catch (Exception)
            {

                throw;
            }

        }
        protected void LoadActiveCustomerList()
        {
            CustomerBLL customer = new CustomerBLL();

            try
            {
                DataTable dt = customer.GetActiveCustomerList();

                customerIdDropDownList.DataSource = dt;
                customerIdDropDownList.DataValueField = "CustomerId";
                customerIdDropDownList.DataTextField = "CustomerIdName";
                customerIdDropDownList.DataBind();
                //customerIdDropDownList.Items.Insert(0, "");
                //customerIdDropDownList.Items.Insert(1, "Retail");
                //customerIdDropDownList.SelectedIndex = 1;
                customerIdDropDownList.Items.Insert(0, "Retail");
                customerIdDropDownList.SelectedIndex = 0;
                customerIdDropDownList.Items[0].Value = "Retail";
                //Customer Gridview Load
                //  customerListGridView.DataSource = dt;
                //  customerListGridView.DataBind();

                //if (customerListGridView.Rows.Count > 0)
                //{
                //    customerListGridView.UseAccessibleHeader = true;
                //    customerListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                //}

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Customer are not available !!!"; msgDetailLabel.Text = "";
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                customer = null;
            }
        }
        protected void LoadPayToFromCompanyList()
        {
            PayToFromCompanyBLL payToFromCompany = new PayToFromCompanyBLL();

            try
            {
                payToFromCompanyDropDownList.Items.Clear();
                DataTable dt = new DataTable();
                if (payToFromTypeDropDownList.SelectedValue == "com")
                {
                    dt = payToFromCompany.GetActivePayToFromCompanyList();
                    payToFromCompanyDropDownList.DataSource = dt;
                    payToFromCompanyDropDownList.DataValueField = "CompanyId";
                    payToFromCompanyDropDownList.DataTextField = "CompanyName";
                    payToFromCompanyDropDownList.DataBind();
                    lblPaytoFromType.Text = "Company";
                }
                else if (payToFromTypeDropDownList.SelectedValue == "ven")
                {
                    VendorBLL vendor = new VendorBLL();
                    dt = vendor.GetActiveVendors();
                    payToFromCompanyDropDownList.DataSource = dt;
                    payToFromCompanyDropDownList.DataValueField = "VendorId";
                    payToFromCompanyDropDownList.DataTextField = "VendorName";
                    payToFromCompanyDropDownList.DataBind();
                    lblPaytoFromType.Text = "Vendor";
                }
                else if (payToFromTypeDropDownList.SelectedValue == "cus")
                {
                    CustomerBLL customer = new CustomerBLL();
                    dt = customer.GetActiveCustomerList();
                    payToFromCompanyDropDownList.DataSource = dt;
                    payToFromCompanyDropDownList.DataValueField = "CustomerId";
                    payToFromCompanyDropDownList.DataTextField = "CustomerIdName";
                    payToFromCompanyDropDownList.DataBind();
                    lblPaytoFromType.Text = "Customer";

                }



                payToFromCompanyDropDownList.Items.Insert(0, "");
                payToFromCompanyDropDownList.Items.Insert(1, "N/A");
                payToFromCompanyDropDownList.SelectedIndex = 0;

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Pay To/From Company Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                payToFromCompany = null;
            }
        }
예제 #5
0
        protected void selectDropDownList_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            if (selectDropDownList.SelectedValue == "CST")
            {
                CustomerBLL customerBll = new CustomerBLL();
                DataTable dt = new DataTable();
                dt = customerBll.GetActiveCustomerList();
                customerListGridView.Visible = true;
                vendorGridView.Visible = false;
                companyGridView.Visible = false;
                NumberDiv.Visible = false;
                customerListGridView.DataSource = dt;
                customerListGridView.DataBind();
                if (customerListGridView.Rows.Count > 0)
                {
                    customerListGridView.UseAccessibleHeader = true;
                    customerListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }

            }
            else if (selectDropDownList.SelectedValue == "VND")
            {
                VendorBLL vendorBll = new VendorBLL();
                DataTable dt = new DataTable();
                dt = vendorBll.GetVendorList();
                vendorGridView.Visible = true;
                customerListGridView.Visible = false;
                companyGridView.Visible = false;
                NumberDiv.Visible = false;
                vendorGridView.DataSource = dt;
                vendorGridView.DataBind();

                if (vendorGridView.Rows.Count > 0)
                {
                    vendorGridView.UseAccessibleHeader = true;
                    vendorGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }

            }
            else if (selectDropDownList.SelectedValue == "COM")
            {
                CompanyBLL companyBll = new CompanyBLL();
                DataTable dt = new DataTable();
                dt = companyBll.GetActiveCompany();
                companyGridView.Visible = true;
                customerListGridView.Visible = false;
                vendorGridView.Visible = false;
                NumberDiv.Visible = false;
                companyGridView.DataSource = dt;
                companyGridView.DataBind();

                if (companyGridView.Rows.Count > 0)
                {
                    companyGridView.UseAccessibleHeader = true;
                    companyGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }

            }
            else
            {
                customerListGridView.Visible = false;
                vendorGridView.Visible = false;
                companyGridView.Visible = false;
                NumberDiv.Visible = true;
            }
        }