/// <summary> /// 更新工作档案信息 /// </summary> /// <param name="model"></param> /// <param name="CompanyCD"></param> /// <returns></returns> public static bool UpdateTechnicsArchives(TechnicsArchivesModel model) { UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; try { bool succ = false; string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; LogInfoModel logModel = InitLogInfo(model.TechNo); logModel.Element = ConstUtil.LOG_PROCESS_UPDATE; succ = TechnicsArchivesDBHelper.UpdateTechnicsArchives(model, loginUserID); 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, ex); return(false); } }
/// <summary> /// 获取工艺档案详细信息 /// </summary> /// <returns>DataTable</returns> public static DataTable GetTechnicsArchivesDetailInfo(TechnicsArchivesModel model) { try { return(TechnicsArchivesDBHelper.GetTechnicsArchivesDetailInfo(model)); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 判断要删除的ID是否已经被引用 /// </summary> /// <param name="CompanyCD"></param> /// <param name="ID"></param> /// <param name="TableName"></param> /// <returns></returns> public static int CountRefrence(string CompanyCD, string ID, string TableName) { try { return(TechnicsArchivesDBHelper.CountRefrence(CompanyCD, ID, TableName, "TechID")); } catch (Exception ex) { throw ex; } }
/// <summary> /// 工艺档案列表 /// </summary> /// <returns>DataTable</returns> public static DataTable GetTechnicsArchivesListBycondition(TechnicsArchivesModel model, int pageIndex, int pageCount, string OrderBy, ref int totalCount) { try { return(TechnicsArchivesDBHelper.GetTechnicsArchivesTableBycondition(model, 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 DeleteTechnicsArchives(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 = TechnicsArchivesDBHelper.DeleteTechnicsArchives(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); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_DELETE; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); } return(isSucc); }