Esempio n. 1
0
    private void GetActivityDefault()
    {
        try
        {
            InitQueryBlock(ActivityID.ToString());
            //取得活動資訊
            ACMS.DAO.ActivatyDAO myActivatyDAO = new ACMS.DAO.ActivatyDAO();
            ACMS.VO.ActivatyVO   myActivatyVO  = myActivatyDAO.SelectActivatyByID(ActivityID);

            //報名截止日後要唯讀
            if (myActivatyVO.regist_deadline < DateTime.Today)
            {
                MyFormMode = FormViewMode.ReadOnly;
                //GridView_RegisterPeoplinfo.Enabled = false;
                PanelCustomFieldA1.Enabled = false;
            }
            if (MyFormMode == FormViewMode.Edit)
            {
                Wizard1.FindControl("FinishNavigationTemplateContainerID$btnHome").Visible             = true;
                ((Button)Wizard1.FindControl("FinishNavigationTemplateContainerID$FinishButton")).Text = "儲存並發送確認信";
            }
            //活動海報訊息
            Literal1.Text = myActivatyVO.activity_info;

            //活動相關訊息
            ObjectDataSource_ActivatyDetails.SelectParameters["id"].DefaultValue = ActivityID.ToString();
            ObjectDataSource_UpFiles.SelectParameters["dirName"].DefaultValue    = Server.MapPath(Path.Combine("~/UpFiles", ActivityID.ToString()));

            //報名者資訊
            ObjectDataSource_RegisterPersonInfo.SelectParameters["emp_id"].DefaultValue = clsAuth.ID;//預設登入者

            //所有報名者資訊
            ObjectDataSource_RegisterPeoplenfo.SelectParameters["activity_id"].DefaultValue = ActivityID.ToString();
            ObjectDataSource_RegisterPeoplenfo.SelectParameters["emp_id"].DefaultValue      = RegistBy;//由登入者所報名(含登入者本人)

            //注意事項
            Literal_notice.Text = myActivatyVO.notice.Replace("\r\n", "<br />");

            FormView_fixA.DataBind();
            ACMS.BO.CustomFieldBO myCustFieldBo = new ACMS.BO.CustomFieldBO();
            if (myCustFieldBo.SelectByActivity_id(ActivityID).Count > 0)
            {
                Session["ShowPanel"] = true;
            }
        }
        catch (Exception ex)
        {
            WriteErrorLog("GetDefault", ex.Message, "0");
        }
        //FormView_fixA.FindControl("tr_person_fix1").Visible = (myActivatyVO.is_showperson_fix1 == "Y");
        //FormView_fixA.FindControl("tr_person_fix2").Visible = (myActivatyVO.is_showperson_fix2 == "Y");

        //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2Start") as Label).Text = myActivatyVO.personextcount_min.ToString();
        //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2End") as Label).Text = myActivatyVO.personextcount_max.ToString();

        //RangeValidator myRangeValidator = (FormView_fixA.FindControl("tr_person_fix2").FindControl("chk_txtperson_fix2_3") as RangeValidator);
        //myRangeValidator.MinimumValue = myActivatyVO.personextcount_min.ToString();
        //myRangeValidator.MaximumValue = myActivatyVO.personextcount_max.ToString();
    }
    private void GetActivityDefault()
    {
        try
        {
            //取得活動資訊
            ACMS.DAO.ActivatyDAO myActivatyDAO = new ACMS.DAO.ActivatyDAO();
            ACMS.VO.ActivatyVO myActivatyVO = myActivatyDAO.SelectActivatyByID(ActivityID);

            //報名截止日後要唯讀
            if (myActivatyVO.regist_deadline < DateTime.Today)
            {
                MyFormMode = FormViewMode.ReadOnly;
                Panel_TeamFix.Enabled = false;
                PanelTeamMember.Enabled = false;
                PanelCustomFieldA1.Enabled = false;
            }
            if (MyFormMode == FormViewMode.Edit)
            {
                Wizard1.FindControl("FinishNavigationTemplateContainerID$btnHome").Visible = true;
                ((Button)Wizard1.FindControl("FinishNavigationTemplateContainerID$FinishButton")).Text = "儲存並發送確認信";
            }
            //活動海報訊息
            Literal1.Text = myActivatyVO.activity_info;

            //活動相關訊息
            ObjectDataSource_ActivatyDetails.SelectParameters["id"].DefaultValue = ActivityID.ToString();
            ObjectDataSource_UpFiles.SelectParameters["dirName"].DefaultValue = Server.MapPath(Path.Combine("~/UpFiles", ActivityID.ToString()));

            //注意事項
            Literal_notice.Text = myActivatyVO.notice.Replace("\r\n", "<br />");

            //團隊固定欄位
            tr_showteam_fix1.Visible = (myActivatyVO.is_showteam_fix1 == "Y");
            tr_showteam_fix2.Visible = (myActivatyVO.is_showteam_fix2 == "Y");

            if (myActivatyVO.is_showteam_fix1 != "Y" && myActivatyVO.is_showteam_fix2 != "Y")
            {
                Panel_TeamFix.Visible = false;
            }
            //if (tr_showteam_fix1.Visible || tr_showteam_fix2.Visible)
            //{
            //    Session["ShowPanel"] = true;
            //}

            lbltext_peopleStart.Text = myActivatyVO.teamextcount_min.ToString();
            lbltext_peopleEnd.Text = myActivatyVO.teamextcount_max.ToString();

            chk_text_people3.MinimumValue = myActivatyVO.teamextcount_min.ToString();
            chk_text_people3.MaximumValue = myActivatyVO.teamextcount_max.ToString();

            //個人欄位
            //Page_is_showperson_fix1 = myActivatyVO.is_showperson_fix1;
            //Page_is_showperson_fix2 = myActivatyVO.is_showperson_fix2;
            ACMS.BO.CustomFieldBO myCustFieldBo = new ACMS.BO.CustomFieldBO();
            if (myCustFieldBo.SelectByActivity_id(ActivityID).Count > 0)
            {
                Session["ShowPanel"] = true;

            }

            (OpenTeamPersonInfo1.FindControl("tr_idno") as System.Web.UI.HtmlControls.HtmlTableRow).Visible = (myActivatyVO.is_showidno == "Y");
            (OpenTeamPersonInfo1.FindControl("tr_remark") as System.Web.UI.HtmlControls.HtmlTableRow).Visible = (myActivatyVO.is_showremark == "Y");

            (OpenTeamPersonInfo1.FindControl("lblRemark") as Label).Text = myActivatyVO.remark_name;
            (OpenTeamPersonInfo1.FindControl("chk_txtremark") as RequiredFieldValidator).ErrorMessage = string.Format("{0}必填", myActivatyVO.remark_name);

            if (myActivatyVO.is_showidno == "N" && myActivatyVO.is_showremark == "N")
            {
                IsPersonInfoRequired = false;
                GridView_TemMember.Columns[3].Visible = false;
                GridView_TemMember.Columns[4].Visible = false;
            }
            else
            {
                IsPersonInfoRequired = true;
            }

            Page_team_member_min = myActivatyVO.team_member_min;
            Page_team_member_max = myActivatyVO.team_member_max;

            //FormView_fixA.DataBind();
            //FormView_fixA.FindControl("tr_person_fix1").Visible = (myActivatyVO.is_showperson_fix1 == "Y");
            //FormView_fixA.FindControl("tr_person_fix2").Visible = (myActivatyVO.is_showperson_fix2 == "Y");

            //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2Start") as Label).Text = myActivatyVO.personextcount_min.ToString();
            //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2End") as Label).Text = myActivatyVO.personextcount_max.ToString();

            //RangeValidator myRangeValidator = (FormView_fixA.FindControl("tr_person_fix2").FindControl("chk_txtperson_fix2_3") as RangeValidator);
            //myRangeValidator.MinimumValue = myActivatyVO.personextcount_min.ToString();
            //myRangeValidator.MaximumValue = myActivatyVO.personextcount_max.ToString();
        }
        catch (Exception ex)
        {
            WriteErrorLog("GetDefault", ex.Message, "0");

        }
    }
    private void GetActivityDefault()
    {
        try
        {
            InitQueryBlock(ActivityID.ToString());
            //取得活動資訊
            ACMS.DAO.ActivatyDAO myActivatyDAO = new ACMS.DAO.ActivatyDAO();
            ACMS.VO.ActivatyVO myActivatyVO = myActivatyDAO.SelectActivatyByID(ActivityID);

            //報名截止日後要唯讀
            if (myActivatyVO.regist_deadline < DateTime.Today)
            {
                MyFormMode = FormViewMode.ReadOnly;
                //GridView_RegisterPeoplinfo.Enabled = false;
                PanelCustomFieldA1.Enabled = false;
            }
            if (MyFormMode == FormViewMode.Edit)
            {
                Wizard1.FindControl("FinishNavigationTemplateContainerID$btnHome").Visible = true;
                ((Button)Wizard1.FindControl("FinishNavigationTemplateContainerID$FinishButton")).Text = "儲存並發送確認信";
            }
            //活動海報訊息
            Literal1.Text = myActivatyVO.activity_info;

            //活動相關訊息
            ObjectDataSource_ActivatyDetails.SelectParameters["id"].DefaultValue = ActivityID.ToString();
            ObjectDataSource_UpFiles.SelectParameters["dirName"].DefaultValue = Server.MapPath(Path.Combine("~/UpFiles", ActivityID.ToString()));

            //報名者資訊
            ObjectDataSource_RegisterPersonInfo.SelectParameters["emp_id"].DefaultValue = clsAuth.ID;//預設登入者

            //所有報名者資訊
            ObjectDataSource_RegisterPeoplenfo.SelectParameters["activity_id"].DefaultValue = ActivityID.ToString();
            ObjectDataSource_RegisterPeoplenfo.SelectParameters["emp_id"].DefaultValue = RegistBy;//由登入者所報名(含登入者本人)

            //注意事項
            Literal_notice.Text = myActivatyVO.notice.Replace("\r\n", "<br />");

            FormView_fixA.DataBind();
            ACMS.BO.CustomFieldBO myCustFieldBo = new ACMS.BO.CustomFieldBO();
            if (myCustFieldBo.SelectByActivity_id(ActivityID).Count > 0)
            {
                Session["ShowPanel"] = true;

            }
        }
        catch (Exception ex)
        {
            WriteErrorLog("GetDefault", ex.Message, "0");

        }
        //FormView_fixA.FindControl("tr_person_fix1").Visible = (myActivatyVO.is_showperson_fix1 == "Y");
        //FormView_fixA.FindControl("tr_person_fix2").Visible = (myActivatyVO.is_showperson_fix2 == "Y");

        //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2Start") as Label).Text = myActivatyVO.personextcount_min.ToString();
        //(FormView_fixA.FindControl("tr_person_fix2").FindControl("lblAf2End") as Label).Text = myActivatyVO.personextcount_max.ToString();

        //RangeValidator myRangeValidator = (FormView_fixA.FindControl("tr_person_fix2").FindControl("chk_txtperson_fix2_3") as RangeValidator);
        //myRangeValidator.MinimumValue = myActivatyVO.personextcount_min.ToString();
        //myRangeValidator.MaximumValue = myActivatyVO.personextcount_max.ToString();
    }