protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                #region Populating System Types
                try
                {
                    connection.Open();
                    SqlCommand     command = new SqlCommand("Select * From tbl_System WHERE System_RoleID =2;", connection); // needs to be completed
                    DataSet        ds      = new DataSet();
                    SqlDataAdapter sA      = new SqlDataAdapter(command);
                    sA.Fill(ds);
                    StockAt.DataSource     = ds.Tables[0];
                    StockAt.DataTextField  = "SystemName";
                    StockAt.DataValueField = "SystemID";
                    StockAt.DataBind();
                    if (StockAt != null)
                    {
                        StockAt.Items.Insert(0, "Select System");
                        StockAt.SelectedIndex = 0;
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    connection.Close();
                }
                #endregion

                if (StockAt.SelectedIndex == -1)
                {
                    LoadData(null);
                }
                else
                {
                    LoadData(StockAt.SelectedValue);
                }
            }
        }
Esempio n. 2
0
        public void PopulateDropDown(String Text)
        {
            #region Populating Product Name Dropdown

            try
            {
                connection.Open();

                Text = Text + "%";
                SqlCommand     command = new SqlCommand("Select * From tblVendor Where tblVendor.SupName LIKE '" + Text + "'", connection);
                DataSet        ds      = new DataSet();
                SqlDataAdapter sA      = new SqlDataAdapter(command);
                sA.Fill(ds);
                if (StockAt.DataSource != null)
                {
                    StockAt.DataSource = null;
                }

                ProductSet             = null;
                ProductSet             = ds;
                StockAt.DataSource     = ds.Tables[0];
                StockAt.DataTextField  = "SupName";
                StockAt.DataValueField = "SuppID";
                StockAt.DataBind();
                if (StockAt != null)
                {
                    StockAt.Items.Insert(0, "Select Vendor");
                    StockAt.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                connection.Close();
            }
            #endregion
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ProductSet   = new DataSet();
                ProductTable = new DataTable();

                #region Populating Product List
                try
                {
                    connection.Open();

                    /*SqlCommand command = new SqlCommand("Select ProductID, Product_Name From tbl_ProductMaster Where tbl_ProductMaster.Product_Id_Org LIKE '444%' AND Status = 1", connection);
                     * DataSet ds = new DataSet();
                     * SqlDataAdapter sA = new SqlDataAdapter(command);
                     * sA.Fill(ds);
                     * ProductSet = ds;
                     * if (SelectProduct != null)
                     * {
                     * }*/
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    connection.Close();
                }
                #endregion

                #region Populating System Types
                try
                {
                    connection.Open();
                    SqlCommand     command = new SqlCommand("Select * From tbl_System", connection); // needs to be completed
                    DataSet        ds      = new DataSet();
                    SqlDataAdapter sA      = new SqlDataAdapter(command);
                    sA.Fill(ds);
                    StockAt.DataSource     = ds.Tables[0];
                    StockAt.DataTextField  = "SystemName";
                    StockAt.DataValueField = "SystemID";
                    StockAt.DataBind();
                    if (StockAt != null)
                    {
                        StockAt.Items.Insert(0, "Select System");
                        StockAt.SelectedIndex = 0;
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    connection.Close();
                }
                #endregion
            }

            //if( Session["SelectProduct"].Equals(null))
            //{
            //}
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["OrderSalesDetail"] != null && Session["OrderSalesDetail"].Equals(true))
                {
                    FirstOrder = true;
                    systemSet  = new DataSet();
                    ProductSet = new DataSet();
                    LoadData();
                    btnAccept.Visible  = true;
                    btnDecline.Visible = true;
                    #region Populating System Types
                    try
                    {
                        connection.Open();
                        SqlCommand     command = new SqlCommand("Select * From tbl_System WHERE System_RoleID =2;", connection); // needs to be completed
                        DataSet        ds      = new DataSet();
                        SqlDataAdapter sA      = new SqlDataAdapter(command);
                        sA.Fill(ds);
                        StockAt.DataSource     = ds.Tables[0];
                        StockAt.DataTextField  = "SystemName";
                        StockAt.DataValueField = "SystemID";
                        StockAt.DataBind();
                        if (StockAt != null)
                        {
                            StockAt.Items.Insert(0, "Select System");
                            StockAt.SelectedValue = Session["SystemID"].ToString();
                            StockAt.Enabled       = false;
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                    finally
                    {
                        connection.Close();
                    }
                    #endregion

                    if (Session["Invoice"] != null)
                    {
                        txtIvnoice.Text    = Session["Invoice"].ToString();
                        txtIvnoice.Enabled = false;
                    }
                    BindGrid();
                }
                else
                {
                    FirstOrder = false;
                    systemSet  = new DataSet();
                    ProductSet = new DataSet();
                    #region Populating System Types
                    try
                    {
                        connection.Open();
                        SqlCommand     command = new SqlCommand("Select * From tbl_System WHERE System_RoleID =2;", connection); // needs to be completed
                        DataSet        ds      = new DataSet();
                        SqlDataAdapter sA      = new SqlDataAdapter(command);
                        sA.Fill(ds);
                        StockAt.DataSource     = ds.Tables[0];
                        StockAt.DataTextField  = "SystemName";
                        StockAt.DataValueField = "SystemID";
                        StockAt.DataBind();
                        if (StockAt != null)
                        {
                            StockAt.Items.Insert(0, "Select System");
                            StockAt.SelectedIndex = 0;
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                    finally
                    {
                        connection.Close();
                    }
                    #endregion
                    LoadData();
                }
            }
        }