/// <summary> /// 插入项目档案 /// </summary> /// <param name="model"></param> /// <param name="ht"></param> /// <param name="ID"></param> /// <returns></returns> public static bool InsertProjectInfo(ProjectInfoModel model, Hashtable ht, out string ID, string startDate, string endDate) { UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; ID = "0"; try { bool succ = false; string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; LogInfoModel logModel = InitLogInfo(model.ProjectNo, 0); logModel.Element = ConstUtil.LOG_PROCESS_INSERT; succ = ProjectInfoDBHelper.InsertProjectInfo(model, ht, out ID, startDate, endDate); if (!succ) { logModel.Remark = ConstUtil.LOG_PROCESS_FAILED; } else { logModel.Remark = ConstUtil.LOG_PROCESS_SUCCESS; } LogDBHelper.InsertLog(logModel); return(succ); } catch (Exception ex) { WriteSystemLog(userInfo, 0, ex); return(false); } }
/// <summary> /// 项目档案详细信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static DataTable GetProjectInfo(ProjectInfoModel model) { try { return(ProjectInfoDBHelper.GetProjectInfo(model)); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 获取项目信息列表 /// </summary> /// <returns>DataTable</returns> public static DataTable GetProjectInfoList(string ProjectName, string ProjectNo, string CompanyCD, int pageIndex, int pageCount, string ord, ref int TotalCount) { try { return(ProjectInfoDBHelper.GetProjectInfoList(ProjectName, ProjectNo, CompanyCD, pageIndex, pageCount, ord, ref TotalCount)); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 判断要删除的ID是否已经被引用 /// </summary> /// <param name="CompanyCD"></param> /// <param name="ID"></param> /// <returns></returns> public static int CountRefrence(string CompanyCD, string ID) { try { return(ProjectInfoDBHelper.CountRefrence(CompanyCD, ID)); } catch (Exception ex) { throw ex; } }
/// <summary> /// 通过检索条件查询项目档案列表信息 /// </summary> /// <param name="model"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="EFIndex"></param> /// <param name="EFDesc"></param> /// <param name="pageIndex"></param> /// <param name="pageCount"></param> /// <param name="OrderBy"></param> /// <param name="totalCount"></param> /// <returns></returns> public static DataTable GetProjectInfoListBycondition(ProjectInfoModel model, string EFIndex, string EFDesc, int pageIndex, int pageCount, string OrderBy, ref int totalCount) { try { return(ProjectInfoDBHelper.GetProjectInfoListBycondition(model, EFIndex, EFDesc, pageIndex, pageCount, OrderBy, ref totalCount)); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 删除项目档案 /// </summary> /// <param name="ID"></param> /// <param name="CompanyCD"></param> /// <returns></returns> public static bool DeleteProjectInfo(string ID, string CompanyCD) { if (string.IsNullOrEmpty(ID)) { return(false); } if (string.IsNullOrEmpty(CompanyCD)) { CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; } UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; bool isSucc = ProjectInfoDBHelper.DeleteProjectInfo(ID, CompanyCD); //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //获取删除的编号列表 string[] noList = ID.Split(','); //遍历所有编号,登陆操作日志 for (int i = 0; i < noList.Length; i++) { //获取编号 string no = noList[i]; //替换两边的 ' no = no.Replace("'", string.Empty); //操作日志 LogInfoModel logModel = InitLogInfo("项目档案ID:" + no, 1); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_DELETE; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); } return(isSucc); }