Example #1
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            M_Survey info = new M_Survey();

            if (Sid > 0)
            {
                info = surveyBll.SelReturnModel(Sid);
            }
            DateTime startTime = DataConverter.CDate(txtStartTime.Text);
            DateTime endtime   = DataConverter.CDate(txtEndTime.Text);

            info.SurveyName  = this.TxtSurveyName.Text.Trim();
            info.SurType     = DataConverter.CLng(RblSurType.SelectedValue);
            info.Description = this.TxtDescription.Text;
            info.StartTime   = startTime;
            info.EndTime     = endtime;
            info.NeedLogin   = ChkNeedLogin.Checked;
            info.IsOpen      = ChkIsOpen.Checked;
            info.IsStatus    = ChkIsStatus.Checked;
            info.IsCheck     = ChkIsCheck.Checked;
            info.IsShow      = ChkIsShow.Checked ? 1 : 0;
            info.IPRepeat    = DataConverter.CLng(this.txtIPRepeat.Text.Trim());

            if (endtime <= startTime)
            {
                function.WriteErrMsg("终止时间不能早于开始日期!");
            }
            if (info.SurveyID > 0)
            {
                surveyBll.UpdateByID(info);
            }
            else
            {
                surveyBll.insert(info);
            }
            function.WriteSuccessMsg("操作成功", "SurveyManage.aspx");
        }