Exemplo n.º 1
0
        //删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            List <int> selections = pm.GridCount(Grid_FurtherStudy, CBoxSelect);

            if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
            {
                for (int i = 0; i < selections.Count(); i++)
                {
                    futherstudy.Delete(Convert.ToInt32(Grid_FurtherStudy.DataKeys[selections[i]][0].ToString()));
                }
                InitData();
                Alert.ShowInTop("删除数据成功!");
                btnSelect_All.Text = "全选";
            }
            else
            {
                for (int i = 0; i < selections.Count(); i++)
                {
                    futherstudy.UpdateIsPass(Convert.ToInt32(Grid_FurtherStudy.DataKeys[selections[i]][0].ToString()), false);
                    operate.LoginName        = Session["LoginName"].ToString();
                    operate.OperationTime    = DateTime.Now;
                    operate.LoginIP          = " ";
                    operate.OperationContent = "FutherStudy";
                    operate.OperationType    = "删除";
                    operate.OperationDataID  = Convert.ToInt32(Grid_FurtherStudy.DataKeys[selections[i]][0].ToString());
                    op.Insert(operate);
                }
                InitData();
                Alert.ShowInTop("操作已经提交,请等待管理员确认!");
                btnSelect_All.Text = "全选";
            }
            btnDelete.Enabled = false;
        }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
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);
     }
 }
        //保存
        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);
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
 //删除所选行数据
 protected void Delete_Click(object sender, EventArgs e)
 {
     BLHelper.BLLPatent           blpant  = new BLHelper.BLLPatent();
     BLHelper.BLLAttachment       blat    = new BLHelper.BLLAttachment();
     Common.Entities.OperationLog operate = new OperationLog();
     try
     {
         string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             for (int i = 0; i < pm.GridCount(Grid_Patent, CBoxSelect).Count(); i++)
             {
                 int    ss               = Convert.ToInt32(Grid_Patent.DataKeys[pm.GridCount(Grid_Patent, CBoxSelect)[i]][0].ToString());
                 int[]  attachid         = blpant.Delete(ss);
                 string path_Patent      = blat.FindPath(attachid[0]);
                 string path_Application = blat.FindPath(attachid[1]);
                 pm.DeleteFile(attachid[0], path_Patent);
                 pm.DeleteFile(attachid[1], path_Application);
             }
             InitData();
             btnSelect_All.Text = "全选";
             Alert.ShowInTop("删除数据成功!");
             Delete.Enabled = false;
         }
         else
         {
             for (int i = 0; i < pm.GridCount(Grid_Patent, CBoxSelect).Count(); i++)
             {
                 blpant.UpdateIsPass(Convert.ToInt32(Grid_Patent.DataKeys[pm.GridCount(Grid_Patent, CBoxSelect)[i]][0]), false);
                 operate.LoginName        = username;
                 operate.OperationTime    = DateTime.Now;
                 operate.LoginIP          = " ";
                 operate.OperationContent = "Patents";
                 operate.OperationType    = "删除";
                 operate.OperationDataID  = Convert.ToInt32(Grid_Patent.DataKeys[pm.GridCount(Grid_Patent, CBoxSelect)[i]][0]);
                 op.Insert(operate);
             }
             InitData();
             btnSelect_All.Text = "全选";
             Alert.ShowInTop("您的数据已提交,请等待确认!");
             Delete.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
         Alert.ShowInTop("删除错误,请联系管理员!");
     }
 }
Exemplo n.º 7
0
 //删除
 protected void btn_Delete_Click(object sender, EventArgs e)
 {
     BLHelper.BLLPaper        paper = new BLHelper.BLLPaper();
     BLHelper.BLLAttachment   blat  = new BLHelper.BLLAttachment();
     BLHelper.BLLOperationLog op    = new BLHelper.BLLOperationLog();
     try
     {
         int count = pm.GridCount(Grid_Paper, CBoxSelect).Count();
         if (count <= 0)
         {
             Alert.ShowInTop("请至少选择一项!");
             return;
         }
         string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             for (int i = 0; i < pm.GridCount(Grid_Paper, CBoxSelect).Count(); i++)
             {
                 paper.Delete(Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0].ToString()));
             }
             InitData();
             Alert.ShowInTop("删除数据成功!");
             btn_Delete.Enabled = false;
         }
         else
         {
             Common.Entities.OperationLog operate = new OperationLog();
             for (int i = 0; i < pm.GridCount(Grid_Paper, CBoxSelect).Count(); i++)
             {
                 paper.UpdateIsPass(Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0]), false);
                 operate.LoginName        = username;
                 operate.OperationTime    = DateTime.Now;
                 operate.LoginIP          = " ";
                 operate.OperationContent = "Files";
                 operate.OperationType    = "删除";
                 operate.OperationDataID  = Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0]);
                 op.Insert(operate);
             }
             InitData();
             Alert.ShowInTop("您的数据已提交,请等待确认!");
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
         Alert.ShowInTop("删除失败,请联系管理员!");
     }
 }
Exemplo n.º 8
0
 //删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             for (int i = 0; i < pm.GridCount(Grid_UnitInspect, CBoxSelect).Count(); i++)
             {
                 int    attachid = inspect.Delete(Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0].ToString()));
                 string path     = at.FindPath(attachid);
                 if (path != "")
                 {
                     pm.DeleteFile(attachid, path);
                 }
             }
             InitData();
             Alert.ShowInTop("删除数据成功!");
             btnSelect_All.Text = "全选";
         }
         else
         {
             for (int i = 0; i < pm.GridCount(Grid_UnitInspect, CBoxSelect).Count(); i++)
             {
                 inspect.ChangePass(Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0]), false);
                 operate.LoginName        = username;
                 operate.OperationTime    = DateTime.Now;
                 operate.LoginIP          = " ";
                 operate.OperationContent = "UnitInspect";
                 operate.OperationType    = "删除";
                 operate.OperationDataID  = Convert.ToInt32(Grid_UnitInspect.DataKeys[pm.GridCount(Grid_UnitInspect, CBoxSelect)[i]][0]);
                 op.Insert(operate);
             }
             InitData();
             Alert.ShowInTop("您的数据已提交,请等待确认!");
             btnSelect_All.Text = "全选";
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
     }
 }
Exemplo n.º 9
0
        //删除选择行的点击事件
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            BLHelper.BLLOperationLog op      = new BLHelper.BLLOperationLog();
            OperationLog             operate = new OperationLog();

            BLHelper.BLLUser user = new BLHelper.BLLUser();
            try
            {
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++)
                    {
                        bllequipment.Delete(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0].ToString()));
                    }
                    InitData();
                    btnSelect_All.Text = "全选";
                    Alert.ShowInTop("删除数据成功!");
                }
                else
                {
                    for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++)
                    {
                        bllequipment.UpdateIsPass(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]), false);
                        operate.LoginName        = username;
                        operate.OperationTime    = DateTime.Now;
                        operate.LoginIP          = " ";
                        operate.OperationContent = "Equipments";
                        operate.OperationType    = "删除";
                        operate.OperationDataID  = Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]);
                        op.Insert(operate);
                    }
                    InitData();
                    btnSelect_All.Text = "全选";
                    Alert.ShowInTop("您的数据已提交,请等待确认!");
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
Exemplo n.º 10
0
 //删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         List <int> selections = publicmethod.GridCount(GridEduExperience, CBoxSelect);
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             for (int i = 0; i < selections.Count(); i++)
             {
                 bllEdu.Delete(Convert.ToInt32(GridEduExperience.DataKeys[selections[i]][0]));
             }
             BindData();
             btnSelect_All.Text = "全选";
             Alert.ShowInTop("删除数据成功!");
         }
         else
         {
             for (int i = 0; i < selections.Count(); i++)
             {
                 bllEdu.UpdateIsPass(Convert.ToInt32(GridEduExperience.DataKeys[selections[i]][0]), false);
                 //向操作日志表中插入
                 OperationLog operate = new OperationLog();
                 operate.LoginName        = bllUser.FindByLoginName(Session["LoginName"].ToString()).UserName;
                 operate.LoginIP          = "";
                 operate.OperationType    = "删除";
                 operate.OperationContent = "EduExperience";
                 operate.OperationDataID  = Convert.ToInt32(GridEduExperience.DataKeys[selections[i]][0]);
                 operate.OperationTime    = System.DateTime.Now;
                 operate.Remark           = "";
                 bllOperate.Insert(operate);
             }
             btnSelect_All.Text = "全选";
             Alert.ShowInTop("您的操作已提交,请等待审核!");
             BindData();
         }
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Exemplo n.º 11
0
        protected void btn_Delete_Click(object sender, EventArgs e)
        {
            OperationLog op      = new OperationLog();
            List <int>   checkid = pm.GridCount(gd_UnitAPeople, CBoxSelect);

            for (int i = 0; i < checkid.Count; i++)
            {
                int id = checkid[i];
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    blfund.Delete(Convert.ToInt32(gd_UnitAPeople.DataKeys[id][0].ToString()));
                }
                else
                {
                    op.LoginIP          = " ";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "FundInformation";
                    op.OperationDataID  = Convert.ToInt32(gd_UnitAPeople.DataKeys[id][0].ToString());
                    op.OperationTime    = DateTime.Now;
                    op.OperationType    = "删除";
                    blop.Insert(op);
                    blfund.UpdateIsPass(Convert.ToInt32(gd_UnitAPeople.DataKeys[id][0].ToString()), false);
                }
            }
            DataGrid();

            if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
            {
                Alert.ShowInTop("删除成功!");
            }
            else
            {
                Alert.ShowInTop("您的操作已经提交,请等待管理员确认!");
            }
            btn_Delete.Enabled = false;
        }
Exemplo n.º 12
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);
            }
        }
Exemplo n.º 13
0
        //删除借阅记录
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                int m;
                //取整数(不是四舍五入,全舍)
                int        Pages      = (int)Math.Floor(Convert.ToDouble(Grid_LibraryRecord_Pact.RecordCount / this.Grid_LibraryRecord_Pact.PageSize));
                List <int> selections = new List <int>();
                if (Grid_LibraryRecord_Pact.PageIndex == Pages)
                {
                    m = (Grid_LibraryRecord_Pact.RecordCount - this.Grid_LibraryRecord_Pact.PageSize * Grid_LibraryRecord_Pact.PageIndex);
                }
                else
                {
                    m = this.Grid_LibraryRecord_Pact.PageSize;
                }
                for (int i = 0; i < m; i++)
                {
                    if (BoxSelect_PactRecord.GetCheckedState(i))
                    {
                        selections.Add(i);
                    }
                }

                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        BLLLibraryRecord.Delete(Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0].ToString()));
                    }
                    //刷新
                    btnDelete.Enabled = false;
                    DropDownListPact.SelectedValue    = "0";
                    Grid_LibraryRecord_Pact.PageIndex = 0;
                    Grid_LibraryRecord_Pact.PageSize  = 20;
                    BindData();
                    Alert.ShowInTop("删除数据成功!");
                }
                else
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        BLLPact.UpdateIsPass(Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0]), false);
                        operate.LoginName        = Session["LoginName"].ToString();
                        operate.OperationTime    = DateTime.Now;
                        operate.LoginIP          = " ";
                        operate.OperationContent = "Pact";
                        operate.OperationType    = "删除";
                        operate.OperationDataID  = Convert.ToInt32(Grid_LibraryRecord_Pact.DataKeys[selections[i]][0]);
                        op.Insert(operate);
                    }
                    //刷新
                    btnDelete.Enabled = false;
                    DropDownListPact.SelectedValue    = "0";
                    Grid_LibraryRecord_Pact.PageIndex = 0;
                    Grid_LibraryRecord_Pact.PageSize  = 20;
                    BindData();
                    Alert.ShowInTop("操作已经提交,请等待管理员确认!");
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Exemplo n.º 14
0
        //保存机构信息
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (AgencyName2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构名称不能为空!");
                    AgencyName2.Text = "";
                    return;
                }
                if (AgencyHeads2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构负责人不能为空!");
                    AgencyHeads2.Text = "";
                    return;
                }
                if (FullTimeNumber2.Text.Trim() == "")
                {
                    Alert.ShowInTop("专职人数不能为空!");
                    FullTimeNumber2.Text = "";
                    return;
                }
                Common.Entities.Agency       ag   = new Common.Entities.Agency();
                Common.Entities.OperationLog op   = new Common.Entities.OperationLog();
                BLHelper.BLLOperationLog     blop = new BLHelper.BLLOperationLog();
                BLHelper.BLLUser             user = new BLHelper.BLLUser();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

                ag.AgencyName      = AgencyName2.Text.ToString();
                ag.ParentID        = agen.SelectAgencyID(ParentID2.Text.ToString());
                ag.SecrecyLevel    = Convert.ToInt32(DroSecrecyLevel.SelectedIndex + 1);
                ag.AgencyHeads     = AgencyHeads2.Text.ToString();
                ag.Research        = Research2.Text.ToString();
                ag.AgencyNumber    = DroAgencyNumber.SelectedText;
                ag.FullTimeNumbers = Convert.ToInt32(FullTimeNumber2.Text.ToString());
                ag.PartTimeNumbers = Convert.ToInt32(PartTimeNumber2.Text.ToString());
                ag.Area            = Area2.Text.ToString();
                ag.IsGlobal        = ddl_glo.SelectedText.Trim();
                ag.Location        = Location2.Text.ToString();
                ag.EntryPerson     = username;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    ag.IsPass = true;
                    agen.Insert(ag);
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("保存成功") + Alert.GetShowInTopReference("保存成功"));
                }
                else
                {
                    ag.IsPass = false;
                    agen.Insert(ag);
                    op.LoginIP          = "";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "Agency";
                    op.OperationDataID  = agen.SelectAgencyID(AgencyName2.Text.Trim().ToString());
                    op.OperationType    = "添加";
                    op.OperationTime    = DateTime.Now;
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("您的操作已经提交,请等待管理员确认!"));
                }
            }

            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
Exemplo n.º 15
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);
            }
        }
Exemplo n.º 16
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);
     }
 }
Exemplo n.º 17
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);
     }
 }
Exemplo n.º 18
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);
            }
        }
Exemplo n.º 19
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);
            }
        }
Exemplo n.º 20
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);
            }
        }
Exemplo n.º 21
0
        //删除获奖信息
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            //如果为超级管理员操作则直接删除,否则将IsPass置为false 向管理员发送删除信息
            try
            {
                int m;
                //取整数(不是四舍五入,全舍)
                int Pages = (int)Math.Floor(Convert.ToDouble(Grid_Award.RecordCount / this.Grid_Award.PageSize));

                if (Grid_Award.PageIndex == Pages)
                {
                    m = (Grid_Award.RecordCount - this.Grid_Award.PageSize * Grid_Award.PageIndex);
                }
                else
                {
                    m = this.Grid_Award.PageSize;
                }
                List <int> selections = new List <int>();
                for (int i = 0; i < m; i++)
                {
                    if (CBoxSelect.GetCheckedState(i))
                    {
                        selections.Add(i);
                    }
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        int AcademicMeetingID = Convert.ToInt32(Grid_Award.DataKeys[selections[i]][0].ToString());

                        //删除获奖附件文件->删除附件表中的信息->删除学术会议信息
                        int    AttactID = award.FindAttachmentID(AcademicMeetingID);
                        string strPath;
                        if (AttactID != 0)
                        {
                            strPath = BLLAttachment.FindPath(AttactID);
                            if (strPath != "")
                            {
                                //删除附件文件
                                pm.DeleteFile(AttactID, strPath);
                                //在附件表中删除附件数据
                                BLLAttachment.Delete(AttactID);
                            }
                        }
                        //删除获奖信息
                        award.Delete(Convert.ToInt32(Grid_Award.DataKeys[selections[i]][0].ToString()));
                    }
                    Alert.ShowInTop("删除成功!");
                    btnSelect_All.Text = "全选";
                }
                else
                {
                    //录入人(非管理员)操作
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        award.UpdateIsPass(Convert.ToInt32(Grid_Award.DataKeys[selections[i]][0]), false);
                        //BLLUser.FindByLoginName(Session["LoginName"].ToString()).UserName
                        operate.LoginName        = Session["LoginName"].ToString();
                        operate.OperationTime    = DateTime.Now;
                        operate.LoginIP          = " ";
                        operate.OperationContent = "Award";
                        operate.OperationType    = "删除";
                        operate.OperationDataID  = Convert.ToInt32(Grid_Award.DataKeys[selections[i]][0]);
                        op.Insert(operate);
                        //BindData();
                        Alert.ShowInTop("操作已经提交,请等待管理员确认!");
                    }
                }
                Grid_Award.PageIndex = 0;
                Grid_Award.PageSize  = 20;
                btnDelete.Enabled    = false;
                InitData();
                btnSelect_All.Text = "全选";
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
                return;
            }
        }
Exemplo n.º 22
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);
            }
        }
Exemplo n.º 23
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);
            }
        }
Exemplo n.º 24
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);
            }
        }
Exemplo n.º 25
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);
            }
        }
Exemplo n.º 26
0
        //删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            List <int> selections = new List <int>();

            for (int i = 0; i < Grid_Pact.RecordCount; i++)
            {
                if (BoxSelect_Pact.GetCheckedState(i))
                {
                    selections.Add(i);
                }
            }
            if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
            {
                for (int i = 0; i < selections.Count(); i++)
                {
                    int PactID = Convert.ToInt32(Grid_Pact.DataKeys[selections[i]][0].ToString());
                    //删除资料附件
                    int    AttactID = BLLPact.FindAttachmentID(PactID);
                    string strPath;
                    if (AttactID != 0)
                    {
                        strPath = BLLAttachment.FindPath(AttactID);
                        if (strPath != "")
                        {
                            //在附件表中删除附件数据
                            BLLAttachment.Delete(AttactID);
                            //删除附件文件
                            publicMethod.DeleteFile(AttactID, strPath);
                        }
                    }
                    //删除该合同的借阅记录
                    List <int> listRecordID = BLLLibraryRecord.FindLibraryID(PactID, "合同");
                    if (listRecordID != null)
                    {
                        for (int j = 0; j < listRecordID.Count(); j++)
                        {
                            BLLLibraryRecord.Delete(listRecordID[j]);
                        }
                    }
                    //合同表删除
                    BLLPact.Delete(Convert.ToInt32(Grid_Pact.DataKeys[selections[i]][0].ToString()));
                }
                Alert.ShowInTop("删除数据成功!");

                btnSelect_All.Text = "全选";
            }
            else
            {
                for (int i = 0; i < selections.Count(); i++)
                {
                    BLLPact.UpdateIsPass(Convert.ToInt32(Grid_Pact.DataKeys[selections[i]][0]), false);
                    //将借阅记录表中与该资料有关的数据置为false
                    List <int> listRecordID = BLLLibraryRecord.FindLibraryID(Convert.ToInt32(Grid_Pact.DataKeys[selections[i]][0]), "合同");
                    for (int j = 0; j < listRecordID.Count(); i++)
                    {
                        BLLLibraryRecord.UpdateIsPass(listRecordID[j], false);
                    }
                    operate.LoginName        = Session["LoginName"].ToString();
                    operate.OperationTime    = DateTime.Now;
                    operate.LoginIP          = " ";
                    operate.OperationContent = "Pact";
                    operate.OperationType    = "删除";
                    operate.OperationDataID  = Convert.ToInt32(Grid_Pact.DataKeys[selections[i]][0]);
                    op.Insert(operate);
                }
                Alert.ShowInTop("操作已经提交,请等待管理员确认!");
                btnSelect_All.Text = "全选";
            }
            btnDelete.Enabled   = false;
            Grid_Pact.PageIndex = 0;
            Grid_Pact.PageSize  = 20;
            BindData();
        }
Exemplo n.º 27
0
        //删除
        protected void btnDeleteReport_Click(object sender, EventArgs e)
        {
            try
            {
                int m;
                //取整数(不是四舍五入,全舍)
                int Pages = (int)Math.Floor(Convert.ToDouble(Grid_ReportInfo.RecordCount / this.Grid_ReportInfo.PageSize));

                if (Grid_ReportInfo.PageIndex == Pages)
                {
                    m = (Grid_ReportInfo.RecordCount - this.Grid_ReportInfo.PageSize * Grid_ReportInfo.PageIndex);
                }
                else
                {
                    m = this.Grid_ReportInfo.PageSize;
                }
                List <int> selections = new List <int>();
                for (int i = 0; i < m; i++)
                {
                    if (CBoxSelect_Report.GetCheckedState(i))
                    {
                        selections.Add(i);
                    }
                }
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        int?attachid = BLLReport.Delete(Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0].ToString()));
                        if (attachid != 0 && attachid != null)
                        {//删除附件
                            //在附件表中删除学术报告附件
                            BLLAttachment.Delete(Convert.ToInt32(attachid));
                            //删除附件文件
                            string path = BLLAttachment.FindPath(Convert.ToInt32(attachid));
                            if (path != "")
                            {
                                publicMethod.DeleteFile(Convert.ToInt32(attachid), path);
                            }
                        }
                    }
                    Grid_ReportInfo.PageIndex         = 0;
                    Grid_ReportInfo.PageSize          = 20;
                    btnDeleteReport.Enabled           = false;
                    DropDownList_Agency.SelectedValue = "0";
                    BindReport();
                    Alert.ShowInTop("删除成功!");
                }
                else
                {
                    for (int i = 0; i < selections.Count(); i++)
                    {
                        BLLReport.ChangePass(Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0]), false);
                        //向操作日志表插入信息
                        Common.Entities.OperationLog operationLog = new Common.Entities.OperationLog();
                        operationLog.LoginIP          = " ";
                        operationLog.LoginName        = Session["LoginName"].ToString();
                        operationLog.OperationType    = "删除";
                        operationLog.OperationContent = "ScienceReport";
                        operationLog.OperationTime    = DateTime.Now;
                        operationLog.OperationDataID  = Convert.ToInt32(Grid_ReportInfo.DataKeys[selections[i]][0]);
                        BLLOP.Insert(operationLog);
                    }
                    btnDeleteReport.Enabled           = false;
                    DropDownList_Agency.SelectedValue = "0";
                    Grid_ReportInfo.PageIndex         = 0;
                    Grid_ReportInfo.PageSize          = 20;
                    BindReport();
                    Alert.ShowInTop("您的数据已提交,请等待确认!");
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
                return;
            }
        }
Exemplo n.º 28
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);
            }
        }
Exemplo 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("保存成功!"));
        }
Exemplo n.º 30
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);
            }
        }