#region Imports... using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WMS.Web.UI; using WMS.Services; using WMS.Entities; #endregion public partial class Project_Managers_WeldManager : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { #region Page Load Helpers if (!Page.IsPostBack) { #region Common Form Setup //DropDownList Population //Weld Type: TList WeldTypeList = new WeldTypeBLL().GetAll(); DDL_WeldType.DataValueField = "WeldTypeId"; DDL_WeldType.DataTextField = "WeldTypeName"; DDL_WeldType.DataSource = WeldTypeList; DDL_WeldType.DataBind(); TList WelderList = new WelderBLL().GetAll(); DDL_Welder.DataValueField = "WelderId"; DDL_Welder.DataTextField = "WelderId"; DDL_Welder.DataSource = WelderList; DDL_Welder.DataBind(); TList WeldProcedureList = new WeldProcedureBLL().GetAll(); DDL_WeldProcedure.DataValueField = "WeldProcedureId"; DDL_WeldProcedure.DataTextField = "ProcedureName"; DDL_WeldProcedure.DataSource = WeldProcedureList; DDL_WeldProcedure.DataBind(); //will have to only get welds on / drawings / projects TList WeldList = new WeldBLL().GetAll(); DDL_ParentWeld.DataValueField = "WeldId"; DDL_ParentWeld.DataTextField = "WeldId"; DDL_ParentWeld.DataSource = WeldList; DDL_ParentWeld.DataBind(); DDL_ParentWeld.Items.Add(DefaultListItem); //TList SpoolList = new SpoolBLL().GetAll(); //DDL_Spool.DataValueField = "SpoolId"; //DDL_Spool.DataTextField = "SpoolNo"; //DDL_Spool.DataSource = SpoolList; //DDL_Spool.DataBind(); //DDL_Spool.Items.Add(DefaultListItem); //TList SpoolRevisionList = new SpoolRevisionBLL().GetAll(); //DDL_SpoolRevision.DataValueField = "SpoolRevisionNumber"; //DDL_SpoolRevision.DataTextField = "SpoolRevisionNumber"; //DDL_SpoolRevision.DataSource = SpoolRevisionList; //DDL_SpoolRevision.DataBind(); //DDL_SpoolRevision.Items.Add(DefaultListItem); #endregion if (WeldId != null) { #region Update Form Setup #endregion } else { #region Insert Form Setup DDL_ParentWeld.SelectedValue = "none"; #endregion } } #endregion } #region Page Properties #region Session Properties /// /// Project Id is the variable being passed around to /// pre select anything in the projects section by this /// value /// public String ProjectId { get { return Request.Cookies["ProjectId"].Value.Trim().Substring(Request.Cookies["ProjectId"].Value.Trim().LastIndexOf("=") + 1); } } #endregion #region QueryString Properties /// /// Local Property Weld Id will be passed in by parent /// page upon request to manage spool /// public String WeldId { get { return Request.QueryString["WeldId"]; } } #endregion #region Global Properties /// /// Empty List item function to be called wherever necessary /// private ListItem DefaultListItem = new ListItem("<... none ...>", "none"); /// /// A call to our BLL to be accessible by all functions /// private DrawingBLL DrawingDS = new DrawingBLL(); /// /// A call to our BLL to be accessible by all functions /// private WeldBLL WeldDS = new WeldBLL(); #endregion #endregion #region Insert / Update methods //Insert / Update / Delete Buttons go here //on insert / update, we will default to use the spool id / rev. //if dropdowns for drawing id / rev are selected, then the weld will //be placed directly on that drawing rather than the spool. #endregion #region Form Managers /// /// Adds an error message to an error list /// public string ErrorMessages = ""; public void AddError(string message) { ErrorMessages = ErrorMessages + "
  • " + message + "
  • "; } /// /// retrieves the error list to display to the user on the requesting form /// /// public string GetErrors() { return "
      " + ErrorMessages + "
    "; } #endregion #region Form Functionality //Form Builder Goes Here #endregion }