/// <summary> /// 新增摘要信息 /// </summary> /// <param name="Model">实体</param> /// <returns>true 成功,false失败</returns> public static bool InsertSummary(SummarySettingModel Model) { UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; if (Model == null) return false; if (Model.CompanyCD == null) Model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD; try { bool succ = false; string loginUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID; LogInfoModel logModel = InitLogInfo(Model.Name); logModel.Element = ConstUtil.LOG_PROCESS_INSERT; succ= SummarySettingDBHelper.InsertSummary(Model); 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); throw ex; } }
/// <summary> /// 修改摘要信息 /// </summary> /// <param name="Model">实体</param> /// <returns>true 成功,false失败</returns> public static bool UpdateSummary(SummarySettingModel Model) { StringBuilder sql = new StringBuilder(); sql.AppendLine("Update officedba.SummarySetting set SummTypeID=@SummTypeID,Name=@Name,"); sql.AppendLine("UsedStatus=@UsedStatus where CompanyCD=@CompanyCD and ID=@SummaryCD"); SqlParameter[] parms = new SqlParameter[5]; parms[0] = SqlHelper.GetParameter("@CompanyCD", Model.CompanyCD); parms[1] = SqlHelper.GetParameter("@SummaryCD", Model.SummaryCD); parms[2] = SqlHelper.GetParameter("@SummTypeID", Model.SummTypeID); parms[3] = SqlHelper.GetParameter("@Name", Model.Name); parms[4] = SqlHelper.GetParameter("@UsedStatus", Model.UsedStatus); SqlHelper.ExecuteTransSql(sql.ToString(), parms); return SqlHelper.Result.OprateCount > 0 ? true : false; }
/// <summary> /// 新增摘要信息 /// </summary> /// <param name="Model">实体</param> /// <returns>true 成功,false失败</returns> public static bool InsertSummary(SummarySettingModel Model) { StringBuilder sql = new StringBuilder(); sql.AppendLine("Insert into officedba.SummarySetting(CompanyCD,"); sql.AppendLine("SummTypeID,Name,UsedStatus)"); sql.AppendLine("values(@CompanyCD,@SummTypeID,"); sql.AppendLine("@Name,@UsedStatus)"); SqlParameter []parms=new SqlParameter[4]; parms[0] = SqlHelper.GetParameter("@CompanyCD", Model.CompanyCD); parms[1] = SqlHelper.GetParameter("@SummTypeID", Model.SummTypeID); parms[2] = SqlHelper.GetParameter("@Name", Model.Name); parms[3] = SqlHelper.GetParameter("@UsedStatus", Model.UsedStatus); SqlHelper.ExecuteTransSql(sql.ToString(), parms); return SqlHelper.Result.OprateCount > 0 ? true : false; }