public virtual IList <ContractDeliveryInfo> GetContractDeliverys(QueryInfo Query) { int PageSize; int CurrentPage; IList <ContractDeliveryInfo> entitys = null; ContractDeliveryInfo entity = null; string SqlList, SqlField, SqlOrder, SqlParam, SqlTable; SqlDataReader RdrList = null; try { CurrentPage = Query.CurrentPage; PageSize = Query.PageSize; SqlTable = "Contract_Delivery"; 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 <ContractDeliveryInfo>(); while (RdrList.Read()) { entity = new ContractDeliveryInfo(); entity.Contract_Delivery_ID = Tools.NullInt(RdrList["Contract_Delivery_ID"]); entity.Contract_Delivery_ContractID = Tools.NullInt(RdrList["Contract_Delivery_ContractID"]); entity.Contract_Delivery_DeliveryStatus = Tools.NullInt(RdrList["Contract_Delivery_DeliveryStatus"]); entity.Contract_Delivery_SysUserID = Tools.NullInt(RdrList["Contract_Delivery_SysUserID"]); entity.Contract_Delivery_DocNo = Tools.NullStr(RdrList["Contract_Delivery_DocNo"]); entity.Contract_Delivery_Name = Tools.NullStr(RdrList["Contract_Delivery_Name"]); entity.Contract_Delivery_CompanyName = Tools.NullStr(RdrList["Contract_Delivery_CompanyName"]); entity.Contract_Delivery_Code = Tools.NullStr(RdrList["Contract_Delivery_Code"]); entity.Contract_Delivery_Amount = Tools.NullDbl(RdrList["Contract_Delivery_Amount"]); entity.Contract_Delivery_Note = Tools.NullStr(RdrList["Contract_Delivery_Note"]); entity.Contract_Delivery_AccpetNote = Tools.NullStr(RdrList["Contract_Delivery_AccpetNote"]); entity.Contract_Delivery_Addtime = Tools.NullDate(RdrList["Contract_Delivery_Addtime"]); entity.Contract_Delivery_Site = Tools.NullStr(RdrList["Contract_Delivery_Site"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual IList <ContractDeliveryInfo> GetContractDeliverysByContractID(int ContractID) { IList <ContractDeliveryInfo> entitys = null; ContractDeliveryInfo entity = null; string SqlList; SqlDataReader RdrList = null; try { SqlList = "select * from Contract_Delivery where Contract_Delivery_ContractID=" + ContractID; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.HasRows) { entitys = new List <ContractDeliveryInfo>(); while (RdrList.Read()) { entity = new ContractDeliveryInfo(); entity.Contract_Delivery_ID = Tools.NullInt(RdrList["Contract_Delivery_ID"]); entity.Contract_Delivery_ContractID = Tools.NullInt(RdrList["Contract_Delivery_ContractID"]); entity.Contract_Delivery_DeliveryStatus = Tools.NullInt(RdrList["Contract_Delivery_DeliveryStatus"]); entity.Contract_Delivery_SysUserID = Tools.NullInt(RdrList["Contract_Delivery_SysUserID"]); entity.Contract_Delivery_DocNo = Tools.NullStr(RdrList["Contract_Delivery_DocNo"]); entity.Contract_Delivery_Name = Tools.NullStr(RdrList["Contract_Delivery_Name"]); entity.Contract_Delivery_CompanyName = Tools.NullStr(RdrList["Contract_Delivery_CompanyName"]); entity.Contract_Delivery_Code = Tools.NullStr(RdrList["Contract_Delivery_Code"]); entity.Contract_Delivery_Amount = Tools.NullDbl(RdrList["Contract_Delivery_Amount"]); entity.Contract_Delivery_Note = Tools.NullStr(RdrList["Contract_Delivery_Note"]); entity.Contract_Delivery_AccpetNote = Tools.NullStr(RdrList["Contract_Delivery_AccpetNote"]); entity.Contract_Delivery_Addtime = Tools.NullDate(RdrList["Contract_Delivery_Addtime"]); entity.Contract_Delivery_Site = Tools.NullStr(RdrList["Contract_Delivery_Site"]); entitys.Add(entity); entity = null; } } return(entitys); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool EditContractDelivery(ContractDeliveryInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT * FROM Contract_Delivery WHERE Contract_Delivery_ID = " + entity.Contract_Delivery_ID; DtAdd = DBHelper.Query(SqlAdd); try { if (DtAdd.Rows.Count > 0) { DrAdd = DtAdd.Rows[0]; DrAdd["Contract_Delivery_ID"] = entity.Contract_Delivery_ID; DrAdd["Contract_Delivery_ContractID"] = entity.Contract_Delivery_ContractID; DrAdd["Contract_Delivery_DeliveryStatus"] = entity.Contract_Delivery_DeliveryStatus; DrAdd["Contract_Delivery_SysUserID"] = entity.Contract_Delivery_SysUserID; DrAdd["Contract_Delivery_DocNo"] = entity.Contract_Delivery_DocNo; DrAdd["Contract_Delivery_Name"] = entity.Contract_Delivery_Name; DrAdd["Contract_Delivery_CompanyName"] = entity.Contract_Delivery_CompanyName; DrAdd["Contract_Delivery_Code"] = entity.Contract_Delivery_Code; DrAdd["Contract_Delivery_Amount"] = entity.Contract_Delivery_Amount; DrAdd["Contract_Delivery_Note"] = entity.Contract_Delivery_Note; DrAdd["Contract_Delivery_AccpetNote"] = entity.Contract_Delivery_AccpetNote; DrAdd["Contract_Delivery_Addtime"] = entity.Contract_Delivery_Addtime; DrAdd["Contract_Delivery_Site"] = entity.Contract_Delivery_Site; DBHelper.SaveChanges(SqlAdd, DtAdd); } else { return(false); } } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } return(true); }
public virtual ContractDeliveryInfo GetContractDeliveryBySN(string SN) { ContractDeliveryInfo entity = null; SqlDataReader RdrList = null; try { string SqlList; SqlList = "SELECT * FROM Contract_Delivery WHERE Contract_Delivery_DocNo = '" + SN + "'"; RdrList = DBHelper.ExecuteReader(SqlList); if (RdrList.Read()) { entity = new ContractDeliveryInfo(); entity.Contract_Delivery_ID = Tools.NullInt(RdrList["Contract_Delivery_ID"]); entity.Contract_Delivery_ContractID = Tools.NullInt(RdrList["Contract_Delivery_ContractID"]); entity.Contract_Delivery_DeliveryStatus = Tools.NullInt(RdrList["Contract_Delivery_DeliveryStatus"]); entity.Contract_Delivery_SysUserID = Tools.NullInt(RdrList["Contract_Delivery_SysUserID"]); entity.Contract_Delivery_DocNo = Tools.NullStr(RdrList["Contract_Delivery_DocNo"]); entity.Contract_Delivery_Name = Tools.NullStr(RdrList["Contract_Delivery_Name"]); entity.Contract_Delivery_CompanyName = Tools.NullStr(RdrList["Contract_Delivery_CompanyName"]); entity.Contract_Delivery_Code = Tools.NullStr(RdrList["Contract_Delivery_Code"]); entity.Contract_Delivery_Amount = Tools.NullDbl(RdrList["Contract_Delivery_Amount"]); entity.Contract_Delivery_Note = Tools.NullStr(RdrList["Contract_Delivery_Note"]); entity.Contract_Delivery_AccpetNote = Tools.NullStr(RdrList["Contract_Delivery_AccpetNote"]); entity.Contract_Delivery_Addtime = Tools.NullDate(RdrList["Contract_Delivery_Addtime"]); entity.Contract_Delivery_Site = Tools.NullStr(RdrList["Contract_Delivery_Site"]); } return(entity); } catch (Exception ex) { throw ex; } finally { if (RdrList != null) { RdrList.Close(); RdrList = null; } } }
public virtual bool AddContractDelivery(ContractDeliveryInfo entity) { string SqlAdd = null; DataTable DtAdd = null; DataRow DrAdd = null; SqlAdd = "SELECT TOP 0 * FROM Contract_Delivery"; DtAdd = DBHelper.Query(SqlAdd); DrAdd = DtAdd.NewRow(); DrAdd["Contract_Delivery_ID"] = entity.Contract_Delivery_ID; DrAdd["Contract_Delivery_ContractID"] = entity.Contract_Delivery_ContractID; DrAdd["Contract_Delivery_DeliveryStatus"] = entity.Contract_Delivery_DeliveryStatus; DrAdd["Contract_Delivery_SysUserID"] = entity.Contract_Delivery_SysUserID; DrAdd["Contract_Delivery_DocNo"] = entity.Contract_Delivery_DocNo; DrAdd["Contract_Delivery_Name"] = entity.Contract_Delivery_Name; DrAdd["Contract_Delivery_CompanyName"] = entity.Contract_Delivery_CompanyName; DrAdd["Contract_Delivery_Code"] = entity.Contract_Delivery_Code; DrAdd["Contract_Delivery_Amount"] = entity.Contract_Delivery_Amount; DrAdd["Contract_Delivery_Note"] = entity.Contract_Delivery_Note; DrAdd["Contract_Delivery_AccpetNote"] = entity.Contract_Delivery_AccpetNote; DrAdd["Contract_Delivery_Addtime"] = entity.Contract_Delivery_Addtime; DrAdd["Contract_Delivery_Site"] = entity.Contract_Delivery_Site; DtAdd.Rows.Add(DrAdd); try { DBHelper.SaveChanges(SqlAdd, DtAdd); return(true); } catch (Exception ex) { throw ex; } finally { DtAdd.Dispose(); } }
public virtual bool EditContractDelivery(ContractDeliveryInfo entity) { return(MyDAL.EditContractDelivery(entity)); }