protected void btnBatDeny_Click(object sender, EventArgs e) { DataClassesDataContext dc = new DataClassesDataContext(); List <String> ids = GetSelectedIDs(); String F_ID = Session[SessionMgm.UserID].ToString(); String denyComment = dc.User.SingleOrDefault(_user => _user.F_ID.Equals("F_ID")).F_denyComment; var records = dc.SocialProject.Where(_sci => ids.Contains(_sci.F_ID)); foreach (SocialProject project in records) { project.F_status = ProjectStatus.Deny; RemoveHistoricalOpinion(project.F_ID, RoleType.EduAdmin); AuditOpinion opinion = new AuditOpinion(); opinion.F_projectID = project.F_ID; opinion.F_ID = Guid.NewGuid().ToString(); opinion.F_content = denyComment; opinion.F_date = DateTime.Now; opinion.F_type = RoleType.EduAdmin; opinion.F_result = "审核不通过"; dc.AuditOpinion.InsertOnSubmit(opinion); } dc.SubmitChanges(); GridView1.PageIndex = 0; Response.Redirect("frmSocialProjectList.aspx"); }
public OperationResult Insert(AuditOpinionVM model) { try { AuditOpinion auditOpinion = _AuditOpinionRepository.Entities.FirstOrDefault(c => c.AuditOpinionCode == model.AuditOpinionCode.Trim()); if (auditOpinion != null) { return(new OperationResult(OperationResultType.Warning, "数据库中已经存在相同的审核意见,请修改后重新提交!")); } if (model.AuditOpinionDesp == null || model.AuditOpinionDesp.Trim() == "") { return(new OperationResult(OperationResultType.Warning, "审核意见描述不能为空,请修改后重新提交!")); } var entity = new AuditOpinion { AuditOpinionCode = model.AuditOpinionCode, AuditOpinionDesp = model.AuditOpinionDesp, UpdateDate = DateTime.Now }; _AuditOpinionRepository.Insert(entity); return(new OperationResult(OperationResultType.Success, "新增数据成功!")); } catch { return(new OperationResult(OperationResultType.Error, "新增数据失败,数据库插入数据时发生了错误!")); } }
private void Initial() { DataClassesDataContext dc = new DataClassesDataContext(); ExecuteStatus es = dc.ExecuteStatus.SingleOrDefault(ess => ess.F_projectID.Equals(projectID)); txtUnitComment.Text = es.F_unitComment; if (es.F_unitCheckDate != null) { txtUnitCheckDate.Text = es.F_unitCheckDate.Value.ToShortDateString(); } AuditOpinion ao = AuditOperation.GetAudit(projectID, RoleType.SchoolAdmin); if (ao != null) { radScho.SelectedValue = ao.F_result; } txtCompleteStatus.Text = es.F_completeStatus; txtProblem.Text = es.F_problem; if (es.F_checkDate != null) { txtCheckDate.Text = es.F_checkDate.Value.ToShortDateString(); } txtCheckPerson.Text = es.F_checkPerson; if (es.F_eduConfirmDate != null) { txtEduConfirmDate.Text = es.F_eduConfirmDate.Value.ToShortDateString(); } ao = AuditOperation.GetAudit(projectID, RoleType.EduAdmin); if (ao != null) { radEdu.SelectedValue = ao.F_result; } txtPlan.Text = es.F_plan; ddlEvaluation.SelectedValue = es.F_selfEvaluation; }
public static AuditOpinion GetAudit(string projectID, string roleType) { DataClassesDataContext dc = new DataClassesDataContext(); AuditOpinion audit = dc.AuditOpinion.SingleOrDefault(ao => ao.F_projectID.Equals(projectID) && ao.F_type.Equals(roleType)); return(audit); }
protected void btnTeam_Click(object sender, EventArgs e) { if (Session[SessionMgm.Role].Equals(RoleType.SchoolAdmin) == false) { UtilHelper.AlertInUpdatePanel(UpdatePanel1, this.GetType(), "没有权限"); return; } DataClassesDataContext dc = new DataClassesDataContext(); DateTime dt = DateTime.Now; RemoveHistoricalOpinion(F_ID, RoleType.TeamAdmin); EducationV2.ScienceProject socialProject = dc.ScienceProject.Single(c => c.F_ID.Equals(F_ID)); AuditOpinion opinion = new AuditOpinion(); opinion.F_projectID = F_ID; opinion.F_ID = Guid.NewGuid().ToString(); opinion.F_content = txtTeam.Text; DateTime.TryParse(dateTeam.Text, out dt); opinion.F_date = dt; opinion.F_result = radTeam.SelectedValue; opinion.F_type = RoleType.TeamAdmin; dc.AuditOpinion.InsertOnSubmit(opinion); if (opinion.F_result.Equals("审核不通过")) { socialProject.F_status = ProjectStatus.Deny; } dc.SubmitChanges(); Response.Redirect("frmSciProject.aspx?tabNum=10&id=" + F_ID); }
// public dynamic GetModel(int Id) { try { dynamic model = null; StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 Id,FK_WebUserVeriId,CheckName,CheckOpinion,OpinionDate from T_AuditOpinion "); strSql.Append(" where Id=@Id"); SqlParameter[] parameters = { new SqlParameter("@Id", SqlDbType.Int, 4) }; parameters[0].Value = Id; using (dynamic read = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters)) { if (read.Read()) { model = new AuditOpinion(); try { model.Id = int.Parse(read["Id"].ToString()); } catch { } try { model.FK_WebUserVeriId = int.Parse(read["FK_WebUserVeriId"].ToString()); } catch { } model.CheckName = read["CheckName"].ToString(); model.CheckOpinion = read["CheckOpinion"].ToString(); try { model.OpinionDate = DateTime.Parse(read["OpinionDate"].ToString()); } catch { } } read.Dispose(); } return(model); } catch { throw; } }
protected void EduBtn_Click(object sender, EventArgs e) { if (Session[SessionMgm.Role].Equals(RoleType.EduAdmin) == false) { UtilHelper.AlertInUpdatePanel(UpdatePanel1, this.GetType(), "没有权限"); return; } DataClassesDataContext dc = new DataClassesDataContext(); DateTime dt = DateTime.Now; RemoveHistoricalOpinion(F_ID, RoleType.EduAdmin); EducationV2.ScienceProject sciProject = dc.ScienceProject.Single(c => c.F_ID.Equals(F_ID)); AuditOpinion opinion = new AuditOpinion(); opinion.F_projectID = F_ID; opinion.F_ID = Guid.NewGuid().ToString(); opinion.F_content = EduContent.Text; DateTime.TryParse(EduDate.Text, out dt); opinion.F_date = dt; opinion.F_type = RoleType.EduAdmin; opinion.F_result = EduResult.SelectedValue; dc.AuditOpinion.InsertOnSubmit(opinion); if (opinion.F_result.Equals("审核不通过")) { sciProject.F_status = ProjectStatus.Deny; } else { sciProject.F_status = ProjectStatus.Pass; //if (sciProject.F_applicantDate != null) // sciProject.F_code = Services.SciProject.GetCode(sciProject.F_type, sciProject.F_applicantDate.Value.Year.ToString()); } dc.SubmitChanges(); Response.Redirect("frmSciProject.aspx?tabNum=10&id=" + F_ID); }
public OperationResult Delete(AuditOpinion model) { try { model.UpdateDate = DateTime.Now; _AuditOpinionRepository.Delete(model); return(new OperationResult(OperationResultType.Success, "更新审核意见数据成功!")); } catch { return(new OperationResult(OperationResultType.Error, "更新审核意见数据失败!")); } }
private dynamic GetModels(HttpContext context) { dynamic model = new AuditOpinion(); try { model.FK_WebUserVeriId = int.Parse(context.Request.QueryString["WebUserVeriId"].ToString()); } catch { } model.CheckOpinion = context.Request.QueryString["CheckOpinion"].ToString(); model.OpinionDate = DateTime.Now; model.CheckName = adminUser.AdminName; try { model.Id = int.Parse(context.Request.QueryString["Id"].ToString()); } catch { model.Id = 0; } return(model); }
public OperationResult Update(AuditOpinionVM model) { try { AuditOpinion auditOpinion = _AuditOpinionRepository.Entities.FirstOrDefault(c => c.AuditOpinionCode == model.AuditOpinionCode.Trim()); if (auditOpinion == null) { throw new Exception(); } auditOpinion.AuditOpinionDesp = model.AuditOpinionDesp; auditOpinion.AuditOpinionCode = model.AuditOpinionCode; auditOpinion.UpdateDate = DateTime.Now; _AuditOpinionRepository.Update(auditOpinion); return(new OperationResult(OperationResultType.Success, "更新数据成功!")); } catch { return(new OperationResult(OperationResultType.Error, "更新数据失败!")); } }
// public bool Create(AuditOpinion model) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_AuditOpinion("); strSql.Append("FK_WebUserVeriId,CheckName,CheckOpinion,OpinionDate)"); strSql.Append(" values ("); strSql.Append("@FK_WebUserVeriId,@CheckName,@CheckOpinion,@OpinionDate)"); if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) { return(true); } else { return(false); } } catch { throw; } }
public static void SetAudit(string projectID, string roleType, string auditOption, DateTime dt, String content) { bool isNew = false; DataClassesDataContext dc = new DataClassesDataContext(); AuditOpinion audit = dc.AuditOpinion.SingleOrDefault(ao => ao.F_projectID.Equals(projectID) && ao.F_type.Equals(roleType)); if (audit == null) { audit = new AuditOpinion(); isNew = true; audit.F_ID = Guid.NewGuid().ToString(); audit.F_projectID = projectID; audit.F_type = roleType; } audit.F_result = auditOption; audit.F_date = dt; if (isNew) { dc.AuditOpinion.InsertOnSubmit(audit); } dc.SubmitChanges(); }
protected void schoolBtn_Click(object sender, EventArgs e) { if (Session[SessionMgm.Role].Equals(RoleType.SchoolAdmin) == false) { UtilHelper.AlertInUpdatePanel(UpdatePanel1, this.GetType(), "没有权限"); return; } DataClassesDataContext dc = new DataClassesDataContext(); DateTime dt = DateTime.Now; RemoveHistoricalOpinion(F_ID, RoleType.SchoolAdmin); EducationV2.ScienceProject socialProject = dc.ScienceProject.Single(c => c.F_ID.Equals(F_ID)); AuditOpinion opinion = new AuditOpinion(); opinion.F_projectID = F_ID; opinion.F_ID = Guid.NewGuid().ToString(); opinion.F_content = schoolContent.Text; DateTime.TryParse(schoolDate.Text, out dt); opinion.F_date = dt; opinion.F_type = RoleType.SchoolAdmin; if (schoolResult.SelectedValue == "审核通过") { if (EducationV2.Services.AssignProjectService.AvailToApply(socialProject) == false) { UtilHelper.AlertInUpdatePanel(UpdatePanel1, this.GetType(), "可用额度不足,请检查贵单位的授权限额"); return; } socialProject.F_status = ProjectStatus.UnderEducationAudit; } else { socialProject.F_status = ProjectStatus.Deny; } opinion.F_result = schoolResult.SelectedValue; dc.AuditOpinion.InsertOnSubmit(opinion); dc.SubmitChanges(); Response.Redirect("frmSciProject.aspx?tabNum=10&id=" + F_ID); }
// private string Create(HttpContext context) { try { SysLogBll.Create("会员审核意见", "添加会员审核意见操作", adminUser.AdminName); AuditOpinion models = GetModels(context); bool check = false; WebUserVeri wv = new WebUserVeriDal().GetModel(models.FK_WebUserVeriId); switch (wv.MemberTypeId) { case 1: if (!string.IsNullOrEmpty(wv.VeriIDCardScan)) { check = true; } break; case 2: if (!string.IsNullOrEmpty(wv.VeriIDCardScan)) { check = true; } break; case 3: if (!string.IsNullOrEmpty(wv.VeriCorporateIDCardScan) && !string.IsNullOrEmpty(wv.VeriCreditCodeScan)) { check = true; } break; } if (check) { if (dal.Create(models)) { string row = "AuditType"; string values = context.Request.QueryString["AuditType"]; string where = models.FK_WebUserVeriId.ToString(); string value = (values == "0" ? "1" : "0"); if (new WebUserVeriDal().UpdateState(row, value, where)) { return("添加成功,审核成功!"); } else { return("审核失败!"); } } else { return("添加失败请重新操作! "); } } else { return("注册会员的扫描件没有上传无法审核通过,请上传扫描件!"); } } catch (Exception ex) { SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]"); return("添加失败请重新操作,错误代码:500 "); } }