/// <summary> /// 修改学历学位信息 /// </summary> /// <param name="obj"></param> /// <returns></returns> public bool EditEdu(object obj) { A01BLL _aBll = new A01BLL(); SM_CodeItemsBLL item = new SM_CodeItemsBLL(); FormCollection param = (FormCollection)obj; A04 a = new A04(); a.PersonID = _aBll.GetByRowID(param["EduRowID"]).PersonID; if (!string.IsNullOrEmpty(param["A0405"])) { a.A0405 = item.GetCodeItemByCodeID("JDXL").Where(o => o.CodeItemName == param["A0405"]).FirstOrDefault().CodeItemID; } if (!string.IsNullOrEmpty(param["C0401"])) { a.C0401 = item.GetCodeItemByCodeID("KF").Where(o => o.CodeItemName == param["C0401"]).FirstOrDefault().CodeItemID; } a.DispOrder = GetA04Info().Count() + 1; a.IsLastRow = 1; if (!string.IsNullOrEmpty(param["A0415"])) { a.A0415 = Convert.ToDateTime(param["A0415"]); } if (!string.IsNullOrEmpty(param["A0430"])) { a.A0430 = Convert.ToDateTime(param["A0430"]); } a.A0435 = param["A0435"]; a.A0410 = param["A0410"]; string RowID = param["EduRowID"]; return(base.Modify(a, o => o.RowID == RowID, "A0405", "C0401", "A0415", "A0430", "A0435", "A0410") > 0); }
/// <summary> /// 添加学历学位信息 /// </summary> /// <param name="obj"></param> /// <returns></returns> public bool AddEdu(object obj) { A01BLL _aBll = new A01BLL(); SM_CodeItemsBLL item = new SM_CodeItemsBLL(); FormCollection param = (FormCollection)obj; A04 a = new A04(); a.PersonID = _aBll.GetByRowID(param["EduRowID"]).PersonID; a.RowID = HCQ2_Common.RowIDHelp.GetNewRowID(); if (!string.IsNullOrEmpty(param["A0405"])) { a.A0405 = item.GetCodeItemByCodeID("JDXL").Where(o => o.CodeItemName == param["A0405"]).FirstOrDefault().CodeItemID; } if (!string.IsNullOrEmpty(param["C0401"])) { a.C0401 = item.GetCodeItemByCodeID("KF").Where(o => o.CodeItemName == param["C0401"]).FirstOrDefault().CodeItemID; } a.IsLastRow = 1; if (!string.IsNullOrEmpty(param["A0415"]) && param["A0415"] != "学历学位") { a.A0415 = Convert.ToDateTime(param["A0415"]); } if (!string.IsNullOrEmpty(param["A0430"]) && param["A0430"] != "A0430") { a.A0430 = Convert.ToDateTime(param["A0430"]); } a.A0435 = param["A0435"]; a.A0410 = param["A0410"]; bool isAccess = false; if (!string.IsNullOrEmpty(param["EduIsEdit"])) { //编辑 string EduRowID = param["EduIsEdit"]; isAccess = base.Modify(a, o => o.RowID == EduRowID, "A0405", "C0401", "A0415", "A0430", "A0435", "A0410") > 0; } else { var data = GetA04Info(); if (data.Count() > 0) { a.DispOrder = data.Max(o => o.DispOrder) + 1; } else { a.DispOrder = 1; } //添加 isAccess = base.Add(a) > 0; } return(isAccess); }
/// <summary> /// 保存或者编辑工作经历 /// </summary> /// <param name="obj"></param> /// <returns></returns> public bool OperWork(object obj) { FormCollection param = (FormCollection)obj; A19 a = new A19(); a.IsLastRow = 1; if (!string.IsNullOrEmpty(param["A1905"])) { a.A1905 = Convert.ToDateTime(param["A1905"]); } if (!string.IsNullOrEmpty(param["A1910"])) { a.A1910 = Convert.ToDateTime(param["A1910"]); } a.A1915 = param["A1915"]; a.A1920 = param["A1920"]; a.A1925 = param["A1925"]; a.A1926 = param["A1926"]; a.A1927 = param["A1927"]; a.A1928 = param["A1928"]; a.A1929 = param["A1929"]; a.A1930 = param["A1930"]; bool returnBool = false; if (!string.IsNullOrEmpty(param["workIsEdit"])) { //编辑 string workEditRowID = param["workIsEdit"]; returnBool = base.Modify(a, o => o.RowID == workEditRowID, "A1905", "A1910", "A1915", "A1920", "A1925" , "A1926", "A1927", "A1928", "A1929", "A1930") > 0; } else { A01BLL _aBll = new A01BLL(); a.RowID = HCQ2_Common.RowIDHelp.GetNewRowID(); a.PersonID = _aBll.GetByRowID(param["workRowID"]).PersonID; if (GetA19Info().Count() > 0) { a.DispOrder = GetA19Info().Max(o => o.DispOrder) + 1; } else { a.DispOrder = 1; } returnBool = base.Add(a) > 0; } return(returnBool); }
/// <summary> /// 添加、编辑考勤时间 /// </summary> /// <param name="obj"></param> /// <returns></returns> public bool OperAttendance(object obj) { FormCollection param = (FormCollection)obj; A01BLL aBll = new A01BLL(); A02 a = new A02(); a.A0201 = Convert.ToDateTime(param["A0201"]); bool returnBool = false; if (!string.IsNullOrEmpty(param["AttendanceIsEdit"])) { string RowID = param["AttendanceIsEdit"]; returnBool = base.Modify(a, o => o.RowID == RowID, "A0201") > 0; } else { string RowID = param["AttendanceRowID"]; a.PersonID = aBll.GetByRowID(RowID).PersonID; if (UpdateA02LastRow(a.PersonID)) { a.RowID = HCQ2_Common.RowIDHelp.GetNewRowID(); a.IsLastRow = 1; var data = GetA02Info(); if (data.Count() > 0) { a.DispOrder = data.Count() + 1; } else { a.DispOrder = 1; } returnBool = base.Add(a) > 0; } else { returnBool = false; } } return(returnBool); }
/// <summary> /// 添加投诉信息 /// </summary> /// <param name="com"></param> /// <returns></returns> public bool AddComplaints(HCQ2_Model.AppModel.Complaints com) { T_Complaints aCom = new T_Complaints(); T_User user = new T_UserBLL().Select(o => o.user_guid == com.userid).FirstOrDefault(); aCom.c_title = com.title; aCom.c_content = com.content; if (com.image != null) { aCom.c_image = Convert.FromBase64String(com.image); } aCom.create_date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); aCom.create_guid = com.userid; A01 data = new A01BLL().Select(o => o.A0177 == user.user_identify)[0]; aCom.create_identifycode = user.user_identify; aCom.create_personid = data.A0101; StringBuilder sbSql = new StringBuilder(); sbSql.AppendFormat("select top 1 * from a01 where a0177='{0}'", user.user_identify); DataTable dt = HCQ2_Common.SQL.SqlHelper.ExecuteDataTable(sbSql.ToString()); if (dt != null) { sbSql = new StringBuilder(); if (!string.IsNullOrEmpty(dt.Rows[0]["B0002"].ToString())) { sbSql.AppendFormat("select UnitName from B01 where UnitID='{0}'", dt.Rows[0]["B0002"]); } else { sbSql.AppendFormat("select UnitName from B01 where UnitID='{0}'", dt.Rows[0]["B0001"]); } aCom.unit_name = HCQ2_Common.SQL.SqlHelper.ExecuteScalar(sbSql.ToString()).ToString(); } return(Add(aCom) > 0); }
/// <summary> /// 获取View_A02信息 /// </summary> /// <param name="bindDate">年月日</param> /// <returns></returns> public DataTable GetView(object obj) { FormCollection form = (FormCollection)obj; int page = int.Parse(form["page"]); int rows = int.Parse(form["rows"]); List <View_A02> list = CheckPerson(obj); //获取所有人员 A01BLL abll = new A01BLL(); var personData = abll.GetA01Info().AsEnumerable(); //获取当前已经打卡的人数集合 var data = list.AsEnumerable(); if (!string.IsNullOrEmpty(form["unitID"].Trim())) { switch (form["unitID"].Length) { case 3: data = data.Where(o => o.B0001 == form["unitID"].Trim()); personData = personData.Where(o => o.B0001 == form["unitID"].Trim()); break; case 6: data = data.Where(o => o.B000201 == form["unitID"].Trim()); personData = personData.Where(o => o.B000201 == form["unitID"].Trim()); break; case 9: data = data.Where(o => o.B000202 == form["unitID"].Trim()); personData = personData.Where(o => o.B000202 == form["unitID"].Trim()); break; default: break; } } else { HCQ2UI_Helper.OperateContext context = new HCQ2UI_Helper.OperateContext(); string unit_id = context.bllSession.B01.GetB01PerData(context.Usr.user_id)[0].UnitID; data = data.Where(o => o.B0001 == unit_id); personData = personData.Where(o => o.B0001 == unit_id); } if (!string.IsNullOrEmpty(form["txtSearchDate"])) { string[] searchTime = form["txtSearchDate"].Split('-'); data = data.Where(o => Convert.ToDateTime(o.A0201).Year == int.Parse(searchTime[0]) && Convert.ToDateTime(o.A0201).Month == int.Parse(searchTime[1]) && Convert.ToDateTime(o.A0201).Day == int.Parse(searchTime[2])); } if (!string.IsNullOrEmpty(form["search"])) { data = data.Where(o => o.A0101 == form["search"].Trim()); personData = personData.Where(o => o.A0101 == form["search"].Trim()); } string PersonIDStr = "''"; if (personData.Count() > 0) { foreach (var item in personData) { string personID = item.PersonID; var dataNull = data.Where(o => o.PersonID == personID); if (dataNull.Count() <= 0) { if (PersonIDStr == "''") { PersonIDStr = "'" + item.PersonID + "'"; } else { PersonIDStr += ",'" + item.PersonID + "'"; } } } } StringBuilder sbSql = new StringBuilder(); sbSql.AppendFormat("select A0201='',A0101,B0001Name=(select unitname from B01 where UnitID=a.B0001)"); sbSql.AppendFormat(" ,B0002Name=(select unitname from B01 where UnitID=a.B0002),"); sbSql.AppendFormat(" E0386=(select CodeItemName from SM_CodeItems where CodeID='JA' and CodeItemID=a.E0386),C0104,A0177"); sbSql.AppendFormat(" from A01 a where PersonID in ({0})", PersonIDStr); return(HCQ2_Common.SQL.SqlHelper.ExecuteDataTable(sbSql.ToString())); }
/// <summary> /// 自动写入上报提示 /// </summary> /// <param name="user_id"></param> public void WriteRepostLog(int user_id) { List <HCQ2_Model.TreeModel.B01PerTreeModel> treeList = HCQ2UI_Helper.OperateContext.Current.bllSession.B01.GetB01PerData(user_id); if (treeList.Count() > 0) { List <B01> unitList = new B01BLL().GetB01Info(); StringBuilder sbContent = new StringBuilder(); //根据项目挨个循环,获取上报未上报项目,人员信息 foreach (var item in treeList) { if (sbContent.Length > 0) { sbContent.Append("<br />"); } string UnitID = item.UnitID; B01 Unit = unitList.Where(o => o.UnitID == UnitID).FirstOrDefault(); if (Unit.if_upload == "1") { sbContent.AppendFormat("<strong style='color:Blue'>" + Unit.UnitName + "</strong>:项目信息<strong>已经上报!</strong>"); } else { sbContent.AppendFormat("<strong style='color:Red'>" + Unit.UnitName + "</strong>:项目信息<strong style='color:red;'>未上报!</strong>"); } List <A01> userList = new A01BLL().GetByUnitID(UnitID); List <A01> accUserList = userList.Where(o => o.if_uparchive == "1").ToList(); if (accUserList.Count() > 0) { sbContent.AppendFormat("<br /><strong style='color:blue;'>已上报的人员总数"); sbContent.AppendFormat(":{0}</strong>", accUserList.Count()); } List <A01> lowUserList = userList.Where(o => o.if_uparchive == "0" || o.if_uparchive == null || o.if_uparchive == "").ToList(); if (lowUserList.Count() > 0) { sbContent.AppendFormat("<br /><strong style='color:red;'>未上报的人员总数"); sbContent.AppendFormat(":{0}</strong>", lowUserList.Count()); } } //推送 if (sbContent.Length > 0) { List <T_TodoList> todoList = Select(o => o.to_user_id == user_id.ToString() && o.to_title.Contains("上报消息") && o.to_send_user_id == 1 && o.to_send_user_name == "管理员"); if (todoList.Count() > 0) { foreach (var to in todoList) { int to_id = to.to_id; Delete(o => o.to_id == to_id); } } T_TodoList todo = new T_TodoList(); todo.to_user_id = user_id.ToString(); todo.to_user_name = HCQ2UI_Helper.OperateContext.Current.Usr.user_name; todo.to_title = "上报消息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); todo.to_content = sbContent.ToString(); todo.to_send_user_id = 1; todo.to_send_user_name = "管理员"; todo.to_send_date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); todo.is_system = 1; todo.to_remove = 0; Add(todo); } } }