Exemplo n.º 1
0
        public virtual bool AddMemberAccountOrders(MemberAccountOrdersInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

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

            DrAdd["Account_Orders_ID"]          = entity.Account_Orders_ID;
            DrAdd["Account_Orders_MemberID"]    = entity.Account_Orders_MemberID;
            DrAdd["Account_Orders_SupplierID"]  = entity.Account_Orders_SupplierID;
            DrAdd["Account_Orders_AccountType"] = entity.Account_Orders_AccountType;
            DrAdd["Account_Orders_SN"]          = entity.Account_Orders_SN;
            DrAdd["Account_Orders_Amount"]      = entity.Account_Orders_Amount;
            DrAdd["Account_Orders_Status"]      = entity.Account_Orders_Status;
            DrAdd["Account_Orders_Addtime"]     = entity.Account_Orders_Addtime;

            DtAdd.Rows.Add(DrAdd);
            try
            {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
        }
Exemplo n.º 2
0
        public virtual bool EditMemberAccountOrders(MemberAccountOrdersInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Member_Account_Orders WHERE Account_Orders_ID = " + entity.Account_Orders_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try
            {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Account_Orders_ID"]          = entity.Account_Orders_ID;
                    DrAdd["Account_Orders_MemberID"]    = entity.Account_Orders_MemberID;
                    DrAdd["Account_Orders_SupplierID"]  = entity.Account_Orders_SupplierID;
                    DrAdd["Account_Orders_AccountType"] = entity.Account_Orders_AccountType;
                    DrAdd["Account_Orders_SN"]          = entity.Account_Orders_SN;
                    DrAdd["Account_Orders_Amount"]      = entity.Account_Orders_Amount;
                    DrAdd["Account_Orders_Status"]      = entity.Account_Orders_Status;
                    DrAdd["Account_Orders_Addtime"]     = entity.Account_Orders_Addtime;

                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DtAdd.Dispose();
            }
            return(true);
        }
Exemplo n.º 3
0
        public virtual MemberAccountOrdersInfo GetMemberAccountOrdersByOrdersSN(string OrdersSN)
        {
            MemberAccountOrdersInfo entity  = null;
            SqlDataReader           RdrList = null;

            try
            {
                string SqlList;
                SqlList = "SELECT * FROM Member_Account_Orders WHERE Account_Orders_SN = '" + OrdersSN + "'";
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new MemberAccountOrdersInfo();

                    entity.Account_Orders_ID          = Tools.NullInt(RdrList["Account_Orders_ID"]);
                    entity.Account_Orders_MemberID    = Tools.NullInt(RdrList["Account_Orders_MemberID"]);
                    entity.Account_Orders_SupplierID  = Tools.NullInt(RdrList["Account_Orders_SupplierID"]);
                    entity.Account_Orders_AccountType = Tools.NullInt(RdrList["Account_Orders_AccountType"]);
                    entity.Account_Orders_SN          = Tools.NullStr(RdrList["Account_Orders_SN"]);
                    entity.Account_Orders_Amount      = Tools.NullDbl(RdrList["Account_Orders_Amount"]);
                    entity.Account_Orders_Status      = Tools.NullInt(RdrList["Account_Orders_Status"]);
                    entity.Account_Orders_Addtime     = Tools.NullDate(RdrList["Account_Orders_Addtime"]);
                }

                return(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
Exemplo n.º 4
0
 public virtual bool EditMemberAccountOrders(MemberAccountOrdersInfo entity)
 {
     return(MyDAL.EditMemberAccountOrders(entity));
 }