public virtual IList <SupplierPriceReportInfo> GetSupplierPriceReports(QueryInfo Query) { int PageSize; int CurrentPage; IList <SupplierPriceReportInfo> entitys = null; SupplierPriceReportInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "Supplier_PriceReport"; SqlField = "*"; SqlParam = DBHelper.GetSqlParam(Query.ParamInfos); SqlOrder = DBHelper.GetSqlOrder(Query.OrderInfos); SqlList = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize); RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <SupplierPriceReportInfo>(); while (RdrList.Read()) { entity = new SupplierPriceReportInfo(); entity.PriceReport_ID = Tools.NullInt(RdrList["PriceReport_ID"]); entity.PriceReport_PurchaseID = Tools.NullInt(RdrList["PriceReport_PurchaseID"]); entity.PriceReport_MemberID = Tools.NullInt(RdrList["PriceReport_MemberID"]); entity.PriceReport_Title = Tools.NullStr(RdrList["PriceReport_Title"]); entity.PriceReport_Name = Tools.NullStr(RdrList["PriceReport_Name"]); entity.PriceReport_Phone = Tools.NullStr(RdrList["PriceReport_Phone"]); entity.PriceReport_DeliveryDate = Tools.NullDate(RdrList["PriceReport_DeliveryDate"]); entity.PriceReport_AddTime = Tools.NullDate(RdrList["PriceReport_AddTime"]); entity.PriceReport_ReplyContent = Tools.NullStr(RdrList["PriceReport_ReplyContent"]); entity.PriceReport_ReplyTime = Tools.NullDate(RdrList["PriceReport_ReplyTime"]); entity.PriceReport_IsReply = Tools.NullInt(RdrList["PriceReport_IsReply"]); entity.PriceReport_AuditStatus = Tools.NullInt(RdrList["PriceReport_AuditStatus"]); entity.PriceReport_Note = Tools.NullStr(RdrList["PriceReport_Note"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool EditSupplierPriceReport(SupplierPriceReportInfo entity, RBACUserInfo UserPrivilege) { if (RBAC.CheckPrivilege(UserPrivilege, "d2656c57-1fbb-4928-8bff-41488d5763cc")) { return(MyDAL.EditSupplierPriceReport(entity)); } else { throw new TradePrivilegeException("没有权限,权限代码:d2656c57-1fbb-4928-8bff-41488d5763cc错误"); } }
public virtual bool AddSupplierPriceReport(SupplierPriceReportInfo entity, RBACUserInfo UserPrivilege) { if (RBAC.CheckPrivilege(UserPrivilege, "b482df13-2941-4314-9200-b64db8b358bc")) { return(MyDAL.AddSupplierPriceReport(entity)); } else { throw new TradePrivilegeException("没有权限,权限代码:b482df13-2941-4314-9200-b64db8b358bc错误"); } }
public virtual bool EditSupplierPriceReport(SupplierPriceReportInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM Supplier_PriceReport WHERE PriceReport_ID = " + entity.PriceReport_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["PriceReport_ID"] = entity.PriceReport_ID; DrAdd["PriceReport_PurchaseID"] = entity.PriceReport_PurchaseID; DrAdd["PriceReport_MemberID"] = entity.PriceReport_MemberID; DrAdd["PriceReport_Title"] = entity.PriceReport_Title; DrAdd["PriceReport_Name"] = entity.PriceReport_Name; DrAdd["PriceReport_Phone"] = entity.PriceReport_Phone; DrAdd["PriceReport_DeliveryDate"] = entity.PriceReport_DeliveryDate; DrAdd["PriceReport_AddTime"] = entity.PriceReport_AddTime; DrAdd["PriceReport_ReplyContent"] = entity.PriceReport_ReplyContent; DrAdd["PriceReport_ReplyTime"] = entity.PriceReport_ReplyTime; DrAdd["PriceReport_IsReply"] = entity.PriceReport_IsReply; DrAdd["PriceReport_AuditStatus"] = entity.PriceReport_AuditStatus; DrAdd["PriceReport_Note"] = entity.PriceReport_Note; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual SupplierPriceReportInfo GetSupplierPriceReportByID(int ID) { SupplierPriceReportInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM Supplier_PriceReport WHERE PriceReport_ID = " + ID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new SupplierPriceReportInfo(); entity.PriceReport_ID = Tools.NullInt(RdrList["PriceReport_ID"]); entity.PriceReport_PurchaseID = Tools.NullInt(RdrList["PriceReport_PurchaseID"]); entity.PriceReport_MemberID = Tools.NullInt(RdrList["PriceReport_MemberID"]); entity.PriceReport_Title = Tools.NullStr(RdrList["PriceReport_Title"]); entity.PriceReport_Name = Tools.NullStr(RdrList["PriceReport_Name"]); entity.PriceReport_Phone = Tools.NullStr(RdrList["PriceReport_Phone"]); entity.PriceReport_DeliveryDate = Tools.NullDate(RdrList["PriceReport_DeliveryDate"]); entity.PriceReport_AddTime = Tools.NullDate(RdrList["PriceReport_AddTime"]); entity.PriceReport_ReplyContent = Tools.NullStr(RdrList["PriceReport_ReplyContent"]); entity.PriceReport_ReplyTime = Tools.NullDate(RdrList["PriceReport_ReplyTime"]); entity.PriceReport_IsReply = Tools.NullInt(RdrList["PriceReport_IsReply"]); entity.PriceReport_AuditStatus = Tools.NullInt(RdrList["PriceReport_AuditStatus"]); entity.PriceReport_Note = Tools.NullStr(RdrList["PriceReport_Note"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddSupplierPriceReport(SupplierPriceReportInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM Supplier_PriceReport"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["PriceReport_ID"] = entity.PriceReport_ID; DrAdd["PriceReport_PurchaseID"] = entity.PriceReport_PurchaseID; DrAdd["PriceReport_MemberID"] = entity.PriceReport_MemberID; DrAdd["PriceReport_Title"] = entity.PriceReport_Title; DrAdd["PriceReport_Name"] = entity.PriceReport_Name; DrAdd["PriceReport_Phone"] = entity.PriceReport_Phone; DrAdd["PriceReport_DeliveryDate"] = entity.PriceReport_DeliveryDate; DrAdd["PriceReport_AddTime"] = entity.PriceReport_AddTime; DrAdd["PriceReport_ReplyContent"] = entity.PriceReport_ReplyContent; DrAdd["PriceReport_ReplyTime"] = entity.PriceReport_ReplyTime; DrAdd["PriceReport_IsReply"] = entity.PriceReport_IsReply; DrAdd["PriceReport_AuditStatus"] = entity.PriceReport_AuditStatus; DrAdd["PriceReport_Note"] = entity.PriceReport_Note; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }