Ejemplo n.º 1
0
        //更新赋值

        /* public void UpDateValue()
         * {
         *   achieve.PactNum = txtPactNum.Text;
         *   achieve.PactName = txtPactName.Text;
         *   achieve.PactType = txtPactType.Text;
         *   achieve.StartTime = DatePicker_StartTime.SelectedDate;
         *   achieve.EndTime = DatePicker_EndTime.SelectedDate;
         *   achieve.ProjectID = BLLProject.SelectProjectID(DropDownList_Project.SelectedText);
         *   achieve.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1);
         *   achieve.ChargePerson = txtChargePerson.Text;
         *   achieve.PactMoney = txtPactMoney.Text;
         *   achieve.RealMoney = txtRealMoney.Text;
         *   achieve.PactCompletion = txtPactCompletion.Text;
         *   achieve.IsExistingFile = txtIsExistingFile.Text;
         *   achieve.FileNum = txtFileNum.Text;
         *   //achieve.EntryPerson = BLLPact.FindByPactID(Convert.ToInt32(Session["PactID"])).EntryPerson;
         *
         * }*/
        //原版本

        /*public void BindData()
         * {
         *  //int ContractID = Convert.ToInt32(Request.QueryString["id"].ToString());
         *  int LibraryRecordID = Convert.ToInt32(Session["LibraryRecordID"]);
         *  if (LibraryRecordID != 0)
         *  {
         *      libraryRecord = BLLLibraryRecord.FindByLibreryRecordID(LibraryRecordID);
         *      txtPactNum.Text = BLLPact.FindByPactID(Convert.ToInt32(libraryRecord.ContractID)).PactNum;
         *      txtBorrowPeople.Text = BLLUser.FindUserName(libraryRecord.UserInfoID);
         *      DatePicker_BorrowTime.SelectedDate = libraryRecord.BorrowTime;
         *      DatePicker_ReturnTime.SelectedDate = libraryRecord.ReturnTime;
         *  }
         * }*/
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                achieve.PactNum        = txtPactNum.Text;
                achieve.PactName       = txtPactName.Text;
                achieve.PactType       = txtPactType.Text;
                achieve.StartTime      = DatePicker_StartTime.SelectedDate;
                achieve.EndTime        = DatePicker_EndTime.SelectedDate;
                achieve.ProjectID      = BLLProject.SelectProjectID(DropDownList_Project.SelectedText);
                achieve.SecrecyLevel   = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1);
                achieve.ChargePerson   = txtChargePerson.Text;
                achieve.PactMoney      = txtPactMoney.Text;
                achieve.RealMoney      = txtRealMoney.Text;
                achieve.PactCompletion = txtPactCompletion.Text;
                achieve.IsExistingFile = txtIsExistingFile.Text;
                achieve.FileNum        = txtFileNum.Text;

                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                achieve.EntryPerson  = username;
                achieve.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedIndex + 1);
                int    AttachmentID = Convert.ToInt32(BLLPact.FindByPactID(Convert.ToInt32(Session["PactID"])).AttachmentID);
                string path         = attachment.FindPath(AttachmentID);
                achieve.AttachmentID = AttachmentID;
                achieve.PactID       = Convert.ToInt32(Session["PactID"]);
                achieve.IsPass       = true;
                BLLPact.update(achieve);//插入文件表
                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功"));
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 2
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (CategoryContent.Text.Trim() == "")
         {
             Alert.ShowInTop("分类内容不能为空!");
             CategoryContent.Text = "";
             return;
         }
         if (bllBasicCode.IsTrue(DropDownListCategoryName.SelectedIndex + 1, DropDownListCategoryName.SelectedItem.Text, CategoryContent.Text))
         {
             basiccode.CategoryID      = DropDownListCategoryName.SelectedIndex + 1;
             basiccode.CategoryName    = DropDownListCategoryName.SelectedItem.Text;
             basiccode.CategoryContent = CategoryContent.Text.Trim();
             bllBasicCode.Insert(basiccode);
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("添加成功!"));
         }
         else
         {
             Alert.ShowInTop("已存在!");
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);;
     }
 }
Ejemplo n.º 3
0
 //绑定数据
 public void BindData()
 {
     try
     {
         if (!IsPostBack)
         {
             if (Convert.ToInt32(Session["ProjectFileID"]) == 0)
             {
                 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("必须选择一个文件!"));
                 return;
             }
             projectFile = bllProjectFile.FindByProjectFileId(Convert.ToInt32(Session["ProjectFileID"]), Convert.ToInt32(Session["SecrecyLevel"]));
             if (projectFile == null)
             {
                 PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("没有检测到文件!"));
                 return;
             }
             txtFileCode.Text               = projectFile.FileCode.ToString();
             txtFileName.Text               = projectFile.FileName;
             listFileType.SelectedValue     = projectFile.FileType;
             listSecrecyLevel.SelectedIndex = Convert.ToInt32(projectFile.SecrecyLevel - 1);
         }
     }
     catch (Exception ex)
     {
         publicMethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 4
0
 protected void btn_Save_Click(object sender, EventArgs e)
 {
     blfundset.Update("横向", "管理费", tb_HorGProportion2.Text.Trim());
     blfundset.Update("纵向", "管理费", tb_VerGProportion2.Text.Trim());
     blfundset.Update("校内", "管理费", tb_school.Text.Trim());
     PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
 }
Ejemplo n.º 5
0
 //保存
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (BLLUser.FindByUserName(txtBorrowPeople.Text) == null)
         {
             Alert.ShowInTop("借阅人不存在,请重新输入!");
             return;
         }
         if (DatePicker_BorrowTime.SelectedDate > DatePicker_ReturnTime.SelectedDate)
         {
             Alert.ShowInTop("归还日期应该大于借阅日期!");
             return;
         }
         NewLibraryRecord = FindLibraryRecord();
         if (NewLibraryRecord != null)
         {
             BLLLibraryRecord.Insert(NewLibraryRecord);
             Alert.ShowInTop("保存成功!");
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
         }
     }
     catch (Exception ex)
     {
         BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
         pm.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 6
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (tUser.Text.Trim() == "")
         {
             Alert.Show("人员姓名不能为空!");
             return;
         }
         if (tStudyPlace.Text.Trim() == "")
         {
             Alert.Show("进修地点不能为空!");
             return;
         }
         if (tStudySchool.Text.Trim() == "")
         {
             Alert.Show("进修学校为空!");
             return;
         }
         if (tContent.Text.Trim() == "")
         {
             Alert.Show("进修内容不能为空!");
             return;
         }
         if (tDEndTime.SelectedDate < tDBegainTime.SelectedDate)
         {
             Alert.ShowInTop("结束时间不能小于开始时间!");
             return;
         }
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             dfurtherstudy.DFurtherStudyID = Convert.ToInt32(Session["ID"]);
             dfurtherstudy.IsPass          = true;
             UpdateValue();
             df.Update(dfurtherstudy);
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功"));
         }
         else
         {
             UpdateValue();
             dfurtherstudy.IsPass = false;
             df.Insert(dfurtherstudy);
             log.LoginName        = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
             log.OperationTime    = DateTime.Now;
             log.LoginIP          = " ";
             log.OperationContent = "DFurtherStudy";
             log.OperationType    = "更新";
             log.OperationDataID  = Convert.ToInt32(Session["ID"]);
             log.Remark           = dfurtherstudy.DFurtherStudyID.ToString();
             op.Insert(log);
             df.ChangePass(Convert.ToInt32(Session["ID"]), false);
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 7
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (tAchievement.Text.Trim() == "")
         {
             Alert.Show("成果名称不能为空!");
             return;
         }
         if (tAwardName.Text.Trim() == "")
         {
             Alert.Show("报奖名称不能为空!");
             return;
         }
         if (tAwardGrade.Text.Trim() == " ")
         {
             Alert.Show("报奖等级不能为空!");
             return;
         }
         if (tAwardType.Text.Trim() == "")
         {
             Alert.Show("报奖类型不能为空!");
             return;
         }
         if (AwardPeople.Text.Trim() == "")
         {
             Alert.Show("报奖人不能为空!");
             return;
         }
         string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
         ac.EntryPerson = username;
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             InsertValue();
             ac.IsPass = true;
             award.Insert(ac);
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
         }
         else
         {
             InsertValue();
             ac.IsPass = false;
             award.Insert(ac);
             log.LoginName        = username;
             log.OperationTime    = DateTime.Now;
             log.LoginIP          = " ";
             log.OperationContent = "AchieveAward";
             log.OperationType    = "添加";
             log.OperationDataID  = ac.AchieveAwardID;
             op.Insert(log);
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     checkSession();
     if (!IsPostBack)
     {
         //Button_Close.OnClientClick = ActiveWindow.GetHideReference();
         Button_Close.OnClientClick = ActiveWindow.GetConfirmHideRefreshReference();
     }
 }
Ejemplo n.º 9
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                //if (MissionName.Text.Trim() == "")
                //{
                //    Alert.ShowInTop("节点名称不能为空!");
                //    MissionName.Text = "";
                //    return;
                //}
                ProjectImportantNode Important = new ProjectImportantNode();
                Important.MissionName = MissionName.Text.Trim();
                Important.ProjectID = bllProject.SelectProjectID(DropDownListProjectID.SelectedText.ToString());
                //Important.Time = DatePickerTime.SelectedDate;
                Important.StartTime = DatePickerStartTime.SelectedDate;
                Important.EndTime = DatePickerEndTime.SelectedDate;
                Important.CompleteSpecificPerson = CompleteSpecificPerson.Text.Trim();
                //lby ↓
                Important.ResearchCharge = Agency.SelectedText;

                Important.PersonCharge = txtPersonCharge.Text.Trim();
                Important.ActualComleption = txtActualComleption.Text.Trim();
                Important.ProjectCompletion = txtProjectCompletion.Text.Trim();
                Important.Remark = Remark.Text.Trim();
                Important.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1;
                Important.EntryPerson = bllImportant.FindProjectImportant(Convert.ToInt32(Session["ProjectImportantID"]), true).EntryPerson;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    Important.ProjectImportantNodeID = Convert.ToInt32(Session["ProjectImportantID"]);
                    Important.IsPass = true;
                    bllImportant.Update(Important);    //插入项目重大节点表  
                    //bllImportant.ChangePass(Convert.ToInt32(Session["ProjectImportantID"]), false);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("项目重大节点修改完成!"));
                }
                else
                {
                    bllImportant.ChangePass(Convert.ToInt32(Session["ProjectImportantID"]), false);
                    Important.IsPass = false;
                    bllImportant.insert(Important);//插入项目重大节点表
                    OperationLog operate = new OperationLog();
                    operate.LoginName = Important.EntryPerson;
                    operate.OperationType = "更新";
                    operate.OperationContent = "ProjectImportantNode";
                    operate.OperationDataID = Convert.ToInt32(Session["ProjectImportantID"]);
                    operate.LoginIP = "";
                    operate.OperationTime = DateTime.Now;
                    operate.Remark = Important.ProjectImportantNodeID.ToString();
                    bllOperate.Insert(operate);//插入操作日志表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的操作已提交审核,请等待!"));
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 10
0
        //添加按钮
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (MissionName.Text.Trim() == "")
                {
                    Alert.ShowInTop("节点名称不能为空!");
                    MissionName.Text = "";
                    return;
                }
                //一个项目里节点名称是可以重复的,不需要判断
                Important.MissionName = MissionName.Text.Trim();
                Important.ProjectID   = bllProject.SelectProjectID(DropDownListProjectID.SelectedText);
                // Important.Time = DatePickerTime.SelectedDate;
                Important.StartTime = DatePickerStartTime.SelectedDate;
                Important.EndTime   = DatePickerEndTime.SelectedDate;
                Important.CompleteSpecificPerson = CompleteSpecificPerson.Text.Trim();
                //lby ↓
                Important.ResearchCharge = Agency.SelectedText;

                Important.PersonCharge      = txtPersonCharge.Text.Trim();
                Important.ActualComleption  = txtActualComleption.Text.Trim();
                Important.ProjectCompletion = txtProjectCompletion.Text.Trim();
                Important.Remark            = Remark.Text.Trim();
                Important.SecrecyLevel      = DropDownListSecrecyLevel.SelectedIndex + 1;
                Important.EntryPerson       = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    Important.IsPass = false;
                    bllImportant.insert(Important);
                    OperationLog operate = new OperationLog();
                    operate.LoginName        = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                    operate.OperationType    = "添加";
                    operate.OperationContent = "ProjectImportantNode";
                    operate.OperationDataID  = bllImportant.FindImportantID(Important.MissionName.ToString(), Convert.ToDateTime(Important.StartTime.ToString()), Session["LoginName"].ToString());
                    operate.LoginIP          = "";
                    operate.OperationTime    = DateTime.Now;
                    bllOperate.Insert(operate);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的操作已提交审核,请等待!"));
                }
                else
                {
                    Important.IsPass = true;
                    bllImportant.insert(Important);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("项目重大节点添加完成!"));
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Convert.ToInt32(Session["ProjectID"]) == 0)
         {
             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("必须选择一个项目!"));
             return;
         }
         InitDropDownList();
         //lby ↓
         InitDropListSecrecyLevel();
     }
 }
Ejemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     checkSession();
     if (!IsPostBack)
     {
         Button_Close.OnClientClick        = ActiveWindow.GetConfirmHideRefreshReference();
         Button_Close_Shadow.OnClientClick = ActiveWindow.GetConfirmHideRefreshReference();
         Relation relation = (Relation)Enum.Parse(typeof(Relation), Request.QueryString["relation"]);
         if (relation != Relation.leader)
         {
             Grid7.Visible = false;
         }
         bindEvaluateTableToGrid();
     }
 }
Ejemplo n.º 13
0
        //保存通知公告信息
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (txtHeadLine.Text.Trim() == "")
            {
                Alert.ShowInTop("标题不能为空!");
                txtHeadLine.Reset();
                return;
            }

            NewAnnouncement.HeadLine             = txtHeadLine.Text;
            NewAnnouncement.AnnouncementSortName = DropDownList_Sort.SelectedItem.Text;
            NewAnnouncement.Time         = DatePicker_Time.SelectedDate;
            NewAnnouncement.SourceAgency = txtSourceAgency.Text;
            //NewAnnouncement.SecrecyLevel = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedText);
            NewAnnouncement.SecrecyLevel = 1;
            NewAnnouncement.EntryPerson  = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
            NewAnnouncement.IsPass       = true;
            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:
                Alert.ShowInTop("请上传附件");
                return;

            default:
                NewAnnouncement.AttachmentID = AttachID;
                break;
            }
            BLLAnnouncement.Insert(NewAnnouncement);
            Alert.ShowInTop("通知公告信息添加成功!");
            PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
        }
Ejemplo n.º 14
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (CategoryContent.Text.Trim() == "")
         {
             Alert.ShowInTop("分类内容不能为空!");
             CategoryContent.Text = "";
             return;
         }
         basiccode.BasicCodeID     = Convert.ToInt32(Session["BasicCodeID"]);
         basiccode.CategoryName    = CategoryName.Text.Trim();
         basiccode.CategoryContent = CategoryContent.Text.Trim();
         bllBasicCode.Update(basiccode);
         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("修改成功!"));
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 15
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtLecturesName.Text.Trim() == "")
                {
                    Alert.ShowInTop("姓名不能为空!");
                    txtLecturesName.Reset();
                    return;
                }
                if (txtWorkPlace.Text.Trim() == "")
                {
                    Alert.ShowInTop("工作单位不能为空!");
                    txtWorkPlace.Reset();
                    return;
                }
                //原单位讲学对象
                unitLectures = BLLUL.FindByUnitLecturesID(Convert.ToInt32(Session["UnitLecturesID"]));
                //单位讲学表对象
                NewUnitLectures.LecturesName   = txtLecturesName.Text;
                NewUnitLectures.AgencyID       = BLLAgency.SelectAgencyID(DropDownList_Agency.SelectedText);
                NewUnitLectures.UReportName    = txtUReportName.Text;
                NewUnitLectures.LecturesTime   = Convert.ToDateTime(DatePikerLecturesTime.Text);
                NewUnitLectures.WorkUnit       = txtWorkPlace.Text;
                NewUnitLectures.listenerNumber = Convert.ToInt32(txtlistenerNumber.Text);
                NewUnitLectures.SecrecyLevel   = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue);
                NewUnitLectures.LecturesPlace  = txtLecturesPlace.Text;
                NewUnitLectures.WorkTitle      = txtjobtitle.Text;
                NewUnitLectures.Identity       = txtIDCard.Text;
                NewUnitLectures.Telephone      = txtTel.Text;
                NewUnitLectures.Remark         = Remark.Text;
                NewUnitLectures.EntryPerson    = unitLectures.EntryPerson;
                //用户等级为5级可直接通过
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    NewUnitLectures.IsPass = true;
                }
                else
                {
                    NewUnitLectures.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:
                    NewUnitLectures.AttachmentID = unitLectures.AttachmentID;
                    break;

                default:
                    NewUnitLectures.AttachmentID = AttachID;
                    break;
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    //操作日志表对象
                    Common.Entities.OperationLog operationLog = InsertOperationLog();
                    operationLog.OperationDataID = Convert.ToInt32(Session["UnitLecturesID"]);
                    NewUnitLectures.EntryPerson  = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                    NewUnitLectures.IsPass       = false;
                    unitLectures.IsPass          = false;
                    BLLUL.Insert(NewUnitLectures); //向单位讲学表插入信息
                    operationLog.Remark = NewUnitLectures.UnitLecturesID.ToString();
                    BLLOL.Insert(operationLog);    //向操作日志表插入信息
                    Alert.ShowInTop("操数据已经提交,等待管理员确认!");
                }
                else
                {
                    NewUnitLectures.UnitLecturesID = Convert.ToInt32(Session["UnitLecturesID"]);
                    BLLUL.Update(NewUnitLectures);
                    Alert.ShowInTop("保存成功!");
                }
                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
            }
            catch (Exception ex)
            {
                //删除附件文件
                string path = BLLattachment.FindPath(Convert.ToInt32(unitLectures.AttachmentID));
                if (path != "")
                {
                    pm.DeleteFile(Convert.ToInt32(unitLectures.AttachmentID), path);
                    //删除附件表中的数据
                    BLLattachment.Delete(Convert.ToInt32(unitLectures.AttachmentID));//删除成功返回true
                }
                //BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 16
0
        //保存
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tb_MoneyNum.Text.Trim() == "")
                {
                    Alert.ShowInTop("每项用途所用金额不能为空!");
                    tb_MoneyNum.Text = "";
                    return;
                }
                Common.Entities.Project project = pro.IsNullProject(tb_SourceWork.Text.Trim());
                if (project == null)
                {
                    tb_SourceWork.Text = "";
                    Alert.ShowInTop("无此项目,请检查输入!");
                    return;
                }
                else if (project.IsPass == false)
                {
                    tb_SourceWork.Text = "";
                    Alert.ShowInTop("此项目正在审核中,请联系管理员!");
                    return;
                }
                double num = 0.0;
                if (!double.TryParse(tb_MoneyNum.Text.Trim(), out num))
                {
                    tb_MoneyNum.Reset();
                    Alert.ShowInTop("请输入数字!");
                    return;
                }

                if (dp_Time.SelectedDate == null)
                {
                    Alert.ShowInTop("请选择日期!");
                    return;
                }
                Common.Entities.FundInformation fun = new Common.Entities.FundInformation();
                Common.Entities.OperationLog    op  = new Common.Entities.OperationLog();

                fun.BudgetDirector = tb_UserInfo.Text.Trim();
                BLHelper.BLLUser user     = new BLHelper.BLLUser();
                string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                fun.EntryPerson            = username;
                fun.EveItemUseMoney        = tb_MoneyNum.Text.Trim();
                fun.FundingPurposeSortName = ddl_FundingPurposeSortID.Text;
                fun.OperateType            = "支出";
                fun.ProjectID    = project.ProjectID;
                fun.SecrecyLevel = Convert.ToInt32(DropDownListLevel.SelectedValue) + 1;
                fun.Time         = dp_Time.SelectedDate;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    fun.IsPass = true;
                    fund.Insert(fun);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    fun.IsPass = false;
                    fund.Insert(fun);
                    op.LoginIP          = " ";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "FundInformation";
                    op.OperationDataID  = fun.FundInformationID;
                    op.OperationTime    = DateTime.Now;
                    op.OperationType    = "添加";
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!"));
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 17
0
        //保存资料信息
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (Session["LoginName"].ToString() == "")
                {
                    Response.Redirect("login.aspx");
                    Alert.Show("登录超时!");
                }
                if (txtContractHeadLine.Text.Trim() == "")
                {
                    Alert.ShowInTop("资料题目不能为空!");
                    txtContractHeadLine.Reset();
                    return;
                }
                if (txtContractAuthors.Text.Trim() == "")
                {
                    Alert.ShowInTop("资料保存人不能为空!");
                    txtContractAuthors.Reset();
                    return;
                }
                if (txtContractOriginal.Text.Trim() == "")
                {
                    Alert.ShowInTop("原始文件保存人不能为空 ! ");
                    txtContractOriginal.Reset();
                    return;
                }
                NewContract.ContractAuthors  = txtContractAuthors.Text;
                NewContract.ContractHeadLine = txtContractHeadLine.Text;
                NewContract.ContractOriginal = txtContractOriginal.Text;
                NewContract.EntryPerson      = BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                NewContract.SecrecyLevel     = Convert.ToInt32(DropDownList_SecrecyLevel.SelectedValue);
                //上传附件
                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:
                    NewContract.AttachmentID = null;
                    break;

                //Alert.ShowInTop("请上传附件");
                //return;
                default:
                    NewContract.AttachmentID = AttachID;
                    break;
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    NewContract.IsPass = true;
                    //向资料表中插入数据
                    BLLcontract.Insert(NewContract);
                    Alert.ShowInTop("保存成功");
                }
                else
                {
                    NewContract.IsPass = false;
                    //向资料表中插入数据
                    BLLcontract.Insert(NewContract);
                    //向操作日志表中插入信息
                    operationLog.LoginIP          = " ";
                    operationLog.LoginName        = Session["LoginName"].ToString();
                    operationLog.OperationType    = "添加";
                    operationLog.OperationContent = "Contract";
                    operationLog.OperationTime    = DateTime.Now;
                    operationLog.OperationDataID  = NewContract.ContractID;
                    //向操作日志表中插入数据
                    BLLOL.Insert(operationLog);
                    Alert.ShowInTop("您的数据已提交,请等待确认");
                }

                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference());
            }
            catch (Exception ex)
            {
                int ContractID = NewContract.ContractID;
                //删除资料附件
                int    AttactID = BLLcontract.FindAttachmentID(ContractID);
                string strPath;
                if (AttactID != 0)
                {
                    strPath = BLLattachment.FindPath(AttactID);
                    if (strPath != "")
                    {
                        //删除附件文件
                        pm.DeleteFile(AttactID, strPath);
                        //在附件表中删除附件数据
                        BLLattachment.Delete(AttactID);
                    }
                }
                //BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 18
0
        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //lby↓
                int    AttachmentID = BLLPlatform.FindAttachmentID(Convert.ToInt32(Session["PlatformID"]));
                string path         = at.FindPath(AttachmentID);

                Common.Entities.Platform platform = new Common.Entities.Platform();
                string PlatformName = BLLPlatform.FindByPlatformID(Convert.ToInt32(Session["PlatformID"])).PlatformName;//原平台名称
                if (txtPlatformName.Text.Trim() == "")
                {
                    Alert.ShowInTop("平台名称不能为空!");
                    txtPlatformName.Reset();
                    return;
                }
                //新更新的数据是否与原数据的平台名称相同
                if (txtPlatformName.Text.Trim() != PlatformName)//不同
                {
                    if (BLLPlatform.FindByPlatformName(txtPlatformName.Text.Trim()) == null)
                    {
                        platform.PlatformName = txtPlatformName.Text.Trim();
                    }
                    else
                    {
                        if (BLLPlatform.FindByPlatformName(txtPlatformName.Text.Trim()).IsPass == false)
                        {
                            Alert.ShowInTop("该平台名称正在审核中,请等待!");
                            txtPlatformName.Text = "";
                            return;
                        }
                        if (BLLPlatform.FindByPlatformName(txtPlatformName.Text.Trim()).IsPass == true)
                        {
                            Alert.ShowInTop("平台名称已存在!");
                            txtPlatformName.Text = "";
                            return;
                        }
                    }
                }
                else//相同
                {
                    if (txtPlatformName.Text.Trim() == PlatformName)//新更新的数据与原数据的平台名称相同
                    {
                        platform.PlatformName = txtPlatformName.Text.Trim();
                    }
                    else
                    {
                        if (BLLPlatform.FindByPlatformName(txtPlatformName.Text.Trim()).IsPass == false)
                        {
                            Alert.ShowInTop("该平台名称正在审核中,请等待!");
                            txtPlatformName.Text = "";
                            return;
                        }
                        if (BLLPlatform.FindByPlatformName(txtPlatformName.Text.Trim()).IsPass == true)
                        {
                            Alert.ShowInTop("平台名称已存在!");
                            txtPlatformName.Text = "";
                            return;
                        }
                    }
                }

                // platform.PlatformName = txtPlatformName.Text.Trim();
                platform.PlatformRank = DropDownListPlatformRank.SelectedText;
                platform.AgreeUnit    = DropDownListAgreeUnit.SelectedText;
                platform.AgreeTime    = DatePicker_AgreeTime.SelectedDate;
                platform.PlatformType = DropDownListPlatformType.SelectedText;
                platform.SecrecyLevel = DropDownList_SecrecyLevel.SelectedIndex + 1;
                platform.EntryPerson  = BLLPlatform.FindByPlatformID(Convert.ToInt32(Session["PlatformID"])).EntryPerson;
                //lby↓
                platform.PlatformManagement = txtPlatformManagement.Text.Trim();
                platform.AgreeNumber        = txtAgreeNumber.Text.Trim();
                platform.AgreeExpenditure   = txtAgreeExpenditure.Text.Trim();
                platform.PlatformPrincipal  = txtPlatformPrincipal.Text.Trim();
                platform.PlatformMember     = txtPlatformMember.Text.Trim();

                //向操作日志表中
                if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    platform.IsPass               = false;
                    operationLog.LoginIP          = " ";
                    operationLog.LoginName        = platform.EntryPerson;
                    operationLog.OperationType    = "更新";
                    operationLog.OperationContent = "Platform";
                    operationLog.OperationTime    = DateTime.Now;
                    //operationLog.OperationDataID = Convert.ToInt32(Session["PlatformID"]);
                    //operationLog.Remark = platform.PlatformID.ToString();
                    //PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("平台信息已提交审核!"));

                    //lby↓
                    int attachid = pm.UpLoadFile(fileupload).Attachid;
                    if (attachid != -3)//有值
                    {
                        switch (attachid)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        platform.AttachmentID = attachid;//附件为新插入的附件ID
                    }
                    else//上传控件没有值
                    {
                        if (AttachmentID != 0)//原来有附件
                        {
                            platform.AttachmentID = AttachmentID;
                        }
                    }
                    BLLPlatform.insert(platform);//插入
                    operationLog.OperationDataID = Convert.ToInt32(Session["PlatformID"]);
                    operationLog.Remark          = platform.PlatformID.ToString();
                    BLLOp.Insert(operationLog);//将成果更新插入操作表
                    BLLPlatform.UpdateIsPass(Convert.ToInt32(Session["PlatformID"]), false);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("平台信息已提交,正在等待审核!"));
                }
                else
                {
                    platform.IsPass     = true;
                    platform.PlatformID = Convert.ToInt32(Session["PlatformID"]);
                    //lby↓
                    int attachid = pm.UpLoadFile(fileupload).Attachid;
                    if (attachid != -3)//上传控件是否有值
                    {
                        switch (attachid)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        platform.AttachmentID = attachid;//附件为新插入的附件ID
                        pm.DeleteFile(AttachmentID, path);
                    }
                    else //上传空间没有值
                    {
                        if (AttachmentID != 0)
                        {
                            platform.AttachmentID = AttachmentID;
                        }
                    }
                    BLLPlatform.Update(platform);//5级直接更新平台表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("平台信息已更新完成!"));
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 19
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (T_UserInfoID.Text.Trim() != "")
         {
             if (bllUser.IsUser(T_UserInfoID.Text.Trim()) != null)
             {
                 if (bllUser.IsUser(T_UserInfoID.Text.Trim()).IsPass == true)
                 {
                     if (T_Sno.Text.Trim() == "")
                     {
                         Alert.ShowInTop("学号不能为空!");
                         T_Sno.Text = "";
                         return;
                     }
                     if (T_SName.Text.Trim() == "")
                     {
                         Alert.ShowInTop("姓名不能为空!");
                         T_SName.Text = "";
                         return;
                     }
                     if (T_Specialty.Text.Trim() == "")
                     {
                         Alert.ShowInTop("专业不能为空!");
                         T_Specialty.Text = "";
                         return;
                     }
                     if (T_SResearch.Text.Trim() == "")
                     {
                         Alert.ShowInTop("研究方向不能为空!");
                         T_SResearch.Text = "";
                         return;
                     }
                     if (bllStudent.IsSnoAndTeacher(T_Sno.Text.Trim(), Convert.ToInt32(bllUser.FindID(T_UserInfoID.Text.Trim().ToString()))) == null)
                     {
                         Student newstudent = new Student();
                         newstudent.Sno   = T_Sno.Text.Trim();
                         newstudent.Sname = T_SName.Text.Trim();
                         if (rbtnBoy.Checked == true)
                         {
                             newstudent.Sex = true;
                         }
                         else
                         {
                             newstudent.Sex = false;
                         }
                         newstudent.DocumentType   = DropDownListDocumentType.SelectedItem.Text;
                         newstudent.DocumentNumber = T_DocumentNumber.Text.Trim();
                         newstudent.Contact        = T_Contact.Text.Trim();
                         if (IsGraduation.Checked == true)
                         {
                             newstudent.IsGraduation = true;
                         }
                         else
                         {
                             newstudent.IsGraduation = false;
                         }
                         newstudent.Specialty            = T_Specialty.Text.Trim();
                         newstudent.SResearch            = T_SResearch.Text.Trim();
                         newstudent.SGraduationDirection = T_SGraduationDirection.Text.Trim();
                         newstudent.Type       = DropDownListType.SelectedItem.Text;
                         newstudent.UserInfoID = bllUser.FindID(T_UserInfoID.Text);
                         newstudent.EnterTime  = DatePickerEnterTime.SelectedDate;
                         newstudent.AgencyID   = BLLAgency.SelectAgencyID(DropDownList_Agency.SelectedText);
                         if (DatePickerGraduationTime.SelectedDate.HasValue)
                         {
                             if (DatePickerGraduationTime.SelectedDate < DatePickerEnterTime.SelectedDate)
                             {
                                 Alert.ShowInTop("毕业时间不能小于入学时间!");
                                 return;
                             }
                             else
                             {
                                 newstudent.GraduationTime = DatePickerGraduationTime.SelectedDate;
                             }
                         }
                         newstudent.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1;
                         newstudent.EntryPerson  = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                         if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                         {
                             newstudent.IsPass = false;
                             bllStudent.InsertForPeople(newstudent);//插入学生情况表
                             OperationLog operate = new OperationLog();
                             operate.LoginName        = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                             operate.LoginIP          = "";
                             operate.OperationType    = "添加";
                             operate.OperationContent = "Student";
                             operate.OperationDataID  = bllStudent.SelectByStudentID(newstudent.Sno);
                             operate.OperationTime    = System.DateTime.Now;
                             operate.Remark           = "";
                             bllOperate.Insert(operate);//插入操作表
                             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("学生情况信息已提交审核!"));
                         }
                         else
                         {
                             newstudent.IsPass = true;
                             bllStudent.InsertForPeople(newstudent);//插入学生情况表
                             PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("学生情况信息已添加完成!"));
                         }
                     }
                     else
                     {
                         Alert.ShowInTop("已存在学号为" + T_Sno.Text + ", 授课老师为" + T_UserInfoID.Text + "的信息");
                         T_Sno.Text = "";
                     }
                 }
                 else
                 {
                     Alert.ShowInTop("授课老师尚未通过审核!");
                 }
             }
             else
             {
                 Alert.ShowInTop("授课老师不存在!");
                 T_UserInfoID.Text = "";
             }
         }
         else
         {
             Alert.ShowInTop("授课老师不能为空!");
             T_UserInfoID.Text = "";
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 20
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tPatentName.Text.Trim() == "")
                {
                    Alert.Show("专利名称不能为空!");
                    return;
                }
                if (tPatentNumber.Text.Trim() == "")
                {
                    Alert.Show("专利号不能为空!");
                    return;
                }
                if (tGivenUnit.Text.Trim() == "")
                {
                    Alert.Show("授予机构不能为空!");
                    return;
                }
                if (tState.Text.Trim() == "")
                {
                    Alert.Show("状态不能为空!");
                    return;
                }
                if (PatentPeople.Text.Trim() == "")
                {
                    Alert.Show("全部发明人不能为空!");
                    return;
                }
                if (FirstPeople.Text.Trim() == "")
                {
                    Alert.Show("第一发明人不能为空!");
                    return;
                }
                if (tAccreditTime.SelectedDate < tApplicationTime.SelectedDate)
                {
                    Alert.ShowInTop("授权时间不能小于申请时间!");
                    return;
                }
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                pa.EntryPerson = username;
                //pa.Member = PatentMember.Text.Trim();
                List <string> list = new List <string>();
                string        unit = "";
                list.Add(tPatentDepartment1.Text.ToString());
                list.Add(tPatentDepartment2.Text.ToString());
                list.Add(tPatentDepartment3.Text.ToString());
                List <string> newlist = new List <string>();
                for (int i = 0; i < 3; i++)
                {
                    if (!string.IsNullOrEmpty(list[i].ToString()))
                    {
                        newlist.Add(list[i].ToString());
                    }
                }

                if (newlist.Count != 0)
                {
                    for (int j = 0; j < newlist.Count; j++)
                    {
                        unit += newlist[j].ToString();
                        if (j == newlist.Count() - 1)
                        {
                            break;
                        }
                        unit += ",";
                    }
                    pa.PatentDepartment = unit;
                }
                else
                {
                    pa.PatentDepartment = null;
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    InsertValue();
                    pa.IsPass = true;
                    //lby ↓
                    int attachid = pm.UpLoadFile(PatentFile).Attachid;
                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("专利证书文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("专利证书文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        pa.Attachment_Patent = attachid;
                    }
                    else
                    {
                        pa.Attachment_Patent = null;
                    }

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

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

                    case -2:
                        Alert.ShowInTop("申请书文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        pa.Attachment_Application = attachid;
                    }
                    else
                    {
                        pa.Attachment_Application = null;
                    }
                    if (tAchievement.SelectedItem != null)
                    {
                        pa.AchievementID = tAchievement.SelectedItem.Text;
                    }
                    else
                    {
                        pa.AchievementID = tAchievement.Text;
                    }
                    patent.Insert(pa);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    InsertValue();
                    pa.IsPass = false;
                    //lby ↓
                    int attachid = pm.UpLoadFile(PatentFile).Attachid;
                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("专利证书文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("专利证书文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        pa.Attachment_Patent = attachid;
                    }
                    else
                    {
                        pa.Attachment_Patent = null;
                    }

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

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

                    case -2:
                        Alert.ShowInTop("申请书文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        pa.Attachment_Application = attachid;
                    }
                    else
                    {
                        pa.Attachment_Application = null;
                    }

                    patent.Insert(pa);
                    operate.LoginName        = username;
                    operate.OperationTime    = DateTime.Now;
                    operate.LoginIP          = " ";
                    operate.OperationContent = "Patent";
                    operate.OperationType    = "添加";
                    operate.OperationDataID  = pa.PatentID;
                    op.Insert(operate);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                }
            }
            catch (Exception ex)
            {
                //lby ↓
                if (pa.Attachment_Patent != null && pa.Attachment_Application != null)
                {
                    int[]  attachid         = { pa.Attachment_Patent.Value, pa.Attachment_Application.Value };
                    string path_Patent      = at.FindPath(attachid[0]);
                    string path_Application = at.FindPath(attachid[1]);
                    pm.DeleteFile(attachid[0], path_Patent);
                    pm.DeleteFile(attachid[1], path_Application);
                }
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 21
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (T_UserName.Text.Trim() != "")
                {
                    //if (T_UserInfoBH.Text.Trim() == "")
                    //{
                    //    Alert.ShowInTop("用户编号不能为空!");
                    //    T_UserInfoBH.Text = "";
                    //    return;
                    //}
                    if (T_LoginName.Text.Trim() == "")
                    {
                        Alert.ShowInTop("用户登录名不能为空!");
                        T_LoginName.Text = "";
                        return;
                    }
                    if (bllUser.IsUser(T_UserName.Text.Trim()) == null)
                    {
                        //if (bllUser.IsUserInfoBH(T_UserInfoBH.Text.Trim()) == null)
                        //{
                        if (bllUser.IsLoginName(T_LoginName.Text.Trim()) == null)
                        {
                            UserInfo NewUser = new UserInfo();
                            if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                            {
                                NewUser.IsPass = false;
                            }
                            else
                            {
                                NewUser.IsPass = true;
                            }
                            NewUser.UserName = T_UserName.Text.Trim();
                            if (rbtnBoy.Checked == true)
                            {
                                NewUser.Sex = true;
                            }
                            else
                            {
                                NewUser.Sex = false;
                            }
                            NewUser.Nation    = DropDownListNation.SelectedItem.Text;
                            NewUser.StaffType = DropDownListStaffType.SelectedItem.Text;
                            NewUser.Hometown  = T_Hometown.Text.Trim();
                            if (DatePickerBirth.SelectedDate.HasValue)
                            {
                                NewUser.Birth = DatePickerBirth.SelectedDate;
                            }
                            NewUser.JobTitle        = T_JobTitle.Text.Trim();
                            NewUser.AgencyID        = bllAgency.SelectAgencyID(DropDownListAgencyP.SelectedText);
                            NewUser.TeleNum         = T_Telenum.Text.Trim();
                            NewUser.HomeNum         = T_HomeTetlum.Text.Trim();
                            NewUser.OfficeNum       = T_Officenum.Text.Trim();
                            NewUser.DocumentsNum    = T_DocumentsNum.Text.Trim();
                            NewUser.DocumentsType   = DropDownListDocumentsType.SelectedItem.Text;
                            NewUser.PoliticalStatus = DropDownListPoliticalStatus.SelectedItem.Text;
                            NewUser.Profile         = TextAreaProfile.Text.Trim();
                            NewUser.Education       = DropDownListEducation.SelectedItem.Text;
                            NewUser.Degree          = DropDownListDegree.SelectedItem.Text;
                            NewUser.StaffType       = DropDownListStaffType.SelectedItem.Text;
                            NewUser.Specialty       = T_Specilty.Text.Trim();
                            if (ISMarriage.Checked == true)
                            {
                                NewUser.Marriage = true;
                            }
                            else
                            {
                                NewUser.Marriage = false;
                            }

                            NewUser.Fax         = T_Fax.Text.Trim();
                            NewUser.HomeAddress = T_HomeAddress.Text.Trim();
                            NewUser.PostalCode  = T_PostalCode.Text.Trim();
                            NewUser.qqNum       = T_QQnum.Text.Trim();
                            NewUser.Remark      = T_Remark.Text.Trim();
                            NewUser.UnitName    = T_UnitName.Text.Trim();
                            //NewUser.StaffType = T_StaffType.Text.Trim();
                            //NewUser.UserInfoBH = T_UserInfoBH.Text.Trim();
                            NewUser.LoginName = T_LoginName.Text.Trim();

                            if (IsPWD.Text.Trim() != T_LoginPWD.Text.Trim())
                            {
                                Alert.ShowInTop("密码不一致!");
                                IsPWD.Text = "";
                                return;
                            }
                            else
                            {
                                NewUser.LoginPWD = encrypt.MD5(T_LoginPWD.Text.Trim());
                            }
                            NewUser.Email   = T_Email.Text.Trim();
                            NewUser.TeleNum = T_Telenum.Text.Trim();
                            NewUser.AdministrativeLevelName = DropDownListAdmin.SelectedItem.Text;
                            NewUser.Domicile        = T_Domicile.Text.Trim();
                            NewUser.SubjectSortName = DropDownListSubjectSortP.SelectedItem.Text;
                            if (DatePickerJobTitleTime.SelectedDate.HasValue)
                            {
                                NewUser.JobTitleTime = DatePickerJobTitleTime.SelectedDate;
                            }
                            if (DatePickerPoliticalStatusTime.SelectedDate.HasValue)
                            {
                                NewUser.PoliticalStatusTime = DatePickerPoliticalStatusTime.SelectedDate;
                            }
                            if (IsMasterTeacher.Checked == true)
                            {
                                NewUser.IsMasteTeacher = true;
                            }
                            else
                            {
                                NewUser.IsMasteTeacher = false;
                            }
                            if (IsDoctorTeacher.Checked == true)
                            {
                                NewUser.IsDocdorTeacher = true;
                            }
                            else
                            {
                                NewUser.IsDocdorTeacher = false;
                            }
                            if (DatePickerMasterTeacherTime.SelectedDate.HasValue)
                            {
                                NewUser.MasterTeacherTime = DatePickerMasterTeacherTime.SelectedDate;
                            }
                            if (DatePickerDoctorTeacherTime.SelectedDate.HasValue)
                            {
                                NewUser.DoctorTeacherTime = DatePickerDoctorTeacherTime.SelectedDate;
                            }
                            NewUser.SecrecyLevel      = Convert.ToInt32(DropDownListSecrecyLevel.SelectedIndex + 1);
                            NewUser.ResearchDirection = T_Reserch.Text.Trim();
                            NewUser.LastSchool        = LastSchool.Text.Trim();
                            NewUser.EnterSchoolTime   = DatePickerEnterSchoolTime.SelectedDate;    //入校时间;
                            NewUser.StudySource       = DropDownListStudySource.SelectedItem.Text; //学缘
                            NewUser.EntryPerson       = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;

                            if (Session["AttachID"] != null)
                            {
                                NewUser.PhotoID = int.Parse(Session["AttachID"].ToString());
                            }
                            else
                            {
                                NewUser.PhotoID = null;
                            }
                            //switch (AttachID)
                            //{
                            //    case -1:
                            //        Alert.ShowInTop("照片类型不符,请重新选择!");
                            //        return;
                            //    case 0:
                            //        Alert.ShowInTop("文件名已经存在!");
                            //        return;
                            //    case -2:
                            //        Alert.ShowInTop("照片不能大于150M");
                            //        return;
                            //    case -3:
                            //        NewUser.PhotoID = null;
                            //        break;
                            //    //Alert.ShowInTop("请上传附件");
                            //    //return;
                            //    default:
                            //        NewUser.PhotoID = AttachID;
                            //        break;
                            //}
                            if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                            {
                                bllUser.Insert(NewUser);    //插入人员基本信息表
                                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员基本信息添加完成!"));
                            }
                            else
                            {
                                bllUser.Insert(NewUser);    //插入人员基本信息表
                                //向操作日志表中插入
                                OperationLog operate = new OperationLog();
                                operate.LoginName        = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                                operate.LoginIP          = "";
                                operate.OperationType    = "添加";
                                operate.OperationContent = "UserInfo";
                                operate.OperationDataID  = NewUser.UserInfoID;
                                operate.OperationTime    = System.DateTime.Now;
                                operate.Remark           = "";
                                bllOperate.Insert(operate);
                                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员基本信息已提交审核!"));
                            }
                        }
                        else
                        {
                            if (bllUser.IsLoginName(T_LoginName.Text.Trim()).IsPass == false)
                            {
                                Alert.ShowInTop("该用户登录名正在审核中,请等待!");
                                T_LoginName.Text = "";
                                return;
                            }
                            if (bllUser.IsLoginName(T_LoginName.Text.Trim()).IsPass == true)
                            {
                                Alert.ShowInTop("用户登录名已存在!");
                                T_LoginName.Text = "";
                                return;
                            }
                        }
                        //}
                        //else
                        //{
                        //    if (bllUser.IsUserInfoBH(T_UserInfoBH.Text.Trim()).IsPass == false)
                        //    {
                        //        Alert.ShowInTop("该用户编号正在审核中,请等待!");
                        //        T_UserInfoBH.Text = "";
                        //        return;
                        //    }
                        //    if (bllUser.IsUserInfoBH(T_UserInfoBH.Text.Trim()).IsPass == true)
                        //    {
                        //        Alert.ShowInTop("用户编号已存在!");
                        //        T_UserInfoBH.Text = "";
                        //        return;
                        //    }
                        //}
                    }
                    else
                    {
                        if (bllUser.IsUser(T_UserName.Text.Trim()).IsPass == false)
                        {
                            Alert.ShowInTop("该用户姓名正在审核中,请等待!");
                            T_UserName.Text = "";
                            return;
                        }
                        if (bllUser.IsUser(T_UserName.Text.Trim()).IsPass == true)
                        {
                            Alert.ShowInTop("用户姓名已存在!");
                            T_UserName.Text = "";
                            return;
                        }
                    }
                }
                else
                {
                    Alert.ShowInTop("人员名称不能为空!");
                    T_UserName.Text = "";
                    return;
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 22
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tAchievementName.Text.Trim() == "")
                {
                    Alert.Show("成果名称不能为空!");
                    return;
                }
                if (tAppraisalUnit.Text.Trim() == "")
                {
                    Alert.Show("鉴定组织部门不能为空!");
                    return;
                }
                if (tApRemarkRank.Text.Trim() == "")
                {
                    Alert.Show("鉴定评语级别不能为空!");
                    return;
                }
                if (tApprovalNum.Text.Trim() == "")
                {
                    Alert.Show("鉴定批文号不能为空!");
                    return;
                }
                if (ProjectInNum.Text.Trim() == "")
                {
                    Alert.Show("项目内部编号不能为空!");
                    return;
                }
                if (ProjectPeople.Text.Trim() == "")
                {
                    Alert.Show("成员不能为空!");
                    return;
                }
                if (FirstFinishedPeople.Text.Trim() == "")
                {
                    Alert.Show("成果第一完成人不能为空!");
                    return;
                }
                BLHelper.BLLAgency agency = new BLHelper.BLLAgency();
                achs.AchievementName     = tAchievementName.Text.Trim();
                achs.AgencyID            = agency.SelectAgencyID(DropDownListAgency.SelectedText.Trim());
                achs.ProjectName         = tProjectID.Text.Trim();
                achs.AppraisalTime       = dAppraisalTime.SelectedDate;
                achs.AppraisalUnit       = tAppraisalUnit.Text.Trim();
                achs.ApRemarkRank        = tApRemarkRank.Text.Trim();
                achs.ApprovalNum         = tApprovalNum.Text.Trim();
                achs.ProjectInNum        = ProjectInNum.Text.Trim();        //项目分类编号
                achs.ProjectPeople       = ProjectPeople.Text.Trim();       //成员
                achs.FirstFinishedPeople = FirstFinishedPeople.Text.Trim(); //成果第一完成人
                // achs.ProjectRank = DropDownListProjectRank.SelectedText;//鉴定级别
                achs.ProjectLevel = DropDownListProjectLevel.SelectedText;  //鉴定水平
                achs.ProjectForm  = DropDownListProjectForm.SelectedText;   //鉴定形式
                achs.SecrecyLevel = Convert.ToInt32(dSecrecyLevel.SelectedIndex + 1);
                achs.EntryPerson  = achieve.Findmodel(Convert.ToInt32(Session["AchievementID"])).EntryPerson;
                int AttachmentID = achieve.FindAttachment(Convert.ToInt32(Session["AchievementID"]));
                int OpinionPage  = achieve.FindAttachment(Convert.ToInt32(Session["AchievementID"]));
                int MemberPage   = achieve.FindAttachment(Convert.ToInt32(Session["AchievementID"]));
                int SealPage     = achieve.FindAttachment(Convert.ToInt32(Session["AchievementID"]));
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)//如果等于5级
                {
                    achs.IsPass        = true;
                    achs.AchievementID = Convert.ToInt32(Session["AchievementID"]);
                    string path     = at.FindPath(AttachmentID);
                    int    attachid = pm.UpLoadFile(fileupload).Attachid;
                    if (attachid != -3)//上传控件是否有值
                    {
                        switch (attachid)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.AttachmentID = attachid; //成果表的附件为新插入的附件ID
                        achieve.Update(achs);         //更新
                        pm.DeleteFile(AttachmentID, path);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    else //上传空间没有值
                    {
                        if (AttachmentID != 0)
                        {
                            achs.AttachmentID = AttachmentID;
                        }
                        achieve.Update(achs);//更新成果表
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    string path1   = at.FindPath(OpinionPage);
                    int    opinion = pm.UpLoadFile(OpinionPage1).Attachid;
                    if (opinion != -3)//上传控件是否有值
                    {
                        switch (opinion)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.OpinionPage = opinion;
                        achieve.Update(achs);//更新
                        pm.DeleteFile(OpinionPage, path1);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    else //上传空间没有值
                    {
                        if (OpinionPage != 0)
                        {
                            achs.OpinionPage = OpinionPage;
                        }
                        achieve.Update(achs);//更新成果表
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    string path2  = at.FindPath(MemberPage);
                    int    member = pm.UpLoadFile(MemberPage1).Attachid;
                    if (member != -3)//上传控件是否有值
                    {
                        switch (member)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.MemberPage = member; //成果表的附件为新插入的附件ID
                        achieve.Update(achs);     //更新
                        pm.DeleteFile(MemberPage, path2);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    else //上传空间没有值
                    {
                        if (MemberPage != 0)
                        {
                            achs.MemberPage = MemberPage;
                        }
                        achieve.Update(achs);//更新成果表
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    string path3 = at.FindPath(SealPage);
                    int    seal  = pm.UpLoadFile(SealPage1).Attachid;
                    if (seal != -3)//上传控件是否有值
                    {
                        switch (seal)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.SealPage = seal; //成果表的附件为新插入的附件ID
                        achieve.Update(achs); //更新
                        pm.DeleteFile(SealPage, path3);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    else //上传空间没有值
                    {
                        if (SealPage != 0)
                        {
                            achs.SealPage = SealPage;
                        }
                        achieve.Update(achs);//更新成果表
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                }
                else//小于5级
                {
                    string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "Achievement";
                    log.OperationType    = "更新";
                    achs.IsPass          = false;
                    int attachid = pm.UpLoadFile(fileupload).Attachid;
                    if (attachid != -3)//上传控件是否有值
                    {
                        switch (attachid)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.AttachmentID = attachid; //成果表的附件为新插入的附件ID
                        achieve.Insert(achs);         //插入成果表
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);//将成果更新插入操作表
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    else//上传控件没有值
                    {
                        if (AttachmentID != 0)//原来有附件
                        {
                            achs.AttachmentID = AttachmentID;
                        }
                        achieve.Insert(achs);
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    int opinion = pm.UpLoadFile(OpinionPage1).Attachid;
                    if (opinion != -3)//上传控件是否有值
                    {
                        switch (opinion)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.OpinionPage = opinion;
                        achieve.Insert(achs);//插入成果表
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);//将成果更新插入操作表
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    else//上传控件没有值
                    {
                        if (OpinionPage != 0)//原来有附件
                        {
                            achs.OpinionPage = OpinionPage;
                        }
                        achieve.Insert(achs);
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    int member = pm.UpLoadFile(MemberPage1).Attachid;
                    if (member != -3)//上传控件是否有值
                    {
                        switch (member)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.MemberPage = member;
                        achieve.Insert(achs);//插入成果表
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);//将成果更新插入操作表
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    else//上传控件没有值
                    {
                        if (MemberPage != 0)//原来有附件
                        {
                            achs.MemberPage = MemberPage;
                        }
                        achieve.Insert(achs);
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    int seal = pm.UpLoadFile(SealPage1).Attachid;
                    if (seal != -3)//上传控件是否有值
                    {
                        switch (seal)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        achs.SealPage = seal;
                        achieve.Insert(achs);//插入成果表
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);//将成果更新插入操作表
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    else//上传控件没有值
                    {
                        if (SealPage != 0)//原来有附件
                        {
                            achs.SealPage = SealPage;
                        }
                        achieve.Insert(achs);
                        log.OperationDataID = Convert.ToInt32(Session["AchievementID"]);
                        log.Remark          = achs.AchievementID.ToString();
                        op.Insert(log);
                        achieve.UpdateIsPass(Convert.ToInt32(Session["AchievementID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                }
            }
            catch (Exception ex)
            {
                int    attachid = Convert.ToInt32(achs.AttachmentID);
                string path     = at.FindPath(attachid);
                pm.DeleteFile(attachid, path);
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 23
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserInfoName.Text.Trim() != "")
                {
                    if (bllUser.IsUser(UserInfoName.Text.Trim()) != null)
                    {
                        if (bllUser.IsUser(UserInfoName.Text.Trim()).IsPass == true)
                        {
                            if (WorkUnit.Text.Trim() == "")
                            {
                                Alert.ShowInTop("工作单位不能为空!");
                                WorkUnit.Text = "";
                                return;
                            }
                            if (Post.Text.Trim() == "")
                            {
                                Alert.ShowInTop("职务不能为空!");
                                Post.Text = "";
                                return;
                            }
                            if (JobTitle.Text.Trim() == "")
                            {
                                Alert.ShowInTop("职称不能为空!");
                                JobTitle.Text = "";
                                return;
                            }

                            WorkExperience work = new WorkExperience();
                            work.UserInfoID = bllUser.FindID(UserInfoName.Text.Trim());
                            work.StartTime  = DatePickerStartTime.SelectedDate;
                            if (DatePickerEndTime.SelectedDate.HasValue)
                            {
                                if (DatePickerEndTime.SelectedDate < DatePickerStartTime.SelectedDate)
                                {
                                    Alert.ShowInTop("结束时间不能小于开始时间!");
                                    return;
                                }
                                else
                                {
                                    work.EndTime = DatePickerEndTime.SelectedDate;
                                }
                            }
                            work.PartTimeUnit = PartTimeUnit.Text.Trim();
                            work.JobTitle     = JobTitle.Text.Trim();
                            work.Post         = Post.Text.Trim();
                            work.WorkUnit     = WorkUnit.Text.Trim();
                            work.SecrecyLevel = DropDownListSecrecyLevel.SelectedIndex + 1;
                            work.EntryPerson  = bllWork.Find(Convert.ToInt32(Session["WorkExperienceID"])).EntryPerson;
                            work.Remark       = Remark.Text.Trim();
                            if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                            {
                                bllWork.UpdateIsPass(Convert.ToInt32(Session["WorkExperienceID"]), false);
                                work.IsPass = false;
                                bllWork.InsertForPeople(work);//插入工作经历表
                                OperationLog operate = new OperationLog();
                                operate.LoginName        = bllWork.Find(Convert.ToInt32(Session["WorkExperienceID"])).EntryPerson;
                                operate.LoginIP          = "";
                                operate.OperationType    = "更新";
                                operate.OperationContent = "WorkExperience";
                                operate.OperationDataID  = Convert.ToInt32(Session["WorkExperienceID"]);
                                operate.OperationTime    = System.DateTime.Now;
                                operate.Remark           = work.WorkExperienceID.ToString();
                                bllOperate.Insert(operate);//插入操作表
                                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员工作经历信息已提交审核!"));
                            }
                            else
                            {
                                work.IsPass           = true;
                                work.WorkExperienceID = Convert.ToInt32(Session["WorkExperienceID"]);
                                bllWork.Update(work);//修改工作经历表
                                PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员工作经历信息已修改完成!"));
                            }
                        }
                        else
                        {
                            Alert.ShowInTop("该人员正在审核中!");
                        }
                    }
                    else
                    {
                        Alert.ShowInTop("人员不存在!");
                    }
                }
                else
                {
                    Alert.ShowInTop("人员不能为空!");
                    UserInfoName.Text = "";
                    return;
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 24
0
        //保存更改
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tInspectName.Text.Trim() == "")
                {
                    Alert.Show("姓名不能为空!");
                    return;
                }
                if (tWorkPlace.Text.Trim() == "")
                {
                    Alert.Show("工作单位不能不空!");
                    return;
                }
                if (tVisitContent.Text.Trim() == "")
                {
                    Alert.Show("参观内容不能为空!");
                    return;
                }
                BLHelper.BLLAgency agency = new BLHelper.BLLAgency();
                ins.EntryPerson  = inspect.Findmodel(Convert.ToInt32(Session["InspectID"])).EntryPerson;
                ins.InspectName  = tInspectName.Text.Trim();
                ins.VisitContent = tVisitContent.Text.Trim();
                ins.InspectTime  = dInspectTime.SelectedDate;
                ins.WorkPlace    = tWorkPlace.Text.Trim();
                ins.SecrecyLevel = Convert.ToInt32(dSecrecyLevel.SelectedIndex + 1);
                ins.AgencyID     = agency.SelectAgencyID(DropDownListAgency.SelectedText);
                ins.Duty         = tDuty.Text.Trim();
                int    AttachmentID = inspect.FindAttachmentID(Convert.ToInt32(Session["InspectID"]));
                string path         = attachment.FindPath(AttachmentID);
                string username     = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    ins.IsPass        = true;
                    ins.UnitInspectID = Convert.ToInt32(Session["InspectID"]);
                    int Attachment = pm.UpLoadFile(fileupload).Attachid;
                    if (Attachment != -3)
                    {
                        switch (Attachment)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        ins.AccessoryID = Attachment;
                        inspect.Update(ins);
                        pm.DeleteFile(AttachmentID, path);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                    else
                    {
                        if (AttachmentID != 0)
                        {
                            ins.AccessoryID = AttachmentID;
                        }
                        inspect.Update(ins);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                    }
                }
                else
                {
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "UnitInspect";
                    log.OperationType    = "更新";
                    ins.IsPass           = false;
                    int Attachment = pm.UpLoadFile(fileupload).Attachid;
                    if (Attachment != -3)
                    {
                        switch (Attachment)
                        {
                        case -1:
                            Alert.ShowInTop("文件类型不符,请重新选择!");
                            return;

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

                        case -2:
                            Alert.ShowInTop("文件不能大于150M");
                            return;
                        }
                        ins.AccessoryID = Attachment;
                        inspect.Insert(ins);
                        log.OperationDataID = Convert.ToInt32(Session["InspectID"]);
                        log.Remark          = ins.UnitInspectID.ToString();
                        op.Insert(log);
                        inspect.ChangePass(Convert.ToInt32(Session["InspectID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                    else
                    {
                        if (AttachmentID != 0)
                        {
                            ins.AccessoryID = AttachmentID;
                        }
                        inspect.Insert(ins);
                        log.OperationDataID = Convert.ToInt32(Session["InspectID"]);
                        log.Remark          = ins.UnitInspectID.ToString();
                        op.Insert(log);
                        inspect.ChangePass(Convert.ToInt32(Session["InspectID"]), false);
                        PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                    }
                }
            }
            catch (Exception ex)
            {
                int    attachid = Convert.ToInt32(ins.AccessoryID);
                string path     = attachment.FindPath(attachid);
                pm.DeleteFile(attachid, path);
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 25
0
        //更新
        public void Update()
        {
            try
            {
                if (Session["LoginName"].ToString() == "")
                {
                    Response.Redirect("login.aspx");
                    Alert.Show("登录超时!");
                }
                UserInfo NewUser = new UserInfo();
                NewUser.UserName = T_UserName.Text.Trim();
                if (rbtnBoy.Checked == true)
                {
                    NewUser.Sex = true;
                }
                else
                {
                    NewUser.Sex = false;
                }
                NewUser.Nation   = DropDownListNation.SelectedItem.Text;
                NewUser.Hometown = T_Hometown.Text.Trim();
                if (DatePickerBirth.SelectedDate.HasValue)
                {
                    NewUser.Birth = DatePickerBirth.SelectedDate;
                }
                NewUser.JobTitle        = T_JobTitle.Text.Trim();
                NewUser.AgencyID        = bllAgency.SelectAgencyID(DropDownListAgencyP.SelectedText);
                NewUser.TeleNum         = T_Telenum.Text.Trim();
                NewUser.HomeNum         = T_HomeTetlum.Text.Trim();
                NewUser.OfficeNum       = T_Officenum.Text.Trim();
                NewUser.DocumentsNum    = T_DocumentsNum.Text.Trim();
                NewUser.DocumentsType   = DropDownListDocumentsType.SelectedItem.Text;
                NewUser.PoliticalStatus = DropDownListPoliticalStatus.SelectedItem.Text;
                NewUser.Profile         = TextAreaProfile.Text.Trim();
                NewUser.Education       = DropDownListEducation.SelectedItem.Text;
                NewUser.Degree          = DropDownListDegree.SelectedItem.Text;
                NewUser.StaffType       = DropDownListStaffType.SelectedItem.Text;
                NewUser.Specialty       = T_Specilty.Text.Trim();
                if (ISMarriage.Checked == true)
                {
                    NewUser.Marriage = true;
                }
                else
                {
                    NewUser.Marriage = false;
                }
                NewUser.Fax         = T_Fax.Text.Trim();
                NewUser.HomeAddress = T_HomeAddress.Text.Trim();
                NewUser.PostalCode  = T_PostalCode.Text.Trim();
                NewUser.qqNum       = T_QQnum.Text.Trim();
                NewUser.Remark      = T_Remark.Text.Trim();
                NewUser.UnitName    = T_UnitName.Text.Trim();
                //NewUser.StaffType = T_StaffType.Text.Trim();
                //NewUser.UserInfoBH = T_UserInfoBH.Text.Trim();
                NewUser.LoginName = T_LoginName.Text.Trim();
                //密码没有修改
                NewUser.LoginPWD = bllUser.IsUser(bllUser.FindByUserID(Convert.ToInt32(Session["UserInfoID"]))).LoginPWD;
                NewUser.Email    = T_Email.Text.Trim();
                NewUser.TeleNum  = T_Telenum.Text.Trim();
                NewUser.AdministrativeLevelName = DropDownListAdmin.SelectedItem.Text;
                NewUser.Domicile        = T_Domicile.Text.Trim();
                NewUser.SubjectSortName = DropDownListSubjectSortP.SelectedItem.Text;
                if (DatePickerJobTitleTime.SelectedDate.HasValue)
                {
                    NewUser.JobTitleTime = DatePickerJobTitleTime.SelectedDate;
                }
                if (DatePickerPoliticalStatusTime.SelectedDate.HasValue)
                {
                    NewUser.PoliticalStatusTime = DatePickerPoliticalStatusTime.SelectedDate;
                }
                if (IsDoctorTeacher.Checked == true)
                {
                    NewUser.IsDocdorTeacher = true;
                }
                else
                {
                    NewUser.IsDocdorTeacher = false;
                }
                if (IsMasterTeacher.Checked == true)
                {
                    NewUser.IsMasteTeacher = true;
                }
                else
                {
                    NewUser.IsMasteTeacher = false;
                }
                if (DatePickerMasterTeacherTime.SelectedDate.HasValue)
                {
                    NewUser.MasterTeacherTime = DatePickerMasterTeacherTime.SelectedDate;
                }
                if (DatePickerDoctorTeacherTime.SelectedDate.HasValue)
                {
                    NewUser.DoctorTeacherTime = DatePickerDoctorTeacherTime.SelectedDate;
                }
                NewUser.SecrecyLevel      = Convert.ToInt32(DropDownListSecrecyLevel.SelectedIndex + 1);
                NewUser.ResearchDirection = T_Reserch.Text.Trim();
                NewUser.LastSchool        = LastSchool.Text.Trim();
                NewUser.EnterSchoolTime   = DatePickerEnterSchoolTime.SelectedDate;    //入校时间;
                NewUser.StudySource       = DropDownListStudySource.SelectedItem.Text; //学缘
                //照片
                //int AttachmentID = bllUser.FindAttachmentID(Convert.ToInt32(Session["UserInfoID"]));
                int    PhotoID        = bllUser.FindPhotoID(Convert.ToInt32(Session["UserInfoID"]));
                string attachmentPath = BLLattachment.FindPath(PhotoID);
                string photoPath      = BLLattachment.FindPath(PhotoID);

                if (Session["AttachID"] != null)
                {
                    NewUser.PhotoID = int.Parse(Session["AttachID"].ToString());
                }


                NewUser.EntryPerson = bllUser.Find(Convert.ToInt32(Session["UserInfoID"]), true).EntryPerson;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    NewUser.IsPass     = true;
                    NewUser.UserInfoID = Convert.ToInt32(Session["UserInfoID"]);
                    bllUser.Update(NewUser);//更新人员基本信息表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员基本信息修改完成!"));
                }
                else
                {
                    NewUser.IsPass = false;
                    bllUser.ChangePass(Convert.ToInt32(Session["UserInfoID"]), false);
                    bllUser.Insert(NewUser);//插入人员基本信息表
                    //向操作日志表中插入
                    OperationLog operate = new OperationLog();
                    operate.LoginName        = NewUser.EntryPerson;
                    operate.LoginIP          = "";
                    operate.OperationType    = "更新";
                    operate.OperationContent = "UserInfo";
                    operate.OperationDataID  = Convert.ToInt32(Session["UserInfoID"]);
                    operate.OperationTime    = System.DateTime.Now;
                    operate.Remark           = NewUser.UserInfoID.ToString();
                    bllOperate.Insert(operate);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员基本信息已提交审核!"));
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 26
0
        //添加
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tAchievementName.Text.Trim() == "")
                {
                    Alert.Show("成果名称不能为空!");
                    return;
                }
                if (tAppraisalUnit.Text.Trim() == "")
                {
                    Alert.Show("鉴定组织部门不能为空!");
                    return;
                }
                if (tApRemarkRank.Text.Trim() == "")
                {
                    Alert.Show("成果登记号不能为空!");
                    return;
                }
                if (tApprovalNum.Text.Trim() == "")
                {
                    Alert.Show("证书文号不能为空!");
                    return;
                }
                if (ProjectInNum.Text.Trim() == "")
                {
                    Alert.Show("项目内部编号不能为空!");
                    return;
                }
                if (FirstFinishedPeople.Text.Trim() == "")
                {
                    Alert.Show("成果第一完成人不能为空!");
                    return;
                }
                if (ProjectPeople.Text.Trim() == "")
                {
                    Alert.Show("成员不能为空!");
                    return;
                }
                BLHelper.BLLAgency agency = new BLHelper.BLLAgency();
                ach.AchievementName     = tAchievementName.Text.Trim();
                ach.AgencyID            = agency.SelectAgencyID(DropDownListAgency.SelectedText);
                ach.ProjectName         = tProjectID.Text.Trim();
                ach.AppraisalTime       = dAppraisalTime.SelectedDate;
                ach.AppraisalUnit       = tAppraisalUnit.Text.Trim();
                ach.ApRemarkRank        = tApRemarkRank.Text.Trim();
                ach.ApprovalNum         = tApprovalNum.Text.Trim();
                ach.ProjectInNum        = ProjectInNum.Text.Trim();        //项目分类编号
                ach.ProjectPeople       = ProjectPeople.Text.Trim();       //成员
                ach.FirstFinishedPeople = FirstFinishedPeople.Text.Trim(); //成果第一完成人
                //ach.ProjectRank = DropDownListProjectRank.SelectedText;//鉴定级别
                ach.ProjectLevel = DropDownListProjectLevel.SelectedText;  //鉴定水平
                ach.ProjectForm  = DropDownListProjectForm.SelectedText;   //鉴定形式
                ach.SecrecyLevel = Convert.ToInt32(dSecrecyLevel.SelectedIndex + 1);
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                ach.EntryPerson = username;

                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    int attachid = pm.UpLoadFile(fileupload).Attachid;
                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        ach.AttachmentID = attachid;
                    }
                    else
                    {
                        ach.AttachmentID = null;
                    }
                    int opinion = pm.UpLoadFile(OpinionPage).Attachid;
                    switch (opinion)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (opinion != -3)
                    {
                        ach.OpinionPage = opinion;
                    }
                    else
                    {
                        ach.OpinionPage = null;
                    }
                    int member = pm.UpLoadFile(MemberPage).Attachid;
                    switch (member)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (member != -3)
                    {
                        ach.MemberPage = member;
                    }
                    else
                    {
                        ach.MemberPage = null;
                    }
                    int seal = pm.UpLoadFile(SealPage).Attachid;
                    switch (seal)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (seal != -3)
                    {
                        ach.SealPage = seal;
                    }
                    else
                    {
                        ach.SealPage = null;
                    }
                    ach.IsPass = true;
                    achieve.Insert(ach);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    int attachid = pm.UpLoadFile(fileupload).Attachid;
                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        ach.AttachmentID = attachid;
                    }
                    else
                    {
                        ach.AttachmentID = null;
                    }
                    int opinion = pm.UpLoadFile(OpinionPage).Attachid;
                    switch (opinion)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (opinion != -3)
                    {
                        ach.OpinionPage = opinion;
                    }
                    else
                    {
                        ach.OpinionPage = null;
                    }
                    int member = pm.UpLoadFile(MemberPage).Attachid;
                    switch (member)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (member != -3)
                    {
                        ach.MemberPage = member;
                    }
                    else
                    {
                        ach.MemberPage = null;
                    }
                    int seal = pm.UpLoadFile(SealPage).Attachid;
                    switch (seal)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (seal != -3)
                    {
                        ach.SealPage = seal;
                    }
                    else
                    {
                        ach.SealPage = null;
                    }
                    ach.IsPass = false;
                    achieve.Insert(ach);
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "Achievement";
                    log.OperationType    = "添加";
                    log.OperationDataID  = ach.AchievementID;
                    op.Insert(log);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                }
            }
            catch (Exception ex)
            {
                int    attachid = Convert.ToInt32(ach.AttachmentID);
                string path     = at.FindPath(attachid);
                pm.DeleteFile(attachid, path);
                pm.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 27
0
 //保存
 protected void Save_Click(object sender, EventArgs e)
 {
     try
     {
         if (UserInfoName.Text.Trim() != "")
         {
             if (bllUser.IsUser(UserInfoName.Text.Trim()) != null)
             {
                 if (bllUser.IsUser(UserInfoName.Text.Trim()).IsPass == true)
                 {
                     if (SchoolName.Text.Trim() == "")
                     {
                         Alert.ShowInTop("学校名称不能为空!");
                         SchoolName.Text = "";
                         return;
                     }
                     Education education = new Education();
                     education.UserInfoID     = bllUser.FindID(UserInfoName.Text.Trim());
                     education.SchoolName     = SchoolName.Text.Trim();
                     education.College        = College.Text.Trim();
                     education.EduTime        = DatePickerEduTime.SelectedDate;
                     education.Degree         = DropDownListDegree.SelectedItem.Text;
                     education.Series         = Series.Text.Trim();
                     education.Major          = Major.Text.Trim();
                     education.SecrecyLevel   = DropDownListSecrecyLevel.SelectedIndex + 1;
                     education.EntryPerson    = bllEducation.Find(Convert.ToInt32(Session["EducationID"])).EntryPerson;
                     education.GraduateNumber = GraduateNumber.Text.Trim();
                     education.DegreeNumber   = DegreeNumber.Text.Trim();
                     if (Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                     {
                         bllEducation.UpdateIsPass(Convert.ToInt32(Session["EducationID"]), false);
                         education.IsPass = false;
                         bllEducation.InsertForPeople(education);//插入学历表
                         OperationLog operate = new OperationLog();
                         operate.LoginName        = bllEducation.Find(Convert.ToInt32(Session["EducationID"])).EntryPerson;
                         operate.LoginIP          = "";
                         operate.OperationType    = "更新";
                         operate.OperationContent = "Education";
                         operate.OperationDataID  = Convert.ToInt32(Session["EducationID"]);
                         operate.OperationTime    = System.DateTime.Now;
                         operate.Remark           = education.EducationID.ToString();
                         bllOperate.Insert(operate);//插入操作表
                         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员学历信息已提交审核!"));
                     }
                     else
                     {
                         education.IsPass      = true;
                         education.EducationID = Convert.ToInt32(Session["EducationID"]);
                         bllEducation.Update(education);//更新学历表
                         PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("人员学历信息已修改完成!"));
                     }
                 }
                 else
                 {
                     Alert.ShowInTop("该人员尚未通过审核!");
                 }
             }
             else
             {
                 Alert.ShowInTop("人员不存在!");
                 UserInfoName.Text = "";
             }
         }
         else
         {
             Alert.ShowInTop("人员名称不能为空!");
             UserInfoName.Text = "";
             return;
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Ejemplo n.º 28
0
        //项目修改
        public void AddProjects()
        {
            try
            {
                if (SourceUnit2.Text.Trim() == "")
                {
                    //Alert.ShowInTop("来源单位不能为空!");
                    SourceUnit2.Text = "";
                    //return;
                }
                if (ProjectManager.Text.Trim() == "")
                {
                    //Alert.ShowInTop("项目负责人(前三)不能为空!");
                    ProjectManager.Text = "";
                    //return;
                }
                if (ProjectHeads2.Text.Trim() == "")
                {
                    //Alert.ShowInTop("实际负责人不能为空!");
                    ProjectHeads2.Text = "";
                    //return;
                }
                if (AcceptUnit2.Text.Trim() == "")
                {
                    //Alert.ShowInTop("承担部门不能为空!");
                    AcceptUnit2.Text = "";
                    //return;
                }
                if (GivenMoneyUnits2.Text.Trim() == "")
                {
                    //Alert.ShowInTop("来款单位不能为空!");
                    GivenMoneyUnits2.Text = "";
                    //return;
                }
                aproject.ProjectName = ProjectName2.Text.Trim();
                aproject.AgencyID    = bllAgency.SelectAgencyID(DropDownListAgencyP.SelectedItem.Text);
                aproject.AcceptUnit  = AcceptUnit2.Text.Trim();
                aproject.SourceUnit  = SourceUnit2.Text.Trim();
                if (DropDownListProjectSortName.SelectedItem != null)
                {
                    aproject.ProjectSortName = DropDownListProjectSortName.SelectedItem.Text;
                }
                else
                {
                    aproject.ProjectSortName = "";
                }
                aproject.ProjectState  = DropDownListState.SelectedItem.Text;
                aproject.ApprovedMoney = ApprovedMoney2.Text.Trim();
                aproject.ProjectMember = ProjectMember.Text; //项目成员
                //if (!string.IsNullOrEmpty(GetMoney2.Text))
                //{
                //    if (Convert.ToDecimal(ApprovedMoney2.Text) - Convert.ToDecimal(GetMoney2.Text) < 0)
                //    {
                //        GetMoney2.Reset();
                //        Alert.ShowInTop("到账金额小于等于项目经费");
                //        return;
                //    }
                //    else
                //        aproject.GetMoney = GetMoney2.Text.Trim();
                //}
                //else
                aproject.GetMoney         = GetMoney2.Text.Trim();
                aproject.CooperationForms = DropDownListCooperationForms.SelectedItem.Text;//CooperationForms2.Text.Trim();
                aproject.ProjectLevel     = DropDownListProjectLevel.SelectedItem.Text;
                aproject.ProjectHeads     = ProjectHeads2.Text.Trim();
                aproject.StartTime        = DatePickerStartTime.SelectedDate;
                if (DatePickerEndTime.SelectedDate.HasValue)
                {
                    if (DatePickerEndTime.SelectedDate < DatePickerStartTime.SelectedDate)
                    {
                        DatePickerEndTime.Reset();
                        Alert.ShowInTop("结束时间不能小于开始时间!");
                        return;
                    }
                    else
                    {
                        aproject.EndTime = DatePickerEndTime.SelectedDate;
                    }
                }
                if (DatePickerExpectEndTime.SelectedDate.HasValue)
                {
                    if (DatePickerExpectEndTime.SelectedDate < DatePickerStartTime.SelectedDate)
                    {
                        DatePickerExpectEndTime.Reset();
                        Alert.ShowInTop("预期结束时间不能小于开始时间!");
                        return;
                    }
                    else
                    {
                        aproject.ExpectEndTime = DatePickerExpectEndTime.SelectedDate;
                    }
                }
                aproject.ExpecteResults  = DropDownListExpecteResults.SelectedItem.Text;//ExpecteResults2.Text.Trim();
                aproject.GivenMoneyUnits = GivenMoneyUnits2.Text.Trim();
                aproject.ProjectNature   = DropDownListNature.SelectedItem.Text;
                aproject.Remark          = Remark2.Text.Trim();
                aproject.SecrecyLevel    = DropDownListSecrecyLevel.SelectedIndex + 1;

                //管理费比例
                if (!string.IsNullOrEmpty(ManageMoney.Text))
                {
                    double num = 0.0;
                    if (double.TryParse(ManageMoney.Text.Trim(), out num))
                    {
                        if (Convert.ToDouble(ManageMoney.Text) > 0 && Convert.ToDouble(ManageMoney.Text) < 100)
                        {
                            aproject.ManageMoney = ManageMoney.Text.Trim();
                        }
                        else
                        {
                            ManageMoney.Text = "";
                            Alert.ShowInTop("管理费比例为0~100%!");
                            return;
                        }
                    }
                    else
                    {
                        ManageMoney.Reset();
                        Alert.ShowInTop("请输入数字!");
                        return;
                    }
                }
                else
                {
                    aproject.ManageMoney = bllFundingSet.FindProportion(aproject.ProjectNature, "管理费");
                }
                aproject.PactNum        = PactNum2.Text.Trim();
                aproject.TaskNum        = TaskNum2.Text.Trim();
                aproject.ProjectManager = ProjectManager.Text.Trim(); //项目负责人(前三)
                aproject.ProjectInNum   = ProjectInNum.Text.Trim();   //项目内部编号(科技处)
                aproject.EntryPerson    = bllProject.FindByid(Convert.ToInt32(Session["ProjectID"])).EntryPerson;
                //原经济效益附件
                int    BenefitID = bllProject.FindBenefit(Convert.ToInt32(Session["ProjectID"]));
                string path      = bllAttachment.FindPath(BenefitID);
                //原经费预算附件
                int    BudgetID   = bllProject.FindBudget(Convert.ToInt32(Session["ProjectID"]));
                string budgetpath = bllAttachment.FindPath(BudgetID);

                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)//如果等于5级
                {
                    aproject.IsPass    = true;
                    aproject.ProjectID = Convert.ToInt32(Session["ProjectID"]);
                    int Attachment = publicmethod.UpLoadFile(FileUploadFile).Attachid;//经济效益附件
                    switch (Attachment)
                    {
                    case -1:
                        Alert.ShowInTop("经济效益文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("经济效益文件不能大于150M");
                        return;
                    }
                    int budgetAttanchment = publicmethod.UpLoadFile(FileUploadFileM).Attachid;//经费预算附件
                    switch (budgetAttanchment)
                    {
                    case -1:
                        Alert.ShowInTop("经费预算文件类型不符,请重新选择!");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;

                    case 0:
                        Alert.ShowInTop("经费预算文件名已经存在!");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;

                    case -2:
                        Alert.ShowInTop("经费预算文件不能大于150M");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;
                    }
                    if (Attachment != -3)                        //上传控件是否有值
                    {
                        aproject.BenefitAttachment = Attachment; //附件为新插入的经济效益附件ID
                        publicmethod.DeleteFile(BenefitID, path);
                    }
                    else //上传空间没有值
                    {
                        if (BenefitID != 0)//原来有附件
                        {
                            aproject.BenefitAttachment = Attachment;
                        }
                    }
                    if (budgetAttanchment != -3)                       //上传控件是否有值
                    {
                        aproject.BudgetAttachment = budgetAttanchment; //附件为新插入的经费预算附件
                        publicmethod.DeleteFile(BudgetID, budgetpath);
                    }
                    else//上传空间没有值
                    {
                        if (BudgetID != 0)
                        {
                            aproject.BudgetAttachment = budgetAttanchment;
                        }
                    }
                    bllProject.Update(aproject);//更新
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else//小于5级
                {
                    aproject.IsPass = false;
                    int Attachment = publicmethod.UpLoadFile(FileUploadFile).Attachid;//经济效益附件
                    switch (Attachment)
                    {
                    case -1:
                        Alert.ShowInTop("经济效益文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("经济效益文件不能大于150M");
                        return;
                    }
                    int budgetAttanchment = publicmethod.UpLoadFile(FileUploadFileM).Attachid;//经费预算附件
                    switch (budgetAttanchment)
                    {
                    case -1:
                        Alert.ShowInTop("经费预算文件类型不符,请重新选择!");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;

                    case 0:
                        Alert.ShowInTop("经费预算文件名已经存在!");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;

                    case -2:
                        Alert.ShowInTop("经费预算文件不能大于150M");
                        if (Attachment != -1 && Attachment != 0 && Attachment != -2)
                        {
                            publicmethod.DeleteFile(Attachment, bllAttachment.FindPath(Attachment));
                        }
                        return;
                    }
                    if (Attachment != -3)                        //有值
                    {
                        aproject.BenefitAttachment = Attachment; //附件为新插入的经济效益附件ID
                    }
                    else//上传控件没有值
                    {
                        if (BenefitID != 0)//原来有附件
                        {
                            aproject.BenefitAttachment = Attachment;
                        }
                    }
                    if (budgetAttanchment != -3)                       //有值
                    {
                        aproject.BudgetAttachment = budgetAttanchment; ///附件为新插入的经费预算附件
                    }
                    else
                    {
                        if (BudgetID != 0)//原来有附件
                        {
                            aproject.BudgetAttachment = budgetAttanchment;
                        }
                    }
                    //向操作日志表中插入
                    bllProject.InsertProject(aproject);//插入
                    OperationLog operate = new OperationLog();
                    operate.LoginName        = bllProject.FindByid(Convert.ToInt32(Session["ProjectID"])).EntryPerson;
                    operate.LoginIP          = "";
                    operate.OperationType    = "更新";
                    operate.OperationContent = "Project";
                    operate.OperationDataID  = Convert.ToInt32(Session["ProjectID"]);
                    operate.OperationTime    = System.DateTime.Now;
                    operate.Remark           = bllProject.SelectProjectID(ProjectName2.Text).ToString();
                    bllOperate.Insert(operate);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("你的数据已提交,请等待确认!"));
                }
            }
            catch (Exception ex)
            {
                publicmethod.SaveError(ex, this.Request);
            }
        }
Ejemplo n.º 29
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("保存成功!"));
        }
Ejemplo n.º 30
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tAchievement.Text.Trim() == "")
                {
                    Alert.Show("成果名称不能为空!");
                    return;
                }
                if (tApplyUnit.Text.Trim() == "")
                {
                    Alert.Show("应用单位不能为空!");
                    return;
                }
                if (tUse.Text.Trim() == "")
                {
                    Alert.Show("用途不能为空!");
                    return;
                }
                if (dEndTime.SelectedDate < dStartTime.SelectedDate)
                {
                    Alert.ShowInTop("结束时间不能小于开始时间!");
                    return;
                }
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                app.EntryPerson = username;
                int attachid = pm.UpLoadFile(fileupload).Attachid;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    InsertValue();

                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        app.AttachmentID = attachid;
                    }
                    else
                    {
                        app.AttachmentID = null;
                    }
                    app.IsPass = true;
                    apply.Insert(app);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    InsertValue();
                    switch (attachid)
                    {
                    case -1:
                        Alert.ShowInTop("文件类型不符,请重新选择!");
                        return;

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

                    case -2:
                        Alert.ShowInTop("文件不能大于150M");
                        return;
                    }
                    if (attachid != -3)
                    {
                        app.AttachmentID = attachid;
                    }
                    else
                    {
                        app.AttachmentID = null;
                    }
                    app.IsPass = false;
                    apply.Insert(app);
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "AchivementApply";
                    log.OperationType    = "添加";
                    log.OperationDataID  = app.AchivementApplyID;
                    op.Insert(log);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待确认!"));
                }
            }
            catch (Exception ex)
            {
                int    attachid = Convert.ToInt32(app.AttachmentID);
                string path     = at.FindPath(attachid);
                pm.DeleteFile(attachid, path);
                pm.SaveError(ex, this.Request);
            }
        }