private void initLocation() { //初始化用户下拉列表 string sql = "select distinct location_code from ms_location_time where gzdd in (select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "')" + "and location_code not in (select location_code from code_location where pline_code in (select pline_id from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "' )) order by location_code"; SqlLocation.SelectCommand = sql; SqlLocation.DataBind(); }
protected void ASPxListBoxLocation_Callback(object sender, CallbackEventArgsBase e) { string pline = e.Parameter; string sql = "select distinct location_code from ms_location_time where gzdd ='" + pline + "'" + "and location_code not in (select location_code from code_location ) order by location_code"; SqlLocation.SelectCommand = sql; SqlLocation.DataBind(); ASPxListBoxLocation.DataBind(); }
protected void btnSaveInventory_Click(object sender, EventArgs e) { //SqlInventory.InsertParameters["Inventory_ID"].DefaultValue = InventoryTextBox.Text.ToUpper().Trim(); SqlLocation.InsertParameters["Warehouse_ID"].DefaultValue = WarehouseIDDropDownList.SelectedValue; SqlLocation.InsertParameters["Area"].DefaultValue = AreaTextBox.Text.ToUpper().Trim(); SqlLocation.InsertParameters["Location_Name"].DefaultValue = InventoryNameTextBox.Text.ToUpper().Trim(); SqlLocation.Insert(); gvInventory.DataBind(); PaneladdInventory.Visible = false; PanelgvInventory.Visible = true; InventoryNameTextBox.Text = string.Empty; WarehouseIDDropDownList.SelectedIndex = -1; AreaTextBox.Text = string.Empty; }