// ////////////////////////////////////////////////////////////////////////
        // INITIAL EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Initialize viewstate variables
                ViewState["StepFrom"] = "Out";
                Session.Remove("commentsMigrationTDS");

                // ... Initialize tables
                commentsMigrationTDS = new CommentsMigrationTDS();

                // ... Store tables
                Session["commentsMigrationTDS"] = commentsMigrationTDS;

                hdfCompanyId.Value = Convert.ToInt32(Session["companyID"]).ToString();

                // ...  for the client
                int companyId = Int32.Parse(hdfCompanyId.Value);
                CompaniesList companiesList = new CompaniesList();
                companiesList.LoadAndAddItem(-1, "(Select a client)", companyId);
                ddlParentClient.DataSource = companiesList.Table;
                ddlParentClient.DataValueField = "COMPANIES_ID";
                ddlParentClient.DataTextField = "Name";
                ddlParentClient.DataBind();

                ddlChildClient.DataSource = companiesList.Table;
                ddlChildClient.DataValueField = "COMPANIES_ID";
                ddlChildClient.DataTextField = "Name";
                ddlChildClient.DataBind();

                // ... for project
                ProjectList projectList = new ProjectList();
                projectList.LoadProjectsAndAddItem(-1, "(Select a project)", -1);
                ddlParentProject.DataSource = projectList.Table;
                ddlParentProject.DataValueField = "ProjectID";
                ddlParentProject.DataTextField = "Name";
                ddlParentProject.DataBind();

                ddlChildProject.DataSource = projectList.Table;
                ddlChildProject.DataValueField = "ProjectID";
                ddlChildProject.DataTextField = "Name";
                ddlChildProject.DataBind();

                // StepSection1In
                wzCommentsMigration.ActiveStepIndex = 0;
                StepBeginIn();
            }
            else
            {
                // Restore tables
                commentsMigrationTDS = (CommentsMigrationTDS)Session["commentsMigrationTDS"];
            }

            // control for postback
            hdfTag.Value = DateTime.Now.ToLongTimeString();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// InitData
 /// </summary>
 protected override void InitData()
 {
     _data = new CommentsMigrationTDS();
 }