예제 #1
0
    protected void DDLGodown_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            TBBarcode.Enabled    = true;
            DDLItemName.Enabled  = true;
            TBSearchCode.Enabled = true;

            string  ss3 = "SELECT ID,Name FROM RawMaterial";
            DataSet ds3 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss3);
            if (ds3.Tables[0].Rows.Count > 0)
            {
                DDLItemName.Items.Clear();
                DDLItemName.DataSource     = ds3.Tables[0];
                DDLItemName.DataTextField  = "Name";
                DDLItemName.DataValueField = "ID";
                DDLItemName.DataBind();
                DDLItemName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Select-", "0"));
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, MessageType.Error);
        }
    }
예제 #2
0
    protected void DDLRecItemEntry_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            TBBarcode.Enabled    = true;
            DDLItemName.Enabled  = true;
            TBSearchCode.Enabled = true;
            LBAddAllItem.Enabled = true;

            string  ss = "SELECT Supplier FROM Receive_Master WHERE ID='" + DDLRecItemEntry.SelectedValue + "'";
            DataSet ds = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss);
            if (ds.Tables[0].Rows.Count > 0)
            {
                DDLSupplier.ClearSelection();
                DDLSupplier.Items.FindByValue(ds.Tables[0].Rows[0][0].ToString()).Selected = true;
            }

            string  ss2 = "SELECT ID FROM Godown WHERE NGOID='" + DDLBusinessLocation.SelectedValue + "' AND ComID='" + Session["ComID"] + "'";
            DataSet ds2 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss2);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                DDLGodown.ClearSelection();
                DDLGodown.Items.FindByValue(ds2.Tables[0].Rows[0][0].ToString()).Selected = true;
            }

            string  ss3 = "SELECT dbo.RawMaterial.ID,dbo.RawMaterial.Name FROM dbo.Receive_details INNER JOIN dbo.RawMaterial ON dbo.Receive_details.ItemID = dbo.RawMaterial.ID WHERE (dbo.Receive_details.rec_Id = '" + DDLRecItemEntry.SelectedValue + "')";
            DataSet ds3 = SqlHelper.ExecuteDataset(Connection.connect(), CommandType.Text, ss3);
            if (ds3.Tables[0].Rows.Count > 0)
            {
                DDLItemName.Items.Clear();
                DDLItemName.DataSource     = ds3.Tables[0];
                DDLItemName.DataTextField  = "Name";
                DDLItemName.DataValueField = "ID";
                DDLItemName.DataBind();
                DDLItemName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("-Select-", "0"));
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, MessageType.Error);
        }
    }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((Session["UserName"] == null) || (Session["CompanyName"] == null || Session["Bid"] == null))
            {
                Response.Redirect("Login.aspx");
            }
            SqlDataSource1.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            SqlDataSource2.ConnectionString = Utility.DBconnection.connect_string(Session["DatabaseName"].ToString());
            SqlDataSource1.SelectCommand    = "SELECT UID,LayerCode, ItemOrder , ItemName AS FullName FROM Bid_WBS where bid=" + Session["Bid"].ToString() + " ORDER BY LayerCode";
            if (ParentID != "")
            {
                SqlDataSource2.SelectCommand = "select * from  Bid_Library where  BID=" + Session["Bid"].ToString() + " AND PriceID not in (select KidID from Bid_AnaRelation where ParentID=" + ParentID + ") and PriceID<>" + ParentID + " ORDER BY [PriceID]";
            }
            if (!IsPostBack)
            {
                string database = Session["DatabaseName"].ToString();
                DDL_EdUnit.DataSource = Utility.Unitlist.UnitList();
                DDL_EdUnit.DataBind();

                DataTable dt = WebModel.LoadSetContentData(database, SqlDataSource1.SelectCommand);
                dt.Columns.Add("FullName1", typeof(string), "ItemOrder + '-' + FullName");

                //DDLItemNmae.DataSourceID = "SqlDataSource1";
                DDLItemName.DataValueField = "UID";


                DDLItemName.DataSource    = dt;
                DDLItemName.DataTextField = "FullName1";
                DDLItemName.DataBind();
            }
            if ((Session["AddNew"].ToString() == "1"))
            {
                Pnl_WBS.Visible      = true;
                Pnl_Analysis.Visible = false;
                Pnl_Import.Visible   = false;
            }
            else if ((Session["AddNew"].ToString() == "2"))
            {
                Pnl_WBS.Visible      = false;
                Pnl_Analysis.Visible = true;
                LoadContent();
            }


            //string database = Session["DatabaseName"].ToString();
            string FdSearch = SystemSet.CheckMSSQLLike(SystemSet.ReplaceBlank(TxSearch.Text));

            if (ViewState["all"] != null && (bool)this.ViewState["all"] == true)
            {
                BtnAll_Click(this, null);
            }
            if (PriceID != "")
            {
                string SelectString = "";
                SelectString  = (Session["Bid"] != null) ? "Bid=" + Session["Bid"].ToString() + " and " : "";
                SelectString  = (DDL_WBS.SelectedValue != "0") ? "Code like '%" + DDL_WBS.SelectedValue + "%' " + DDL_Op2.SelectedValue + "" : "";
                SelectString += (FdSearch != "") ? " ItemName like '%" + FdSearch + "%' " : "";
                SelectString  = (SelectString.Length > 1) ? " and " + SelectString + " ORDER BY [PriceID]" : "";
                SqlDataSource2.SelectCommand = "select * from  Bid_Library where  BID=" + Session["Bid"].ToString() + " AND PriceID not in (select KidID from Bid_AnaRelation where ParentID=" + PriceID + ") and PriceID<>" + PriceID + "";


                SqlDataSource2.SelectCommand += SelectString;
            }
        }