Exemplo n.º 1
0
 //重置
 protected void DeleteAll_Click(object sender, EventArgs e)
 {
     txtReportPeople.Reset();
     txtJobName.Reset();
     txtJobMission.Reset();
     txtReportUnit.Reset();
     txtReport.Reset();
     DropDownList_SecrecyLevel.SelectedValue = "0";
     txtReportTele.Reset();
     txtAcademicTitle.Reset();
     txtRemark.Reset();
     txtReportName.Reset();
     Remark.Reset();
     DatePikerReportTime.Reset();
     txtReportPlace.Reset();
     txtReportType.Reset();
     txtApplyFund.Reset();
     txtPeopleCount.Reset();
     txtMajorPeople.Reset();
     txtOrganizers.Reset();
     txtCoorganizer.Reset();
 }
Exemplo n.º 2
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtReportPeople.Text.Trim() == "")
                {
                    Alert.ShowInTop("姓名不能为空!");
                    txtReportPeople.Reset();
                    return;
                }
                if (txtReportUnit.Text.Trim() == "")
                {
                    Alert.ShowInTop("报告人单位不能为空!");
                    txtReportUnit.Reset();
                    return;
                }
                if (txtReportName.Text.Trim() == "")
                {
                    Alert.ShowInTop("学术报告名称不能为空!");
                    txtReportName.Reset();
                    return;
                }
                if (txtReportPlace.Text.Trim() == "")
                {
                    Alert.ShowInTop("报告地点不能为空!");
                    txtReportPlace.Reset();
                    return;
                }
                if (DatePikerReportTime.Text == "")
                {
                    Alert.ShowInTop("报告时间不能为空!");
                    DatePikerReportTime.Reset();
                    return;
                }

                if (txtPeopleCount.Text.Trim() == "")
                {
                    Alert.ShowInTop("参与人数不能为空!");
                    txtPeopleCount.Reset();
                    return;
                }

                newacademicreporting         = BLLNAR.FindByNAReportingID(Convert.ToInt32(Session["NewAcademicReporting"]));
                Newnareporting.ReportTime    = Convert.ToDateTime(DatePikerReportTime.Text);
                Newnareporting.PeopleCount   = Convert.ToInt32(txtPeopleCount.Text.Trim());
                Newnareporting.SecrecyLevel  = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue);
                Newnareporting.Remark        = Remark.Text;
                Newnareporting.ReportPeople  = txtReportPeople.Text;
                Newnareporting.JobName       = txtJobName.Text;
                Newnareporting.JobMission    = txtJobMission.Text;
                Newnareporting.ReportUnit    = txtReportUnit.Text;
                Newnareporting.Report        = txtReport.Text;
                Newnareporting.ReportTele    = txtReportTele.Text;
                Newnareporting.AcademicTitle = txtAcademicTitle.Text;
                Newnareporting.ReportName    = txtReportName.Text;
                Newnareporting.ReportPlace   = txtReportPlace.Text;
                Newnareporting.ApplyFund     = txtApplyFund.Text;
                Newnareporting.Organizers    = txtOrganizers.Text;
                Newnareporting.Coorganizer   = txtCoorganizer.Text;
                Newnareporting.ReportType    = txtReportType.Text;
                Newnareporting.MajorPeople   = txtMajorPeople.Text;
                Newnareporting.EntryPerson   = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                //用户等级为5级可直接通过
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    Newnareporting.IsPass = true;
                }
                else
                {
                    Newnareporting.IsPass = false;
                }

                int AttachID = pm.UpLoadFile(fileupload).Attachid;
                switch (AttachID)
                {
                case -1:
                    Alert.ShowInTop("文件类型不符,请重新选择!");
                    return;

                case 0:
                    Alert.ShowInTop("文件名已经存在!");
                    return;

                case -2:
                    Alert.ShowInTop("文件不能大于150M");
                    return;

                case -3:
                    Newnareporting.AttachmentID = null;
                    break;

                //Alert.ShowInTop("请上传附件");
                //return;
                default:
                    Newnareporting.AttachmentID = AttachID;
                    break;
                }

                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    //操作日志表对象
                    Common.Entities.OperationLog operationLog = InsertOperationLog();
                    operationLog.OperationDataID = Convert.ToInt32(Session["NewAcademicReportingID"]);
                    Newnareporting.EntryPerson   = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                    Newnareporting.IsPass        = false;
                    newacademicreporting.IsPass  = false;
                    BLLNAR.Insert(Newnareporting);
                    operationLog.Remark = Newnareporting.NewAcademicReportingID.ToString();
                    BLLOL.Insert(operationLog);
                    Alert.ShowInTop("您的数据已提交,请等待确认");
                }
                else
                {
                    Newnareporting.NewAcademicReportingID = Convert.ToInt32(Session["NewAcademicReportingID"]);
                    BLLNAR.Update(Newnareporting);
                    Alert.ShowInTop("保存成功");
                }
                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
            }
            catch (Exception ex)
            {
                //删除附件文件
                string path = BLLattachment.FindPath(Convert.ToInt32(newacademicreporting.AttachmentID));
                if (path != "")
                {
                    pm.DeleteFile(Convert.ToInt32(newacademicreporting.AttachmentID), path);
                    //删除附件表中的数据
                    BLLattachment.Delete(Convert.ToInt32(newacademicreporting.AttachmentID));//删除成功返回true
                }
                //BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
            //PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
        }