Пример #1
0
        public virtual bool AddContractDeliveryGoods(ContractDeliveryGoodsInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT TOP 0 * FROM Contract_Delivery_Goods";
            DtAdd  = DBHelper.Query(SqlAdd);
            DrAdd  = DtAdd.NewRow();

            DrAdd["Delivery_Goods_ID"]           = entity.Delivery_Goods_ID;
            DrAdd["Delivery_Goods_GoodsID"]      = entity.Delivery_Goods_GoodsID;
            DrAdd["Delivery_Goods_DeliveryID"]   = entity.Delivery_Goods_DeliveryID;
            DrAdd["Delivery_Goods_Amount"]       = entity.Delivery_Goods_Amount;
            DrAdd["Delivery_Goods_Status"]       = entity.Delivery_Goods_Status;
            DrAdd["Delivery_Goods_AcceptAmount"] = entity.Delivery_Goods_AcceptAmount;
            DrAdd["Delivery_Goods_Unit"]         = entity.Delivery_Goods_Unit;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Пример #2
0
        public virtual IList <ContractDeliveryGoodsInfo> GetContractDeliveryGoodss(QueryInfo Query)
        {
            int PageSize;
            int CurrentPage;
            IList <ContractDeliveryGoodsInfo> entitys = null;
            ContractDeliveryGoodsInfo         entity = null;
            string        SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader RdrList = null;

            try
            {
                CurrentPage = Query.CurrentPage;
                PageSize    = Query.PageSize;
                SqlTable    = "Contract_Delivery_Goods";
                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 <ContractDeliveryGoodsInfo>();
                    while (RdrList.Read())
                    {
                        entity = new ContractDeliveryGoodsInfo();
                        entity.Delivery_Goods_ID           = Tools.NullInt(RdrList["Delivery_Goods_ID"]);
                        entity.Delivery_Goods_GoodsID      = Tools.NullInt(RdrList["Delivery_Goods_GoodsID"]);
                        entity.Delivery_Goods_DeliveryID   = Tools.NullInt(RdrList["Delivery_Goods_DeliveryID"]);
                        entity.Delivery_Goods_Amount       = Tools.NullInt(RdrList["Delivery_Goods_Amount"]);
                        entity.Delivery_Goods_Status       = Tools.NullInt(RdrList["Delivery_Goods_Status"]);
                        entity.Delivery_Goods_AcceptAmount = Tools.NullInt(RdrList["Delivery_Goods_AcceptAmount"]);
                        entity.Delivery_Goods_Unit         = Tools.NullStr(RdrList["Delivery_Goods_Unit"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Пример #3
0
        public virtual IList <ContractDeliveryGoodsInfo> GetContractDeliveryGoodssByDeliveryID(int ID)
        {
            IList <ContractDeliveryGoodsInfo> entitys = null;
            ContractDeliveryGoodsInfo         entity  = null;
            string        SqlList;
            SqlDataReader RdrList = null;

            try
            {
                SqlList = "select * from Contract_Delivery_Goods where Delivery_Goods_DeliveryID=" + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <ContractDeliveryGoodsInfo>();
                    while (RdrList.Read())
                    {
                        entity = new ContractDeliveryGoodsInfo();
                        entity.Delivery_Goods_ID           = Tools.NullInt(RdrList["Delivery_Goods_ID"]);
                        entity.Delivery_Goods_GoodsID      = Tools.NullInt(RdrList["Delivery_Goods_GoodsID"]);
                        entity.Delivery_Goods_DeliveryID   = Tools.NullInt(RdrList["Delivery_Goods_DeliveryID"]);
                        entity.Delivery_Goods_Amount       = Tools.NullInt(RdrList["Delivery_Goods_Amount"]);
                        entity.Delivery_Goods_Status       = Tools.NullInt(RdrList["Delivery_Goods_Status"]);
                        entity.Delivery_Goods_AcceptAmount = Tools.NullInt(RdrList["Delivery_Goods_AcceptAmount"]);
                        entity.Delivery_Goods_Unit         = Tools.NullStr(RdrList["Delivery_Goods_Unit"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Пример #4
0
        public virtual ContractDeliveryGoodsInfo GetContractDeliveryGoodsByID(int ID)
        {
            ContractDeliveryGoodsInfo entity  = null;
            SqlDataReader             RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Contract_Delivery_Goods WHERE Delivery_Goods_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new ContractDeliveryGoodsInfo();

                    entity.Delivery_Goods_ID           = Tools.NullInt(RdrList["Delivery_Goods_ID"]);
                    entity.Delivery_Goods_GoodsID      = Tools.NullInt(RdrList["Delivery_Goods_GoodsID"]);
                    entity.Delivery_Goods_DeliveryID   = Tools.NullInt(RdrList["Delivery_Goods_DeliveryID"]);
                    entity.Delivery_Goods_Amount       = Tools.NullInt(RdrList["Delivery_Goods_Amount"]);
                    entity.Delivery_Goods_Status       = Tools.NullInt(RdrList["Delivery_Goods_Status"]);
                    entity.Delivery_Goods_AcceptAmount = Tools.NullInt(RdrList["Delivery_Goods_AcceptAmount"]);
                    entity.Delivery_Goods_Unit         = Tools.NullStr(RdrList["Delivery_Goods_Unit"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Пример #5
0
        public virtual bool EditContractDeliveryGoods(ContractDeliveryGoodsInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Contract_Delivery_Goods WHERE Delivery_Goods_ID = " + entity.Delivery_Goods_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Delivery_Goods_ID"]           = entity.Delivery_Goods_ID;
                    DrAdd["Delivery_Goods_GoodsID"]      = entity.Delivery_Goods_GoodsID;
                    DrAdd["Delivery_Goods_DeliveryID"]   = entity.Delivery_Goods_DeliveryID;
                    DrAdd["Delivery_Goods_Amount"]       = entity.Delivery_Goods_Amount;
                    DrAdd["Delivery_Goods_Status"]       = entity.Delivery_Goods_Status;
                    DrAdd["Delivery_Goods_AcceptAmount"] = entity.Delivery_Goods_AcceptAmount;
                    DrAdd["Delivery_Goods_Unit"]         = entity.Delivery_Goods_Unit;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Пример #6
0
 public virtual bool EditContractDeliveryGoods(ContractDeliveryGoodsInfo entity)
 {
     return(MyDAL.EditContractDeliveryGoods(entity));
 }