/// <summary> /// 保存数据 /// </summary> /// <returns></returns> private string SaveData() { string oid = Post("hidOid_Content"); bool res = false; Peer_project_list notboth = new Peer_project_list(); if (string.IsNullOrEmpty(oid)) { oid = notboth.OID = Guid.NewGuid().ToString(); ds.RetrieveObject(notboth); notboth.SEQ_NO = Post("hidSeqNo_Content"); notboth.SEQUEUE = cod.ChangeInt(Post("SEQUEUE")); notboth.PEER_CONTENT = Post("PEER_CONTENT"); var inserttrcn = ImplementFactory.GetInsertTransaction <Peer_project_list>("Peer_project_listInsertTransaction"); inserttrcn.EntityList.Add(notboth); res = inserttrcn.Commit(); } else { notboth.OID = oid; ds.RetrieveObject(notboth); notboth.SEQUEUE = cod.ChangeInt(Post("SEQUEUE")); notboth.PEER_CONTENT = Post("PEER_CONTENT"); var updatetrcn = ImplementFactory.GetUpdateTransaction <Peer_project_list>("Peer_project_listUpdateTransaction", user.User_Name); res = updatetrcn.Commit(notboth); } if (res) { return(oid); } else { return(string.Empty); } }
/// <summary> /// 删除数据 /// </summary> /// <returns></returns> private string DeleteData() { try { if (string.IsNullOrEmpty(Request.QueryString["id"])) { return("OID为空,不允许删除操作"); } Question_info head = new Question_info(); head.OID = Request.QueryString["id"].ToString(); ds.RetrieveObject(head); var transaction = ImplementFactory.GetDeleteTransaction <Question_info>("Question_infoDeleteTransaction"); transaction.EntityList.Add(head); if (!transaction.Commit()) { return("删除失败!"); } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "问题反馈删除失败:" + ex.ToString()); return("删除失败!"); } }
private string DeleteData() { var oid = Get("id"); if (string.IsNullOrEmpty(oid)) { return("主键为空,不允许删除操作"); } head.OID = oid; ds.RetrieveObject(head); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Qz_job_manage>("Qz_job_manageDeleteTransaction"); transaction.EntityList.Add(head); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } else { return(string.Empty); } }
private string DeleteWorkDetail() { var oid = Get("id"); if (string.IsNullOrEmpty(oid)) { return("主键为空,不允许删除操作"); } Qz_job_proof_list list = new Qz_job_proof_list(); list.OID = oid; ds.RetrieveObject(list); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Qz_job_proof_list>("Qz_job_proof_listDeleteTransaction"); transaction.EntityList.Add(list); bDel = transaction.Commit(); if (!bDel) { return(string.Empty); } else { decimal reward = JobProofHandleClass.getInstance().CalculateReward(list.SEQ_NO); ds.ExecuteTxtNonQuery(string.Format("UPDATE QZ_JOB_PROOF_HEAD SET REWARD = {1} WHERE SEQ_NO = '{0}'", list.SEQ_NO, reward)); return(Math.Round(reward, 2).ToString()); } }
private string CheckOnly(string oid, string schyear, string batch) { if (string.IsNullOrEmpty(schyear) || string.IsNullOrEmpty(batch)) { return("请输入必填项!"); } Dictionary <string, string> param = new Dictionary <string, string>() { { "SCHYEAR", schyear }, { "BATCH_NO", batch } }; if (oid.Length > 0) { param.Add(string.Format("OID NOT IN ('{0}')", oid), string.Empty); } var selectTran = ImplementFactory.GetSelectTransaction <Dst_param_info>("Dst_param_infoSelectTransaction", param); var selectList = selectTran.SelectAll(); if (selectList == null || selectList.Count <= 0) { return(string.Empty); } return("该学年该批次设置已存在!"); }
private string CheckOnly() { string oid = Get("oid"); string sch_year = Get("year"); string sch_term = Get("term"); if (string.IsNullOrEmpty(sch_year) || string.IsNullOrEmpty(sch_term)) { return("请输入必填项!"); } Dictionary <string, string> param = new Dictionary <string, string>() { { "SCH_YEAR", sch_year }, { "SCH_TERM", sch_term } }; if (oid.Length > 0) { param.Add(string.Format("OID NOT IN ('{0}')", oid), string.Empty); } var selectTran = ImplementFactory.GetSelectTransaction <Qz_job_manage_set>("Qz_job_manage_setSelectTransaction", param); var selectList = selectTran.SelectAll(); if (selectList == null || selectList.Count <= 0) { return(string.Empty); } return("该学年、学期设置已存在!"); }
/// <summary> /// 删除主表数据并且把子表数据也删除 /// </summary> /// <returns></returns> private string DeleteData() { var code = Post("OID"); if (string.IsNullOrEmpty(code)) { return("主键为空,不允许删除操作"); } var model = new Dst_level_info(); model.OID = code; ds.RetrieveObject(model); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Dst_level_info>("Dst_level_infoDeleteTransaction"); transaction.EntityList.Add(model); bDel = transaction.Commit(); if (bDel) { return(""); } return("删除失败!"); }
/// <summary> /// 通过传入的主键编码删除数据 /// </summary> /// <returns></returns> private string DeleteData() { try { if (string.IsNullOrEmpty(Get("id"))) { return("主键为空,不允许删除操作"); } var model = new Messge_info(); model.OID = Get("id"); ds.RetrieveObject(model); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Messge_info>("Messge_infoDeleteTransaction"); transaction.EntityList.Add(model); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "删除消息,出错:" + ex.ToString()); return("删除失败!"); } }
protected override SelectTransaction <Shoolar_apply_head> GetSelectTransaction() { //运维界面:不符合奖助申请条件学生名单 //只查询 学院审核通过、学校审核通过 的数据,因为在辅导员审核、学院审核的时候 已经做了当前项目限制条件的过滤筛选 param.Add(string.Format(" RET_CHANNEL IN ('{0}','{1}') ", CValue.RET_CHANNEL_D2010, CValue.RET_CHANNEL_D4000), string.Empty); return(ImplementFactory.GetSelectTransaction <Shoolar_apply_head>("Shoolar_apply_headSelectTransaction", param)); }
/// <summary> /// 删除操作 /// </summary> /// <param name="id"></param> /// <returns></returns> private string Delete() { try { string[] strs = Get("ids").Split(','); for (int i = 0; i < strs.Length; i++) { if (strs[i].Length == 0) { continue; } var model = new Score_rank_info(); model.OID = strs[i].ToString(); ds.RetrieveObject(model); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Score_rank_info>("Score_rank_infoDeleteTransaction"); transaction.EntityList.Add(model); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "删除成绩信息失败:" + ex.ToString()); return("删除失败!"); } }
private string DeleteData() { var code = Get("id"); if (string.IsNullOrEmpty(code)) { return("主键为空,不允许删除操作"); } head.OID = code; ds.RetrieveObject(head); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Dst_stu_apply>("Dst_stu_applyDeleteTransaction"); transaction.EntityList.Add(head); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } else { return(""); } }
private string DeleteGrant() { Dst_stu_grant grant = new Dst_stu_grant(); var code = Get("id"); if (string.IsNullOrEmpty(code)) { return("主键为空,不允许删除操作"); } grant.OID = code; ds.RetrieveObject(grant); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Dst_stu_grant>("Dst_stu_grantDeleteTransaction"); transaction.EntityList.Add(grant); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } else { return(""); } }
private bool CreateNewData() { head.NUMBER = stu.NUMBER; head.NAME = stu.NAME; head.SEX = stu.SEX; head.BIRTH_DATE = stu.GARDE; head.NATION = stu.NATION; head.IDCARDNO = stu.IDCARDNO; head.POLISTATUS = stu.POLISTATUS; head.COLLEGE = stu.COLLEGE; head.MAJOR = stu.MAJOR; head.CLASS = stu.CLASS; head.GRADE = stu.EDULENTH; head.TELEPHONE = stu.MOBILENUM; head.HOME_ADDRESS = stu.ADDRESS; head.HOME_PHONE = stu.HOMENUM; head.SCHYEAR = sch_info.CURRENT_YEAR; head.OID = Guid.NewGuid().ToString(); head.SEQ_NO = GetSeq_no(); head.DOC_TYPE = this.Doc_type; head.RET_CHANNEL = Ret_Channel_A0000; head.DECLARE_TYPE = WKF_VLAUES.DECLARE_TYPE_D; head.OP_TIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); head.OP_CODE = user.User_Id; head.OP_NAME = user.User_Name; head.ANNUAL_INCOME = GetIncome(head.NUMBER, "year"); head.MONTHLY_INCOME = GetIncome(head.NUMBER, "month"); var inserttrcn = ImplementFactory.GetInsertTransaction <Dst_stu_apply>("Dst_stu_applyInsertTransaction"); inserttrcn.EntityList.Add(head); return(inserttrcn.Commit()); }
/// <summary> /// 删除数据 /// </summary> /// <returns></returns> private string DeleteData() { try { string[] strs = Post("SELECT_OID").Split(','); for (int i = 0; i < strs.Length; i++) { if (strs[i].Length == 0) { continue; } var model = new Makeup_project_apply(); model.OID = strs[i].ToString(); ds.RetrieveObject(model); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Makeup_project_apply>("Makeup_project_applyDeleteTransaction"); transaction.EntityList.Add(model); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "删除学费补偿学费补偿申请数据,出错:" + ex.ToString()); return("删除失败!"); } }
private string DeleteMember() { bool bDel = false; string oid = Get("oid"); if (string.IsNullOrEmpty(oid)) { return("主键为空,不允许删除!"); } Dst_family_members m = new Dst_family_members(); m.OID = oid; ds.RetrieveObject(m); var transaction = ImplementFactory.GetDeleteTransaction <Dst_family_members>("Dst_family_membersDeleteTransaction"); transaction.EntityList.Add(m); bDel = transaction.Commit(); if (bDel) { string msg; if (!FamilySurveyHandleClass.getInstance().CalculateIncome(m.SEQ_NO, out msg)) { msg = "计算家庭年收入异常"; } return(msg); } return("删除失败!"); }
private string DeleteLog() { try { string fromDATE = Post("Fromdate");//获取页面文本信息。 string toDATE = Post("Todate"); Dictionary <string, string> param = new Dictionary <string, string> { { string.Format(" LOG_DATE BETWEEN '{0} 00:00:00,000' AND '{1} 23:59:59,999'", fromDATE, toDATE), "" } }; //筛选出数据的SQL。 var selecttrcn = ImplementFactory.GetSelectTransaction <Log_sys_operation>("Log_sys_operationSelectTransaction", param); var list = selecttrcn.SelectAll(); var deletetrcn = ImplementFactory.GetDeleteTransaction <Log_sys_operation>("Log_sys_operationDeleteTransaction"); for (int i = 0; i < list.Count; i++) { deletetrcn.EntityList.Add(new Log_sys_operation() { OID = list[i].OID//获取筛选出的数据的OID,并添加到删除事务里。 }); } if (list.Count > 0 && deletetrcn.Commit()) { return(""); } else { return("删除不成功!"); } } catch (Exception ex) { return(string.Format("删除日志异常,原因:{0}", ex.Message)); } }
/// <summary> /// 删除数据 /// </summary> /// <returns></returns> private string DeleteData() { try { if (string.IsNullOrEmpty(Request.QueryString["id"])) { return("OID为空,不允许删除操作"); } Shoolar_apply_study_list head = new Shoolar_apply_study_list(); head.OID = Request.QueryString["id"].ToString(); ds.RetrieveObject(head); var transaction = ImplementFactory.GetDeleteTransaction <Shoolar_apply_study_list>("Shoolar_apply_study_listDeleteTransaction"); transaction.EntityList.Add(head); if (!transaction.Commit()) { return("删除失败!"); } return(string.Empty); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_WARN, "奖助申请,删除学习科目数据失败:" + ex.ToString()); return("删除失败!"); } }
private string CheckOnly() { string oid = Get("oid"); string sch_year = Get("year"); string sch_term = Get("term"); string year_month = Get("month"); Dictionary <string, string> param = new Dictionary <string, string>() { { "SCH_YEAR", sch_year }, { "SCH_TERM", sch_term }, { "YEAR_MONTH", year_month } }; if (oid.Length > 0) { param.Add(string.Format("OID NOT IN ('{0}')", oid), string.Empty); } var selectTran = ImplementFactory.GetSelectTransaction <Qz_job_proof_set>("Qz_job_proof_setSelectTransaction", param); var selectList = selectTran.SelectAll(); if (selectList == null || selectList.Count <= 0) { return(string.Empty); } return("该学年、学期设置已存在!"); }
/// <summary> /// 删除主表的时候连带子表的数据也一并删除 /// </summary> /// <returns></returns> private string DeleteData() { try { if (string.IsNullOrEmpty(Get("id"))) { return("OID为空,不允许删除操作"); } Peer_project_head head = new Peer_project_head(); head.OID = Get("id"); ds.RetrieveObject(head); var transaction = ImplementFactory.GetDeleteTransaction <Peer_project_head>("Peer_project_headDeleteTransaction"); transaction.EntityList.Add(head); //已经改写了Commit方法,提交删除操作时会同时把:表体对应数据删除 if (transaction.Commit()) { return(string.Empty); } return("删除失败!"); } catch (Exception ex) { LogDBHandleClass.getInstance().LogException(CValue.LOG_LEVEL_ERROR, "评议项目设置,删除,出错:" + ex.ToString()); return("删除失败!"); } }
private string Delete() { try { if (Request.QueryString["id"].Length <= 0) { return("菜单ID参数不正确,重新操作或者联系管理人员进行处理"); } var deletetrcn = ImplementFactory.GetDeleteTransaction <Ua_function>("Ua_functionDeleteTransaction"); deletetrcn.EntityList.Add(new Ua_function() { FUNCTIONID = Request.QueryString["id"] }); if (deletetrcn.Commit()) { //把子菜单也一并删除 string strSQL = string.Format("DELETE FROM UA_FUNCTION WHERE PARENTID = '{0}' ", Request.QueryString["id"].ToString()); ds.ExecuteTxtNonQuery(strSQL); return("删除成功"); } return("操作失败!"); } catch (Exception ex) { return("删除失败!原因:" + ex.Message); } }
private string Save() { if (Request.QueryString["optype"].Equals("add")) { model.FUNCTIONID = Guid.NewGuid().ToString(); ds.RetrieveObject(model); model.PARENTID = Request.QueryString["id"]; GetValue(model); var inserttrcn = ImplementFactory.GetInsertTransaction <Ua_function>("Ua_functionInsertTransaction", user.User_Name); inserttrcn.EntityList.Add(model); if (inserttrcn.Commit()) { return("保存成功"); } return("保存失败"); } else { model.FUNCTIONID = Request.QueryString["id"]; ds.RetrieveObject(model); GetValue(model); var updatetrcn = ImplementFactory.GetUpdateTransaction <Ua_function>("Ua_functionUpdateTransaction", user.User_Name); if (updatetrcn.Commit(model)) { return("保存成功"); } return("保存失败"); } }
private string GetNode() { string functionid = Get("id"); List <Ua_function> listAll = ImplementFactory.GetSelectTransaction <Ua_function>("Ua_functionSelectTransaction", new Dictionary <string, string> { { "FUNCTIONID", functionid } }).SelectAll(); string json = "{}"; if (listAll.Count > 0) { model = listAll[0]; JsonObj jsonObj = new JsonObj(); jsonObj.DESCRIPTION = model.DESCRIPTION; jsonObj.FUNCTIONID = model.FUNCTIONID; jsonObj.ICON = model.ICON; jsonObj.NAME = model.NAME; jsonObj.NOTICE_FLAG = model.NOTICE_FLAG; jsonObj.SEQUENCE = model.SEQUENCE.ToString(); jsonObj.SHOWINMENU = model.SHOWINMENU; jsonObj.QUICK_FLAG = model.QUICK_FLAG; jsonObj.YJS_FLAG = model.YJS_FLAG; jsonObj.URL = model.URL; jsonObj.HASROLE = getRole4FunId(model.FUNCTIONID); json = JsonConvert.SerializeObject(jsonObj); } return(json); }
protected override SelectTransaction <Shoolar_apply_head> GetSelectTransaction() { if (!string.IsNullOrEmpty(Get("page_from"))) { if (Get("page_from").ToString().Equals("approve_pend"))/// 待处理查看 { param.Add(string.Format(DataFilterHandleClass.getInstance().Pend_DataFilter(user.User_Role, CValue.DOC_TYPE_BDM03)), string.Empty); } else if (Get("page_from").ToString().Equals("approve_proce")) /// 已处理查看 { param.Add(string.Format(DataFilterHandleClass.getInstance().Proc_DataFilter(user.User_Role, CValue.DOC_TYPE_BDM03)), string.Empty); } else if (Get("page_from").ToString().Equals("result")) //查询都是审批通过的数据 { param.Add("RET_CHANNEL", CValue.RET_CHANNEL_D4000); } else if (Get("page_from").ToString().Equals("nation_schoolar")) //全国信息:查询都是审批通过的数据 { param.Add("RET_CHANNEL", CValue.RET_CHANNEL_D4000); } else if (Get("page_from").ToString().Equals("result_outline")) //查询线下项目数据 { param.Add("PROJECT_CLASS", "OUTLINE"); } } return(ImplementFactory.GetSelectTransaction <Shoolar_apply_head>("Shoolar_apply_headSelectTransaction", param)); }
/// <summary> ///保存方法 /// </summary> /// <returns></returns> private string SaveData() { bool result = false; Peer_coun_head head = new Peer_coun_head(); if (string.IsNullOrEmpty(Post("hidOid")))//新增 { head.OID = Guid.NewGuid().ToString(); head.SEQ_NO = GetSeq_no(); GetPageValue(head); var inserttrcn = ImplementFactory.GetInsertTransaction <Peer_coun_head>("Peer_coun_headInsertTransaction"); inserttrcn.EntityList.Add(head); result = inserttrcn.Commit(); } else//修改 { head.OID = Post("hidOid"); ds.RetrieveObject(head); GetPageValue(head); var updatetrcn = ImplementFactory.GetUpdateTransaction <Peer_coun_head>("Peer_coun_headUpdateTransaction", user.User_Name); result = updatetrcn.Commit(head); } if (result) { //成功之后保存表体 SaveDataList(head.SEQ_NO, head.PEER_SEQ_NO); return(head.OID); } else { return(string.Empty); } }
protected override SelectTransaction <Messge_info> GetSelectTransaction() { if (!user.User_Id.Equals(ApplicationSettings.Get("AdminUser").ToString())) { //过滤:接收人与发送人都可以看到所属信息 param.Add("SEND_CODE", user.User_Id); } return(ImplementFactory.GetSelectTransaction <Messge_info>("Messge_infoSelectTransaction", param)); }
protected override SelectTransaction <Basic_coun_info> GetSelectTransaction() { if (!string.IsNullOrEmpty(Get("page_from"))) { if (Get("page_from").ToString().Equals("index"))/// 首页的用户档案进来的,只展示自己的 { param.Add("ENO", user.User_Id); } } return(ImplementFactory.GetSelectTransaction <Basic_coun_info>("Basic_coun_infoSelectTransaction", param)); }
protected override SelectTransaction <Basic_stu_info> GetSelectTransaction() { if (!string.IsNullOrEmpty(Get("page_from"))) { if (Get("page_from").ToString().Equals("nosubmit"))/// 页面来源:未提交修改学生信息 { param.Add(string.Format("NUMBER NOT IN (SELECT NUMBER FROM BASIC_STU_INFO_MODI)"), string.Empty); } } return(ImplementFactory.GetSelectTransaction <Basic_stu_info>("Basic_stu_infoSelectTransaction", param)); }
protected override SelectTransaction <Insur_apply_check_file> GetSelectTransaction() { if (Request.QueryString["seq_no"] != null && Request.QueryString["seq_no"].Length != 0) { param.Add("SEQ_NO", Request.QueryString["seq_no"]); } else { param.Add(" 1=2 ", ""); } return(ImplementFactory.GetSelectTransaction <Insur_apply_check_file>("Insur_apply_check_fileSelectTransaction", param)); }
protected override SelectTransaction <Peer_coun_head> GetSelectTransaction() { if (!string.IsNullOrEmpty(Get("page_from"))) { if (Get("page_from").ToString().Equals("result")) //查询都是结束的 { param.Add(string.Format("PEER_SEQ_NO IN (SELECT SEQ_NO FROM PEER_PROJECT_HEAD WHERE PEER_END < '{0}' ) ", GetDateShortFormater()), ""); } } return(ImplementFactory.GetSelectTransaction <Peer_coun_head>("Peer_coun_headSelectTransaction", param)); }
protected override SelectTransaction <Shoolar_project_num> GetSelectTransaction() { if (Request.QueryString["seq_no"] != null && Request.QueryString["seq_no"].Length != 0) { param.Add("SEQ_NO", Request.QueryString["seq_no"]); } else { param.Add(" 1=2 ", ""); } return(ImplementFactory.GetSelectTransaction <Shoolar_project_num>("Shoolar_project_numSelectTransaction", param)); }