예제 #1
0
        protected void LoadActiveCustomerList()
        {
            CustomerBLL customer = new CustomerBLL();

            try
            {
                customer.WarehouseId = ddlSelectWareHouseOrSalesCenter.SelectedValue;
                DataTable dt = customer.GetActiveCustomerListByWHId();

                customerIdDropDownList.DataSource = dt;
                customerIdDropDownList.DataValueField = "CustomerId";
                customerIdDropDownList.DataTextField = "CustomerIdName";
                customerIdDropDownList.DataBind();
                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 LoadActiveCustomerList()
        {
            CustomerBLL customer = new CustomerBLL();
            customer.WarehouseId = salesCenterDropDownList.SelectedValue;
            try
            {
                DataTable dt = customer.GetActiveCustomerListByWHId();

                customerIdDropDownList.DataSource = dt;
                customerIdDropDownList.DataValueField = "CustomerId";
                customerIdDropDownList.DataTextField = "CustomerIdName";
                customerIdDropDownList.DataBind();
                customerIdDropDownList.Items.Insert(0, "");
                customerIdDropDownList.SelectedIndex = 0;
            }
            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 LoadActiveCustomerList()
        {
            CustomerBLL customer = new CustomerBLL();


            try
            {
                customer.WarehouseId = ddlSelectWareHouseOrSalesCenter.SelectedValue;
                DataTable dt = customer.GetActiveCustomerListByWHId();
                if (dt.Rows.Count > 0)
                {
                    customerIdDropDownList.DataSource = dt;
                    customerIdDropDownList.DataValueField = "CustomerId";
                    customerIdDropDownList.DataTextField = "CustomerIdName";
                    customerIdDropDownList.DataBind();
                    customerIdDropDownList.Items.Insert(0, "");
                    customerIdDropDownList.SelectedIndex = 0;
                }
                else
                {
                    customerIdDropDownList.DataSource = dt;
                    customerIdDropDownList.DataBind();
                    msgbox.Visible = true;
                    msgTitleLabel.Text = "Data Not Found";
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                customer = null;
            }
        }