private void Create() { string Id = Request["Id"]; Project pEnt = Project.Find(Id); IList <ProjectUser> puEnts = ProjectUser.FindAllByProperty(ProjectUser.Prop_ProjectId, Id); pEnt.Status = "已下达"; pEnt.DoUpdate(); foreach (ProjectUser puEnt in puEnts) { ExamineTask etEnt = new ExamineTask(); etEnt.ProjectId = Id; etEnt.ProjectUserId = puEnt.Id;//str ProjectUser 的主键 etEnt.MajorName = puEnt.MajorName; etEnt.PlanBackTime = Convert.ToDateTime(Request["BackTime"]); etEnt.State = "未结束"; etEnt.CreateId = WebPortalService.CurrentUserInfo.UserID; etEnt.CreateName = WebPortalService.CurrentUserInfo.UserID; etEnt.CreateTime = DateTime.Now; etEnt.DoCreate(); Expert eEnt = Expert.Find(puEnt.UserId); //发送邮件 try { //string url = "http://192.168.15.81:7007/ConsultationManage/ExamineOpinionEdit.aspx?ExamineTaskId=" + etEnt.Id; //PhoneMessage.SendWebMail("*****@*****.**", eEnt.Email, "审查任务", "项目名称:【" + pEnt.ProjectName + "】 专业:" + eEnt.MajorName + ",填写审查意见请点击此链接:" + url, "fpxt", "000000", "mail.nerin.com"); } catch (Exception ex) { } } }
private void SelectEdit() { if (!string.IsNullOrEmpty(Id)) { string data = JsonHelper.GetJsonString(Expert.Find(Id)); string sa = "{success: true ,data:" + data + "}"; Response.Write(sa); Response.End(); } }
private void Update() { string obj = Request["data"]; string ProfessionType = Request["ProfessionType"]; string MajorName = Request["MajorName"]; ent = JsonHelper.GetObject <Expert>(obj); Expert ori_Ent = Expert.Find(ent.Id); EasyDictionary dic = JsonHelper.GetObject <EasyDictionary>(obj); ent = DataHelper.MergeData <Expert>(ori_Ent, ent, dic.Keys); ent.MajorCode = MajorName; ent.MajorName = MajorName; ent.ProfessionType = ProfessionType; ent.DoUpdate(); }
private void DoProfessionType() { sql = "select * from NCRL_Portal..SysEnumeration where PATH LIKE '%c2d9fcd4-82ad-4007-a0f5-76162ee51cd4%'"; dt = DataHelper.QueryDataTable(sql); string str = JsonHelper.GetJsonString(dt); if (!string.IsNullOrEmpty(Id)) { ent = Expert.Find(Id); Response.Write("{success: true ,ProfessionType:'" + ent.ProfessionType + "',rows:" + str + "}"); Response.End(); return; } Response.Write("{success: true ,ProfessionType:'',rows:" + str + "}"); Response.End(); }
private void MajorName() { sql = "select * from NCRL_Portal..SysEnumeration where path like '%b640c40c-e2a9-41a8-bd28-d8ff9d71ff94%'"; dt = DataHelper.QueryDataTable(sql); string str = JsonHelper.GetJsonString(dt); if (!string.IsNullOrEmpty(Id)) { ent = Expert.Find(Id); Response.Write("{success: true ,MajorName:'" + ent.MajorName + "',rows:" + str + "}"); Response.End(); return; } Response.Write("{success:true,MajorName:'',rows:" + str + "}"); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { try { Aim.Portal.Web.WebPortalService.CheckLogon(); } catch { Response.Write("<script> window.parent.location.href = '/Login.aspx';</script>"); Response.End(); } string action = Request["action"]; Id = Request["Id"]; if (!string.IsNullOrEmpty(action)) { switch (action) { case "ProfessionType": DoProfessionType(); break; case "MajorName": sql = "select * from NCRL_Portal..SysEnumeration where ParentID = 'b640c40c-e2a9-41a8-bd28-d8ff9d71ff94' order by sortindex asc"; dt = DataHelper.QueryDataTable(sql); string str = JsonHelper.GetJsonString(dt); if (!string.IsNullOrEmpty(Id)) { ent = Expert.Find(Id); Response.Write("{success: true ,MajorName:'" + ent.MajorName + "',rows:" + str + "}"); Response.End(); return; } Response.Write("{success:true,MajorName:'',rows:" + str + "}"); Response.End(); break; case "RCStore": RCStore(); break; case "Create": string obj = Request["data"]; string ProfessionType = Request["ProfessionType"]; string MajorName = Request["MajorName"]; ent = JsonHelper.GetObject <Expert>(obj); ent.MajorCode = MajorName; ent.MajorName = MajorName; ent.ProfessionType = ProfessionType; sql = "select max(SortIndex) from NCRL_SP..Expert"; ent.SortIndex = DataHelper.QueryValue <int>(sql) + 1; ent.DoCreate(); break; case "Update": Update(); break; case "SelectEdit": SelectEdit(); break; } } }
protected void Page_Load(object sender, EventArgs e) { try { Aim.Portal.Web.WebPortalService.CheckLogon(); } catch { Response.Write("<script> window.parent.location.href = '/Login.aspx';</script>"); Response.End(); } string action = Request["action"]; switch (action) { case "DoSelect": DoSelect(); break; case "Delete": Delete(); break; case "loadmajor": sql = "select name from NCRL_Portal..SysEnumeration where ParentID = 'b640c40c-e2a9-41a8-bd28-d8ff9d71ff94' order by sortindex asc"; dt = DataHelper.QueryDataTable(sql); string str = JsonHelper.GetJsonString(dt); Response.Write("{rows:" + str + "}"); Response.End(); break; case "upsortindex": expertEnt = JsonHelper.GetObject <Expert>(Request["expert"]); sql = @"select top 1 Id from NCRL_SP..Expert where SortIndex= (select max(SortIndex) from (select * from NCRL_SP..Expert where SortIndex <{0}) t )"; sql = string.Format(sql, expertEnt.SortIndex); dics = DataHelper.QueryDictList(sql); if (dics.Count > 0) //如果有比他靠前的领导 2比3靠前 { Expert tempEnt = Expert.Find(dics[0].Get <string>("Id")); int? temp = tempEnt.SortIndex; tempEnt.SortIndex = expertEnt.SortIndex; tempEnt.DoUpdate(); expertEnt.SortIndex = temp; expertEnt.DoUpdate(); } break; case "downsortindex": expertEnt = JsonHelper.GetObject <Expert>(Request["expert"]); sql = @"select top 1 Id from NCRL_SP..Expert where SortIndex= (select min(SortIndex) from (select * from NCRL_SP..Expert where SortIndex >{0}) t )"; sql = string.Format(sql, expertEnt.SortIndex); dics = DataHelper.QueryDictList(sql); if (dics.Count > 0) { Expert tempEnt = Expert.Find(dics[0].Get <string>("Id")); int? temp = tempEnt.SortIndex; tempEnt.SortIndex = expertEnt.SortIndex; tempEnt.DoUpdate(); expertEnt.SortIndex = temp; expertEnt.DoUpdate(); } break; case "updatesortindex": expertEnt = Expert.Find(Request["id"]); expertEnt.SortIndex = Convert.ToInt32(Request["sortindex"]); expertEnt.DoUpdate(); break; } }