/// <summary> /// SaveSurveyedObj /// </summary> private void SaveSurveyedObj() { string SurveyId = RequestData.Get("SurveyId") + ""; //first delete string sql = " delete from FL_Culture..SurveyedObj where SurveyId='{0}' ;"; sql += " delete from FL_Culture..SurveyReaderObj where SurveyId='{0}' ;"; sql = string.Format(sql, SurveyId); DataHelper.ExecSql(sql); string OrgIds = RequestData.Get("OrgIds") + ""; string OrgNames = RequestData.Get("OrgNames") + ""; string PostionIds = RequestData.Get("PostionIds") + ""; string PostionNames = RequestData.Get("PostionNames") + ""; string BornAddr = RequestData.Get("BornAddr") + ""; string StartWorkTime = RequestData.Get("StartWorkTime") + ""; string UntileWorkTime = RequestData.Get("UntileWorkTime") + ""; string Sex = RequestData.Get("Sex") + ""; string StartAge = RequestData.Get("StartAge") + ""; string EndAge = RequestData.Get("EndAge") + ""; string WorkAge = RequestData.Get("WorkAge") + ""; string Major = RequestData.Get("Major") + ""; string PersonType = RequestData.Get("PersonType") + ""; string PositionDegree1 = RequestData.Get("PositionDegree1") + ""; string PositionDegree0 = RequestData.Get("PositionDegree0") + ""; string CruxPositon = RequestData.Get("CruxPositon") + ""; //关键岗位 string PositionSeq = RequestData.Get("PositionSeq") + ""; //岗位序列 SurveyedObj Ent = new SurveyedObj(); Ent.SurveyId = SurveyId; //* Ent.OrgIds = OrgIds; Ent.OrgNames = OrgNames; Ent.PostionIds = PostionIds; Ent.PostionNames = PostionNames; Ent.Sex = Sex; Ent.WorkAge = WorkAge; if (!string.IsNullOrEmpty(StartWorkTime)) { Ent.StartWorkTime = DateTime.Parse(StartWorkTime); } if (!string.IsNullOrEmpty(UntileWorkTime)) { Ent.UntileWorkTime = DateTime.Parse(UntileWorkTime); } if (!string.IsNullOrEmpty(CruxPositon)) { Ent.CruxPositon = CruxPositon; } if (!string.IsNullOrEmpty(PositionSeq)) { Ent.PositionSeq = PositionSeq; //岗位序列 } Ent.Major = Major; //学历 Ent.PersonType = PersonType; Ent.BornAddr = BornAddr; //年龄范围 if (!string.IsNullOrEmpty(StartAge)) { Ent.StartAge = DateTime.Parse(StartAge); } if (!string.IsNullOrEmpty(EndAge)) { Ent.EndAge = DateTime.Parse(EndAge); } //StartAge EndAge(年龄范围) BornAddr 籍贯 Ent.PositionDegree0 = PositionDegree0; Ent.PositionDegree1 = PositionDegree1; Ent.DoCreate(); SurveyQuestion SEnt = SurveyQuestion.Find(SurveyId); string ReadObj = SEnt.ReaderObj; if (ReadObj.Contains("joiner")) { ReadObj = "joiner"; } else { ReadObj = "sender"; } SurveyReaderObj ReadEnt = new SurveyReaderObj(); ReadEnt.SurveyId = SurveyId; ReadEnt.ReaderWay = ReadObj; ReadEnt.DoCreate(); this.PageState.Add("State", "1"); }
//string sql = @" select * from FL_Culture..QuestionAnswerItem where SurveyId='{0}' and QuestionItemId='{1}' order by SortIndex "; // sql = string.Format(sql, SurveyId, QuestionItemId); // this.PageState.Add("DataList", DataHelper.QueryDictList(sql)); /// <summary> /// 问卷保存 /// </summary> private void SurveyOneSave() { string SurveyId = RequestData.Get("SurveyId") + ""; string SurveyTypeId = RequestData.Get("SurveyTypeId") + ""; string SurveyTypeName = RequestData.Get("SurveyTypeName") + ""; string NoticeWay = RequestData.Get("NoticeWay") + ""; string TypeCode = RequestData.Get("TypeCode") + ""; string SurveyTitile = RequestData.Get("SurveyTitile") + ""; string Description = RequestData.Get("Description") + ""; string StartTime = RequestData.Get("StartTime") + ""; string EndTime = RequestData.Get("EndTime") + ""; string CompanyName = RequestData.Get("CompanyName") + ""; string CompanyId = RequestData.Get("CompanyId") + ""; string DeptName = RequestData.Get("DeptName") + ""; string DeptId = RequestData.Get("DeptId") + ""; string AddFilesName = RequestData.Get("AddFilesName") + ""; string Score = RequestData.Get("Score") + ""; string SetTimeout = RequestData.Get("SetTimeout") + ""; string ReaderObj = RequestData.Get("ReaderObj") + ""; string RemindWay = RequestData.Get("RemindWay") + ""; //提醒方式 string RecyleDay = RequestData.Get("RecyleDay") + ""; //提醒天数 string TimePoint = RequestData.Get("TimePoint") + ""; //提醒时间点 SurveyQuestion ent = SurveyQuestion.Find(SurveyId); if (string.IsNullOrEmpty(ent.State)) { ent.State = "0"; //"0" 表示创建 } ent.SurveyTypeId = SurveyTypeId; ent.SurveyTypeName = SurveyTypeName; ent.NoticeWay = NoticeWay; ent.TypeCode = TypeCode; ent.SurveyTitile = SurveyTitile; ent.Description = Description; if (!string.IsNullOrEmpty(StartTime)) { ent.StartTime = DateTime.Parse(StartTime); } if (!string.IsNullOrEmpty(EndTime)) { ent.EndTime = DateTime.Parse(EndTime); } if (!string.IsNullOrEmpty(TimePoint)) { ent.TimePoint = TimePoint; } if (!string.IsNullOrEmpty(RecyleDay)) { ent.RecyleDay = int.Parse(RecyleDay); } if (!string.IsNullOrEmpty(CompanyName)) { ent.CompanyName = CompanyName; } if (!string.IsNullOrEmpty(CompanyId)) { ent.CompanyId = CompanyId; } ent.DeptName = DeptName; ent.DeptId = DeptId; ent.AddFilesName = AddFilesName; ent.RemindWay = RemindWay; if (!string.IsNullOrEmpty(Score)) { ent.Score = int.Parse(Score); } if (!string.IsNullOrEmpty(SetTimeout)) { ent.SetTimeout = DateTime.Parse(SetTimeout); } ent.ReaderObj = ReaderObj; ent.DoUpdate(); string sql = " delete from FL_Culture..SurveyReaderObj where SurveyId='{0}' ;"; sql = string.Format(sql, SurveyId); DataHelper.ExecSql(sql); string ReadObj = ent.ReaderObj; if (ReadObj.Contains("joiner")) { ReadObj = "joiner"; } else { ReadObj = "sender"; } SurveyReaderObj ReadEnt = new SurveyReaderObj(); ReadEnt.SurveyId = SurveyId; ReadEnt.ReaderWay = ReadObj; ReadEnt.DoCreate(); }
string type = String.Empty; // 对象类型 protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); SurveyId = RequestData.Get <string>("SurveyId"); type = RequestData.Get <string>("type"); string AllowUser = RequestData.Get("AllowUser") + ""; // 允许人员 string NoAllowUser = RequestData.Get("NoAllowUser") + ""; // 排除人员 SurveyReaderObj ent = null; switch (this.RequestAction) { case RequestActionEnum.Update: ent = this.GetMergedData <SurveyReaderObj>(); if (!string.IsNullOrEmpty(AllowUser)) { ent.AllowUser = AllowUser; } if (!string.IsNullOrEmpty(NoAllowUser)) { ent.NoAllowUser = NoAllowUser; } ent.DoUpdate(); break; case RequestActionEnum.Insert: case RequestActionEnum.Create: ent = this.GetPostedData <SurveyReaderObj>(); if (!string.IsNullOrEmpty(AllowUser)) { ent.AllowUser = AllowUser; } if (!string.IsNullOrEmpty(NoAllowUser)) { ent.NoAllowUser = NoAllowUser; } ent.DoCreate(); this.PageState.Add("Id", ent.Id); //回写ID break; case RequestActionEnum.Delete: ent = this.GetTargetData <SurveyReaderObj>(); ent.DoDelete(); break; } if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(SurveyId)) { ent = SurveyReaderObj.FindFirstByProperties(SurveyedObj.Prop_SurveyId, SurveyId); if (ent != null) { this.PageState.Add("DataList", ent.AllowUser); this.PageState.Add("DataList1", ent.NoAllowUser); } } this.SetFormData(ent); } }