Example #1
0
        public virtual bool AddStockoutBooking(StockoutBookingInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Stockout_ID"]               = entity.Stockout_ID;
            DrAdd["Stockout_Product_Name"]     = entity.Stockout_Product_Name;
            DrAdd["Stockout_Product_Describe"] = entity.Stockout_Product_Describe;
            DrAdd["Stockout_Member_Name"]      = entity.Stockout_Member_Name;
            DrAdd["Stockout_Member_Tel"]       = entity.Stockout_Member_Tel;
            DrAdd["Stockout_Member_Email"]     = entity.Stockout_Member_Email;
            DrAdd["Stockout_IsRead"]           = entity.Stockout_IsRead;
            DrAdd["Stockout_Addtime"]          = entity.Stockout_Addtime;
            DrAdd["Stockout_Site"]             = entity.Stockout_Site;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Example #2
0
 public virtual bool EditStockoutBooking(StockoutBookingInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "1da083a0-f751-4a93-995e-ca3c1edf44cc"))
     {
         return(MyDAL.EditStockoutBooking(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:1da083a0-f751-4a93-995e-ca3c1edf44cc错误");
     }
 }
Example #3
0
 public virtual bool AddStockoutBooking(StockoutBookingInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "342a2ee7-c8eb-4ed6-8ecc-eac99e7623ff"))
     {
         return(MyDAL.AddStockoutBooking(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:342a2ee7-c8eb-4ed6-8ecc-eac99e7623ff错误");
     }
 }
Example #4
0
        public virtual IList <StockoutBookingInfo> GetStockoutBookings(QueryInfo Query)
        {
            int PageSize;
            int CurrentPage;
            IList <StockoutBookingInfo> entitys = null;
            StockoutBookingInfo         entity = null;
            string        SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader RdrList = null;

            try
            {
                CurrentPage = Query.CurrentPage;
                PageSize    = Query.PageSize;
                SqlTable    = "Stockout_Booking";
                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 <StockoutBookingInfo>();
                    while (RdrList.Read())
                    {
                        entity                           = new StockoutBookingInfo();
                        entity.Stockout_ID               = Tools.NullInt(RdrList["Stockout_ID"]);
                        entity.Stockout_Product_Name     = Tools.NullStr(RdrList["Stockout_Product_Name"]);
                        entity.Stockout_Product_Describe = Tools.NullStr(RdrList["Stockout_Product_Describe"]);
                        entity.Stockout_Member_Name      = Tools.NullStr(RdrList["Stockout_Member_Name"]);
                        entity.Stockout_Member_Tel       = Tools.NullStr(RdrList["Stockout_Member_Tel"]);
                        entity.Stockout_Member_Email     = Tools.NullStr(RdrList["Stockout_Member_Email"]);
                        entity.Stockout_IsRead           = Tools.NullInt(RdrList["Stockout_IsRead"]);
                        entity.Stockout_Addtime          = Tools.NullDate(RdrList["Stockout_Addtime"]);
                        entity.Stockout_Site             = Tools.NullStr(RdrList["Stockout_Site"]);

                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Example #5
0
        public virtual bool EditStockoutBooking(StockoutBookingInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Stockout_Booking WHERE Stockout_ID = " + entity.Stockout_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Stockout_ID"]               = entity.Stockout_ID;
                    DrAdd["Stockout_Product_Name"]     = entity.Stockout_Product_Name;
                    DrAdd["Stockout_Product_Describe"] = entity.Stockout_Product_Describe;
                    DrAdd["Stockout_Member_Name"]      = entity.Stockout_Member_Name;
                    DrAdd["Stockout_Member_Tel"]       = entity.Stockout_Member_Tel;
                    DrAdd["Stockout_Member_Email"]     = entity.Stockout_Member_Email;
                    DrAdd["Stockout_IsRead"]           = entity.Stockout_IsRead;
                    DrAdd["Stockout_Addtime"]          = entity.Stockout_Addtime;
                    DrAdd["Stockout_Site"]             = entity.Stockout_Site;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Example #6
0
        public virtual StockoutBookingInfo GetStockoutBookingByID(int ID)
        {
            StockoutBookingInfo entity  = null;
            SqlDataReader       RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Stockout_Booking WHERE Stockout_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new StockoutBookingInfo();

                    entity.Stockout_ID               = Tools.NullInt(RdrList["Stockout_ID"]);
                    entity.Stockout_Product_Name     = Tools.NullStr(RdrList["Stockout_Product_Name"]);
                    entity.Stockout_Product_Describe = Tools.NullStr(RdrList["Stockout_Product_Describe"]);
                    entity.Stockout_Member_Name      = Tools.NullStr(RdrList["Stockout_Member_Name"]);
                    entity.Stockout_Member_Tel       = Tools.NullStr(RdrList["Stockout_Member_Tel"]);
                    entity.Stockout_Member_Email     = Tools.NullStr(RdrList["Stockout_Member_Email"]);
                    entity.Stockout_IsRead           = Tools.NullInt(RdrList["Stockout_IsRead"]);
                    entity.Stockout_Addtime          = Tools.NullDate(RdrList["Stockout_Addtime"]);
                    entity.Stockout_Site             = Tools.NullStr(RdrList["Stockout_Site"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }