Exemplo n.º 1
0
        /// <summary>
        /// 返回商品的 VIP专柜价格
        /// </summary>
        /// <param name="GoodsId"></param>
        /// <returns></returns>
        public double ReadVIPPrice(int GoodsId)
        {
            string  sql = string.Format("select max(VIPPrice) as VIPPrice  from view_comgoods where GoodsId = {0} and comId= {1} ", GoodsId, m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            return(DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "VIPPrice", 0));
        }
Exemplo n.º 2
0
        public bool Load()
        {
            string  sql = string.Format("select * from Invoice where id={0}", m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id               = DBTool.GetIntFromRow(row, "Id", 0);
                m_BranchId         = DBTool.GetIntFromRow(row, "BranchId", 0);
                m_ComId            = DBTool.GetIntFromRow(row, "ComId", 0);
                m_OrderStatementId = DBTool.GetIntFromRow(row, "OrderStatementId", 0);
                m_InvoiceRequireId = DBTool.GetIntFromRow(row, "InvoiceRequireId", 0);
                m_InvoiceDate      = DBTool.GetDateTimeFromRow(row, "InvoiceDate");
                m_InvoiceNo        = DBTool.GetStringFromRow(row, "InvoiceNo", "");
                m_InvoiceType      = DBTool.GetStringFromRow(row, "InvoiceType", "");
                m_InvoiceMoney     = DBTool.GetDoubleFromRow(row, "InvoiceMoney", 0);
                m_Memo             = DBTool.GetStringFromRow(row, "Memo", "");
                m_UpdateTime       = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                m_UserId           = DBTool.GetIntFromRow(row, "UserId", 0);
                m_PrintNum         = DBTool.GetIntFromRow(row, "PrintNum", 0);
                m_PrintTime        = DBTool.GetDateTimeFromRow(row, "PrintTime");
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        public bool Load()
        {
            string  sql = string.Format("select * from InvoiceRequire where id={0}", m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id              = DBTool.GetIntFromRow(row, "Id", 0);
                m_ComId           = DBTool.GetIntFromRow(row, "ComId", 0);
                m_StatementId     = DBTool.GetIntFromRow(row, "StatementId", 0);
                m_InvoiceName     = DBTool.GetStringFromRow(row, "InvoiceName", "");
                m_InvoiceType     = DBTool.GetStringFromRow(row, "InvoiceType", "");
                m_InvoiceContent  = DBTool.GetStringFromRow(row, "InvoiceContent", "");
                m_InvoiceAmount   = DBTool.GetDoubleFromRow(row, "InvoiceAmount", 0);
                m_InvoiceMemo     = DBTool.GetStringFromRow(row, "InvoiceMemo", "");
                m_UserId          = DBTool.GetIntFromRow(row, "UserId", 0);
                m_UpdateTime      = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                m_InvoiceStatus   = DBTool.GetStringFromRow(row, "InvoiceStatus", "");
                m_MemberInvoiceId = DBTool.GetIntFromRow(row, "MemberInvoiceId", 0);
                m_applicationNo   = DBTool.GetStringFromRow(row, "applicationNo", "");
                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 更改对账单 开票金额
        /// </summary>
        /// <param name="osId"></param>
        /// <returns></returns>
        public bool UpdateOrderStatementInvoiceData(int osId)
        {
            string         sql = string.Format(@"select InvoiceStatus,Sum(invoiceAmount) as InvoiceAmount  
    from InvoiceRequire where StatementId={0} group by InvoiceStatus ", osId);
            DataSet        ds  = m_dbo.GetDataSet(sql);
            OrderStatement os  = new OrderStatement();

            os.Id = osId;
            os.Load();
            os.InvoiceMoney  = 0;
            os.NeedToInvoice = 0;
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (DBTool.GetStringFromRow(row, "InvoiceStatus", "") == CommenClass.InvoiceStatus.待开票.ToString())
                    {
                        os.NeedToInvoice = DBTool.GetDoubleFromRow(row, "InvoiceAmount", 0);
                    }
                    else if (DBTool.GetStringFromRow(row, "InvoiceStatus", "") == CommenClass.InvoiceStatus.已开票.ToString())
                    {
                        os.InvoiceMoney = DBTool.GetDoubleFromRow(row, "InvoiceAmount", 0);
                    }
                }
            }
            if (os.Save() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 超额付清
        /// </summary>
        /// <param name="ChargeOff"></param>
        /// <param name="ReceiveMoney"></param>
        private void UpdateOrderPayStatysCEFQ(double ChargeOff, double ReceiveMoney)
        {
            //将该对账单所有的订单收款状态初始化
            string sql = string.Format(@"update [Order] set PayStatus='已对账',PaidMoney=0,ChargeOff=0 
            where Id in( select OrderId from OrderStatementDetail where OrderStatementId={0})", this.Id);

            m_dbo.ExecuteNonQuery(sql);

            //读取改对账单对应的所用订单列表
            sql = string.Format("select * from View_OrderStatementDetail  where OrderStatementId={0} order by OrderId ", this.Id);
            DataSet ds = m_dbo.GetDataSet(sql);
            //循环 订单列表,按照时间先后进行销账处理
            double allchargeoff    = ChargeOff;
            double allreceivemoney = ReceiveMoney;

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                DataRow row       = ds.Tables[0].Rows[i];
                int     orderId   = DBTool.GetIntFromRow(row, "OrderId", 0);
                double  summoney  = Math.Round(DBTool.GetDoubleFromRow(row, "SumMoney", 0), 2);
                string  paystatus = CommenClass.PayStatus.已付款.ToString();
                double  chargeoff = summoney;
                double  paidmoney = summoney;
                allchargeoff    -= chargeoff;
                allreceivemoney -= paidmoney;
                if (i == ds.Tables[0].Rows.Count - 1)
                {
                    paidmoney = summoney + allreceivemoney;
                }
                sql = string.Format("update [Order] set PayStatus='{0}',PaidMoney={1},ChargeOff={2} where Id={3}", paystatus, paidmoney, chargeoff, orderId);
                m_dbo.ExecuteNonQuery(sql);
            }
        }
Exemplo n.º 6
0
        public bool Load()
        {
            string  sql = string.Format("select * from TPI_Goods where GoodsId={0} and ProjectId={1}", GoodsId, ProjectId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id              = DBTool.GetIntFromRow(row, "Id", 0);
                Sku             = DBTool.GetStringFromRow(row, "Sku", "");
                SkuName         = DBTool.GetStringFromRow(row, "SkuName", "");
                ReferencePrice  = DBTool.GetDoubleFromRow(row, "ReferencePrice", 0);
                AgreementPrice  = DBTool.GetDoubleFromRow(row, "AgreementPrice", 0);
                GoodsId         = DBTool.GetIntFromRow(row, "GoodsId", 0);
                IshaveImage     = DBTool.GetIntFromRow(row, "IshaveImage", 0);
                IsUnitAgreement = DBTool.GetIntFromRow(row, "IsUnitAgreement", 0);
                State           = DBTool.GetIntFromRow(row, "State", 0);
                ProjectId       = DBTool.GetIntFromRow(row, "ProjectId", 0);
                Stock           = DBTool.GetIntFromRow(row, "Stock", 0);
                PushState       = DBTool.GetIntFromRow(row, "PushState", 0);
                ResultMsg       = DBTool.GetStringFromRow(row, "ResultMsg", "");
                AddTime         = DBTool.GetDateTimeFromRow(row, "AddTime");
                return(true);
            }
            return(false);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加新的付款记录后,更改对账单的付款金额和状态
        /// </summary>
        /// <returns></returns>
        public int UpdateStatus()
        {
            this.Load();
            string  sql       = string.Format("select SUM(ChargeOff) as ChargeOff,SUM(PayMoney) as PayMoney from PurchasePay where PurchaseStatementId={0} ", this.Id);
            DataSet ds        = m_dbo.GetDataSet(sql);
            double  chargeOff = DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "ChargeOff", 0);
            double  payMoney  = DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "PayMoney", 0);

            this.PaidMoney = payMoney;
            if (chargeOff >= this.SumMoney)
            {
                if (chargeOff == payMoney)
                {
                    this.PayStatus = CommenClass.PayStatus.全额付清.ToString();
                }
                else if (chargeOff > payMoney)
                {
                    this.PayStatus = CommenClass.PayStatus.优惠付清.ToString();
                }
                else if (chargeOff < payMoney)
                {
                    this.PayStatus = CommenClass.PayStatus.超额付清.ToString();
                }
            }
            else if (chargeOff > 0)
            {
                this.PayStatus = CommenClass.PayStatus.部分付款.ToString();
            }
            else if (chargeOff == 0)
            {
                this.PayStatus = CommenClass.PayStatus.未付款.ToString();
            }
            return(this.Save());
        }
Exemplo n.º 8
0
        public bool Load(int NeedToPurchaseId, int GoodsId)
        {
            string  sql = string.Format("select * from NeedToPurchaseDetail where NeedToPurchaseId ={0} and GoodsId={1}", NeedToPurchaseId, GoodsId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id = DBTool.GetIntFromRow(row, "Id", 0);
                m_NeedToPurchaseId = DBTool.GetIntFromRow(row, "NeedToPurchaseId", 0);
                m_GoodsId          = DBTool.GetIntFromRow(row, "GoodsId", 0);
                m_Model            = DBTool.GetStringFromRow(row, "Model", "");
                m_Num          = DBTool.GetIntFromRow(row, "Num", 0);
                m_UserId       = DBTool.GetIntFromRow(row, "UserId", 0);
                m_PurchaseType = DBTool.GetStringFromRow(row, "PurchaseType", "");
                m_PurchaseMemo = DBTool.GetStringFromRow(row, "PurchaseMemo", "");
                m_CreditCard   = DBTool.GetStringFromRow(row, "CreditCard", "");
                m_UpdateTime   = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                m_LackNum      = DBTool.GetIntFromRow(row, "LackNum", 0);
                m_Emergency    = DBTool.GetIntFromRow(row, "Emergency", 0);
                m_GoodsMemo    = DBTool.GetStringFromRow(row, "GoodsMemo", "");
                m_SupplierId   = DBTool.GetIntFromRow(row, "SupplierId", 0);
                m_InPrice      = DBTool.GetDoubleFromRow(row, "InPrice", 0);
                SprInvoiceType = DBTool.GetStringFromRow(row, "SprInvoiceType", "");
                SprTaxRate     = DBTool.GetDoubleFromRow(row, "SprTaxRate", 0);
                return(true);
            }
            return(false);
        }
Exemplo n.º 9
0
        public bool Load(int pId, int goodsId)
        {
            string  sql = string.Format("select * from PurchaseDetail where PurchaseId={0} and GoodsId={1}", pId, goodsId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id          = DBTool.GetIntFromRow(row, "Id", 0);
                m_PurchaseId  = DBTool.GetIntFromRow(row, "PurchaseId", 0);
                m_GoodsId     = DBTool.GetIntFromRow(row, "GoodsId", 0);
                m_StoreId     = DBTool.GetIntFromRow(row, "StoreId", 0);
                m_Model       = DBTool.GetStringFromRow(row, "Model", "");
                m_BillsPrice  = DBTool.GetDoubleFromRow(row, "BillsPrice", 0);
                m_InPrice     = DBTool.GetDoubleFromRow(row, "InPrice", 0);
                m_Num         = DBTool.GetIntFromRow(row, "Num", 0);
                m_Amount      = DBTool.GetDoubleFromRow(row, "Amount", 0);
                m_OldStore    = DBTool.GetIntFromRow(row, "OldStore", 0);
                m_OldAC       = DBTool.GetDoubleFromRow(row, "OldAC", 0);
                m_ReceivedNum = DBTool.GetIntFromRow(row, "ReceivedNum", 0);
                m_Emergency   = DBTool.GetIntFromRow(row, "Emergency", 0);
                TaxInPrice    = DBTool.GetDoubleFromRow(row, "TaxInPrice", 0);
                return(true);
            }
            return(false);
        }
Exemplo n.º 10
0
        public bool Load()
        {
            string  sql = string.Format("select * from GoodsStoreDetail where id={0}", m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id         = DBTool.GetIntFromRow(row, "Id", 0);
                m_StoreId    = DBTool.GetIntFromRow(row, "StoreId", 0);
                m_GoodsId    = DBTool.GetIntFromRow(row, "GoodsId", 0);
                m_Model      = DBTool.GetStringFromRow(row, "Model", "");
                m_OldNum     = DBTool.GetIntFromRow(row, "OldNum", 0);
                m_Num        = DBTool.GetIntFromRow(row, "Num", 0);
                m_NewNum     = DBTool.GetIntFromRow(row, "NewNum", 0);
                m_Operate    = DBTool.GetStringFromRow(row, "Operate", "");
                m_RelationId = DBTool.GetIntFromRow(row, "RelationId", 0);
                m_Memo       = DBTool.GetStringFromRow(row, "Memo", "");
                m_UserId     = DBTool.GetIntFromRow(row, "UserId", 0);
                m_AC         = DBTool.GetDoubleFromRow(row, "AC", 0);
                TaxAC        = DBTool.GetDoubleFromRow(row, "TaxAC", 0);
                m_UpdateTime = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                return(true);
            }
            return(false);
        }
Exemplo n.º 11
0
        public bool Load()
        {
            string  sql = string.Format("select * from TPI_SupplierOrder where id={0}", Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id           = DBTool.GetIntFromRow(row, "Id", 0);
                OrderId      = DBTool.GetIntFromRow(row, "OrderId", 0);
                RealName     = DBTool.GetStringFromRow(row, "RealName", "");
                Address      = DBTool.GetStringFromRow(row, "Address", "");
                DetailStreet = DBTool.GetStringFromRow(row, "DetailStreet", "");
                ZipCode      = DBTool.GetStringFromRow(row, "ZipCode", "");
                Telephone    = DBTool.GetStringFromRow(row, "Telephone", "");
                Mobile       = DBTool.GetStringFromRow(row, "Mobile", "");
                Email        = DBTool.GetStringFromRow(row, "Email", "");
                Memo         = DBTool.GetStringFromRow(row, "Memo", "");
                Amount       = DBTool.GetDoubleFromRow(row, "Amount", 0);
                ShipFree     = DBTool.GetDoubleFromRow(row, "ShipFree", 0);
                GoodsList    = DBTool.GetStringFromRow(row, "GoodsList", "");
                UpdateTime   = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                UsersId      = DBTool.GetIntFromRow(row, "UsersId", 0);
                //Distribution = DBTool.GetIntFromRow(row, "Distribution", 0);
                return(true);
            }
            return(false);
        }
Exemplo n.º 12
0
        public bool Load()
        {
            string  sql = string.Format("select * from GoodStoreInventoryDetail where id={0}", ID);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                ID                = DBTool.GetIntFromRow(row, "ID", 0);
                FK_GSDetail_ID    = DBTool.GetIntFromRow(row, "FK_GSDetail_ID", 0);
                FK_Goods_ID       = DBTool.GetIntFromRow(row, "FK_Goods_ID", 0);
                FK_Store_ID       = DBTool.GetIntFromRow(row, "FK_Store_ID", 0);
                OldNum            = DBTool.GetIntFromRow(row, "OldNum", 0);
                NewNum            = DBTool.GetIntFromRow(row, "NewNum", 0);
                AC                = DBTool.GetDoubleFromRow(row, "AC", 0);
                CreateUser        = DBTool.GetIntFromRow(row, "CreateUser", 0);
                CreateTime        = DBTool.GetDateTimeFromRow(row, "CreateTime");
                OldSumMoney       = DBTool.GetDoubleFromRow(row, "OldSumMoney", 0);
                NewSumMoney       = DBTool.GetDoubleFromRow(row, "NewSumMoney", 0);
                FK_GSInventory_ID = DBTool.GetIntFromRow(row, "FK_GSInventory_ID", 0);

                return(true);
            }
            return(false);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 重新计算订单毛利 //该方法位置有问题
        /// </summary>
        /// <returns></returns>
        public bool CalcGrossProfit()
        {
            string sql = "";

            this.Load();
            OrderManager om      = new OrderManager();
            DataSet      details = om.ReadOrderDetail(this.Id);

            foreach (DataRow row in details.Tables[0].Rows)
            {
                //循环订单明细
                int goodsId = DBTool.GetIntFromRow(row, "GoodsId", 0);
                sql = string.Format("select AC, TaxAC from View_GoodsStore where BranchId={0} and GoodsId={1} and IsDefault=1  order by IsAvalible desc ", this.BranchId, goodsId);

                //更新商品成本
                DataSet ds = m_dbo.GetDataSet(sql);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    double AC    = DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "AC", 0);
                    double TaxAC = DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "TaxAC", 0);
                    sql = string.Format(@"update OrderDetail set AC={0} ,TaxAC={3} where OrderId={1} and GoodsId={2} ", AC, this.Id, goodsId, TaxAC);
                    m_dbo.ExecuteNonQuery(sql);
                }
            }

            //更新订单毛利
            sql = string.Format(@"update [Order] set GrossProfit = SumMoney/(1+TaxRate)-(select isnull(SUM(AC*Num),0) from OrderDetail where OrderId ={0}),
                                                     TaxGrossProfit = SumMoney - (select isnull(SUM(TaxAC*Num),0) from OrderDetail where OrderId ={0}) where Id ={0}", this.Id);
            return(m_dbo.ExecuteNonQuery(sql));
        }
Exemplo n.º 14
0
        public bool Load()
        {
            string  sql = string.Format("select * from Purchase where id={0}", m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id               = DBTool.GetIntFromRow(row, "Id", 0);
                m_BranchId         = DBTool.GetIntFromRow(row, "BranchId", 0);
                m_StoreId          = DBTool.GetIntFromRow(row, "StoreId", 0);
                m_SupplierId       = DBTool.GetIntFromRow(row, "SupplierId", 0);
                m_PurchaseType     = DBTool.GetStringFromRow(row, "PurchaseType", "");
                m_SumMoney         = DBTool.GetDoubleFromRow(row, "SumMoney", 0);
                m_PurchaseDate     = DBTool.GetDateTimeFromRow(row, "PurchaseDate");
                m_PurchaseUserId   = DBTool.GetIntFromRow(row, "PurchaseUserId", 0);
                m_IsPaid           = DBTool.GetIntFromRow(row, "IsPaid", 0);
                m_IsTax            = DBTool.GetIntFromRow(row, "IsTax", 0);
                m_IsConfirm        = DBTool.GetIntFromRow(row, "IsConfirm", 0);
                m_IsCashConfirm    = DBTool.GetIntFromRow(row, "IsCashConfirm", 0);
                m_Memo             = DBTool.GetStringFromRow(row, "Memo", "");
                m_UpdateTime       = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                m_UserId           = DBTool.GetIntFromRow(row, "UserId", 0);
                m_PurchaseStatus   = DBTool.GetStringFromRow(row, "PurchaseStatus", "");
                m_NeedToPurchaseId = DBTool.GetIntFromRow(row, "NeedToPurchaseId", 0);
                m_ReceiptUserId    = DBTool.GetIntFromRow(row, "ReceiptUserId", 0);
                m_ConfirmDate      = DBTool.GetDateTimeFromRow(row, "ConfirmDate");
                Tax     = DBTool.GetDoubleFromRow(row, "Tax", 0);
                TaxRate = DBTool.GetDoubleFromRow(row, "TaxRate", 0);

                return(true);
            }
            return(false);
        }
Exemplo n.º 15
0
 private bool LoadFromRow(DataRow row)
 {
     Id                = DBTool.GetIntFromRow(row, "Id", 0);
     SalesId           = DBTool.GetIntFromRow(row, "SalesId", 0);
     YearMonth         = DBTool.GetDateTimeFromRow(row, "YearMonth");
     Target            = DBTool.GetIntFromRow(row, "Target", 0);
     Finish            = DBTool.GetDoubleFromRow(row, "Finish", 0);
     FinishRatio       = DBTool.GetDoubleFromRow(row, "FinishRatio", 0);
     NewCustomer       = DBTool.GetDoubleFromRow(row, "NewCustomer", 0);
     OldCustormer      = DBTool.GetDoubleFromRow(row, "OldCustormer", 0);
     NewGrossProfit    = DBTool.GetDoubleFromRow(row, "NewGrossProfit", 0);
     OldGrossProfit    = DBTool.GetDoubleFromRow(row, "OldGrossProfit", 0);
     GrossProfit       = DBTool.GetDoubleFromRow(row, "GrossProfit", 0);
     NormalCost        = DBTool.GetDoubleFromRow(row, "NormalCost", 0);
     DLHSCost          = DBTool.GetDoubleFromRow(row, "DLHSCost", 0);
     SaleCost          = DBTool.GetDoubleFromRow(row, "SaleCost", 0);
     ProfitRatio       = DBTool.GetDoubleFromRow(row, "ProfitRatio", 0);
     ProfitFactor      = DBTool.GetDoubleFromRow(row, "ProfitFactor", 0);
     Commission        = DBTool.GetDoubleFromRow(row, "Commission", 0);
     CommissionConfirm = DBTool.GetIntFromRow(row, "CommissionConfirm", 0);
     DeadLine          = DBTool.GetDateTimeFromRow(row, "DeadLine");
     OverdueFactor     = DBTool.GetDoubleFromRow(row, "OverdueFactor", 0);
     Ammount           = DBTool.GetDoubleFromRow(row, "Ammount", 0);
     AmmountConfirm    = DBTool.GetIntFromRow(row, "AmmountConfirm", 0);
     UpdateTime        = DBTool.GetDateTimeFromRow(row, "UpdateTime");
     return(true);
 }
Exemplo n.º 16
0
        public bool OrderModifyPurchaseSave(DataTable dtNeedToPurchaseDetail, int branchId, int StoreId, string OrderModifyIdTable)
        {
            DataTable dt = dtNeedToPurchaseDetail.DefaultView.ToTable(true, "SupplierId", "UserId", "PurchaseType");

            if (dt.Rows.Count > 0)
            {
                int SId = 0;
                foreach (DataRow drSupplier in dt.Rows)
                {
                    int SupplierId = DBTool.GetIntFromRow(drSupplier, "SupplierId", 0);
                    if (SId == SupplierId && SupplierId != 0)
                    {
                        continue;
                    }
                    int      UserId       = DBTool.GetIntFromRow(drSupplier, "UserId", 0);
                    string   PurchaseType = DBTool.GetStringFromRow(drSupplier, "PurchaseType", "");
                    Purchase p            = new Purchase();
                    p.BranchId         = branchId;
                    p.NeedToPurchaseId = NeedToPurchaseId;
                    p.PurchaseStatus   = CommenClass.PurchaseStatus.未处理.ToString();
                    p.PurchaseType     = PurchaseType;
                    p.UserId           = 0;
                    p.StoreId          = StoreId;
                    p.SupplierId       = SupplierId;
                    p.PurchaseUserId   = UserId;
                    int purchaseId = p.Save();
                    if (purchaseId > 0)
                    {
                        string    sql = string.Format("SupplierId='{0}'", SupplierId);
                        DataRow[] drw = dtNeedToPurchaseDetail.Select(sql);
                        foreach (DataRow dr in drw)
                        {
                            PurchaseDetail pd = new PurchaseDetail();
                            pd.PurchaseId = purchaseId;
                            pd.GoodsId    = DBTool.GetIntFromRow(dr, "GoodsId", 0);
                            pd.StoreId    = StoreId;
                            pd.Model      = "";
                            pd.BillsPrice = DBTool.GetDoubleFromRow(dr, "InPrice", 0);
                            pd.InPrice    = DBTool.GetDoubleFromRow(dr, "InPrice", 0);
                            pd.Num        = DBTool.GetIntFromRow(dr, "LackNum", 0);
                            pd.Amount     = pd.InPrice * pd.Num;
                            pd.Save();
                        }
                        SId = SupplierId;
                        PurchaseManager pm = new PurchaseManager();
                        pm.UpdatePurchaseSumMoney(purchaseId);
                    }
                }
                if (SId > 0)
                {
                    OrderModify om = new OrderModify();
                    return(om.UpdatePurchaseType(OrderModifyIdTable));
                }
            }
            return(false);
        }
Exemplo n.º 17
0
        public bool Load()
        {
            string  sql = string.Format("select * from Supplier where id={0}", m_Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                m_Id                         = DBTool.GetIntFromRow(row, "Id", 0);
                m_AddTime                    = DBTool.GetDateTimeFromRow(row, "AddTime");
                m_UpdateTime                 = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                m_Company                    = DBTool.GetStringFromRow(row, "Company", "");
                m_ShortName                  = DBTool.GetStringFromRow(row, "ShortName", "");
                m_Type                       = DBTool.GetStringFromRow(row, "Type", "");
                m_Attitude                   = DBTool.GetStringFromRow(row, "Attitude", "");
                m_PriceSheet                 = DBTool.GetIntFromRow(row, "PriceSheet", 0);
                m_InvoiceType                = DBTool.GetStringFromRow(row, "InvoiceType", "");
                m_PayType                    = DBTool.GetStringFromRow(row, "PayType", "");
                m_YearTarget                 = DBTool.GetIntFromRow(row, "YearTarget", 0);
                m_MonthAmount                = DBTool.GetDoubleFromRow(row, "MonthAmount", 0);
                m_LinkMan1                   = DBTool.GetStringFromRow(row, "LinkMan1", "");
                m_LinkMan2                   = DBTool.GetStringFromRow(row, "LinkMan2", "");
                m_TelPhone1                  = DBTool.GetStringFromRow(row, "TelPhone1", "");
                m_TelPhone2                  = DBTool.GetStringFromRow(row, "TelPhone2", "");
                m_Mobile1                    = DBTool.GetStringFromRow(row, "Mobile1", "");
                m_Mobile2                    = DBTool.GetStringFromRow(row, "Mobile2", "");
                m_QQ1                        = DBTool.GetStringFromRow(row, "QQ1", "");
                m_QQ2                        = DBTool.GetStringFromRow(row, "QQ2", "");
                m_Address                    = DBTool.GetStringFromRow(row, "Address", "");
                m_MainBrand                  = DBTool.GetStringFromRow(row, "MainBrand", "");
                m_Major                      = DBTool.GetStringFromRow(row, "Major", "");
                m_BillsDiscount              = DBTool.GetIntFromRow(row, "BillsDiscount", 100);
                m_Branchid                   = DBTool.GetIntFromRow(row, "BranchId", 1);
                m_ContractType               = DBTool.GetStringFromRow(row, "ContractType", "");
                m_IsChangRefund              = DBTool.GetStringFromRow(row, "IsChangRefund", "");
                m_PurchasRewards             = DBTool.GetStringFromRow(row, "PurchasRewards", "");
                m_PaymentMethod              = DBTool.GetStringFromRow(row, "PaymentMethod", "");
                m_AccountNum                 = DBTool.GetStringFromRow(row, "AccountNum", "");
                m_TaxpayerIdentificationCode = DBTool.GetStringFromRow(row, "TaxpayerIdentificationCode", "");
                m_OpenBank                   = DBTool.GetStringFromRow(row, "OpenBank", "");
                m_FinancialLinkMan           = DBTool.GetStringFromRow(row, "FinancialLinkMan", "");
                m_FinancialTelPhone          = DBTool.GetStringFromRow(row, "FinancialTelPhone", "");
                m_Other                      = DBTool.GetStringFromRow(row, "Other", "");
                m_GoodsTypeId                = DBTool.GetIntFromRow(row, "GoodsTypeId", 0);
                m_PY                         = DBTool.GetStringFromRow(row, "PY", "");
                m_TaxRate                    = DBTool.GetDoubleFromRow(row, "TaxRate", 0);
                m_OfficeAddress              = DBTool.GetStringFromRow(row, "OfficeAddress", "");
                m_WarhouseAddress            = DBTool.GetStringFromRow(row, "WarhouseAddress", "");
                m_Delivery                   = DBTool.GetStringFromRow(row, "Delivery", "");
                m_DeliveryRegion             = DBTool.GetStringFromRow(row, "DeliveryRegion", "");
                return(true);
            }
            return(false);
        }
Exemplo n.º 18
0
 private bool LoadFromRow(DataRow row)
 {
     Id                  = DBTool.GetIntFromRow(row, "Id", 0);
     ComId               = DBTool.GetIntFromRow(row, "ComId", 0);
     ModelId             = DBTool.GetIntFromRow(row, "ModelId", 0);
     Level               = DBTool.GetIntFromRow(row, "Level", 0);
     SalesId             = DBTool.GetIntFromRow(row, "SalesId", 0);
     ServiceId           = DBTool.GetIntFromRow(row, "ServiceId", 0);
     StatementManId      = DBTool.GetIntFromRow(row, "StatementManId", 0);
     StatementMan        = DBTool.GetStringFromRow(row, "StatementMan", "");
     MonthSales          = DBTool.GetDoubleFromRow(row, "MonthSales", 0);
     OrderMemo           = DBTool.GetStringFromRow(row, "OrderMemo", "");
     PackageType         = DBTool.GetStringFromRow(row, "PackageType", "");
     PackageMemo         = DBTool.GetStringFromRow(row, "PackageMemo", "");
     Sign                = DBTool.GetStringFromRow(row, "Sign", "");
     DeliveryMemo        = DBTool.GetStringFromRow(row, "DeliveryMemo", "");
     PayType             = DBTool.GetStringFromRow(row, "PayType", "");
     PayMethod           = DBTool.GetStringFromRow(row, "PayMethod", "");
     Credit              = DBTool.GetDoubleFromRow(row, "Credit", 0);
     CreditDays          = DBTool.GetIntFromRow(row, "CreditDays", 0);
     StatementMemo       = DBTool.GetStringFromRow(row, "StatementMemo", "");
     InvoiceType         = DBTool.GetStringFromRow(row, "InvoiceType", "");
     Invoice_Name        = DBTool.GetStringFromRow(row, "Invoice_Name", "");
     Invoice_Content     = DBTool.GetStringFromRow(row, "Invoice_Content", "");
     Invoice_TaxNo       = DBTool.GetStringFromRow(row, "Invoice_TaxNo", "");
     Invoice_Address     = DBTool.GetStringFromRow(row, "Invoice_Address", "");
     Invoice_Phone       = DBTool.GetStringFromRow(row, "Invoice_Phone", "");
     Invoice_Bank        = DBTool.GetStringFromRow(row, "Invoice_Bank", "");
     Invoice_BankAccount = DBTool.GetStringFromRow(row, "Invoice_BankAccount", "");
     InvoiceMemo         = DBTool.GetStringFromRow(row, "InvoiceMemo", "");
     AddTime             = DBTool.GetDateTimeFromRow(row, "AddTime");
     UpdateTime          = DBTool.GetDateTimeFromRow(row, "UpdateTime");
     StartOrder          = DBTool.GetIntFromRow(row, "StartOrder", 0);
     IsSPAssess          = DBTool.GetIntFromRow(row, "IsSPAssess", 0);
     BranchId            = DBTool.GetIntFromRow(row, "BranchId", 0);
     IsNational          = DBTool.GetIntFromRow(row, "IsNational", 0);
     ConfirmLevel        = DBTool.GetIntFromRow(row, "ConfirmLevel", 0);
     IsPass              = DBTool.GetIntFromRow(row, "IsPass", 0);
     IsAgainConfirm      = DBTool.GetIntFromRow(row, "IsAgainConfirm", 0);
     IsManyNum           = DBTool.GetIntFromRow(row, "IsManyNum", 0);
     IsComfirmOrder      = DBTool.GetIntFromRow(row, "IsComfirmOrder", 0);
     IsCounter           = DBTool.GetIntFromRow(row, "IsCounter", 0);
     IsBudget            = DBTool.GetIntFromRow(row, "IsBudget", 0);
     IsArchive           = DBTool.GetIntFromRow(row, "IsArchive", 0);
     OrderPrintNum       = DBTool.GetIntFromRow(row, "OrderPrintNum", 0);
     IsBuyOutCounter     = DBTool.GetIntFromRow(row, "IsBuyOutCounter", 0);
     IsDownloadOrder     = DBTool.GetIntFromRow(row, "IsDownloadOrder", 0);
     IsStoreManager      = DBTool.GetIntFromRow(row, "IsStoreManager", 0);      //库存管理
     IsBanningOrders     = DBTool.GetStringFromRow(row, "IsBanningOrders", ""); //客户下单管理
     IsOrderConfig       = DBTool.GetIntFromRow(row, "IsOrderConfig", 0);
     TaxRate             = DBTool.GetDoubleFromRow(row, "TaxRate", 0);
     return(true);
 }
Exemplo n.º 19
0
        public OrderPrintView(int orderId)
            : this()
        {
            LeadingClass.Order order = new Order(orderId);
            order.PrintDateTime = DateTime.Now;
            order.Save();
            this.ComplainUrl = CommenClass.SiteUrl.ComplainUrl() + order.GUID;

            Customer customer = new Customer(order.ComId);

            this.IsArchive = customer.IsArchive;

            DBOperate dbo = new DBOperate();
            string    sql = string.Format(" select * from view_order where orderId={0} ", orderId);
            DataSet   ds  = dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count == 1)
            {
                DataRow row = ds.Tables[0].Rows[0];
                this.OrderId         = DBTool.GetIntFromRow(row, "OrderId", 0);
                this.SumMoney        = DBTool.GetDoubleFromRow(row, "SumMoney", 0);
                this.Emergency       = DBTool.GetIntFromRow(row, "Emergency", 0);
                this.OrderTime       = DBTool.GetDateTimeFromRow(row, "OrderTime");
                this.PlanDate        = DBTool.GetDateTimeFromRow(row, "PlanDate");
                this.StoreFinishTime = DBTool.GetDateTimeFromRow(row, "StoreFinishTime");
                this.PrintTime       = DBTool.GetDateTimeFromRow(row, "PrintDateTime");
                this.RowNum          = DBTool.GetIntFromRow(row, "RowNum", 0);
                this.PackageNum      = DBTool.GetIntFromRow(row, "PackageNum", 0);
                this.Company         = DBTool.GetStringFromRow(row, "Company", "");
                this.ComId           = DBTool.GetIntFromRow(row, "ComId", 0);
                this.RealName        = DBTool.GetStringFromRow(row, "RealName", "");
                this.DeptName        = DBTool.GetStringFromRow(row, "DeptName", "");
                this.Mobile          = DBTool.GetStringFromRow(row, "Mobile", "");
                this.Telphone        = DBTool.GetStringFromRow(row, "Telphone", "");
                this.Address         = DBTool.GetStringFromRow(row, "Address", "");
                this.SalesName       = DBTool.GetStringFromRow(row, "SalesName", "");
                this.ServiceName     = DBTool.GetStringFromRow(row, "ServiceName", "");
                this.PickingUserId   = DBTool.GetIntFromRow(row, "PickingUserId", 0);
                this.PickingName     = DBTool.GetStringFromRow(row, "PickingName", "");
                this.PayMethod       = DBTool.GetStringFromRow(row, "Pay_Method", "");
                this.Memo            = DBTool.GetStringFromRow(row, "Memo", "");


                StoreManager sm    = new StoreManager();
                Store        store = new Store(sm.GetUserDefaultStore(this.PickingUserId));
                this.StoreName = store.Name;

                sql     = string.Format(@" select ROW_NUMBER() over(order by Id) as RowNumber,GoodsId,Left(DisplayName,40) as DisplayName,Unit,Num,SalePrice,Amount 
                    from View_OrderDetail 
                    where OrderId={0} and IsShow=1 order by Id ", this.OrderId);
                Details = dbo.GetDataSet(sql).Tables[0];
            }
        }
Exemplo n.º 20
0
 private void LoadFromRow(DataRow row)
 {
     Id         = DBTool.GetIntFromRow(row, "Id", 0);
     GoodsId    = DBTool.GetIntFromRow(row, "GoodsId", 0);
     StoreId    = DBTool.GetIntFromRow(row, "StoreId", 0);
     Num        = DBTool.GetIntFromRow(row, "Num", 0);
     AC         = DBTool.GetDoubleFromRow(row, "AC", 0);
     UpdateTime = DBTool.GetDateTimeFromRow(row, "UpdateTime");
     StoreZone  = DBTool.GetStringFromRow(row, "StoreZone", "");
     CargoNum   = DBTool.GetIntFromRow(row, "CargoNum", 0);
     TaxAC      = DBTool.GetDoubleFromRow(row, "TaxAC", 0);
 }
Exemplo n.º 21
0
        public bool Load()
        {
            string sql = string.Format("select * from TPI_Refund where 1=1 ");

            if (Id > 0)
            {
                sql += string.Format("and id={0} ", Id);
            }
            if (projectId > 0)
            {
                sql += string.Format("and projectId={0} ", projectId);
            }
            if (OrderRefundId != "")
            {
                sql += string.Format("and OrderRefundId={0} ", OrderRefundId);
            }
            DataSet ds = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id                  = DBTool.GetIntFromRow(row, "Id", 0);
                projectId           = DBTool.GetIntFromRow(row, "projectId", 0);
                createTime          = DBTool.GetDateTimeFromRow(row, "createTime");
                OrderRefundId       = DBTool.GetStringFromRow(row, "OrderRefundId", "");
                OrigOrderId         = DBTool.GetStringFromRow(row, "OrigOrderId", "");
                CommodityId         = DBTool.GetStringFromRow(row, "CommodityId", "");
                SkuId               = DBTool.GetStringFromRow(row, "SkuId", "");
                CustomerId          = DBTool.GetStringFromRow(row, "CustomerId", "");
                RefundNum           = DBTool.GetIntFromRow(row, "RefundNum", 0);
                RefundAmt           = DBTool.GetDoubleFromRow(row, "RefundAmt", 0);
                RefundTime          = DBTool.GetDateTimeFromRow(row, "RefundTime");
                RefundReason        = DBTool.GetStringFromRow(row, "RefundReason", "");
                RefundName          = DBTool.GetStringFromRow(row, "RefundName", "");
                RefundMobile        = DBTool.GetStringFromRow(row, "RefundMobile", "");
                RefundTelephone     = DBTool.GetStringFromRow(row, "RefundTelephone", "");
                RefundProvince      = DBTool.GetStringFromRow(row, "RefundProvince", "");
                RefundCity          = DBTool.GetStringFromRow(row, "RefundCity", "");
                RefundCounty        = DBTool.GetStringFromRow(row, "RefundCounty", "");
                RefundAddressDetail = DBTool.GetStringFromRow(row, "RefundAddressDetail", "");
                RefundDescription   = DBTool.GetStringFromRow(row, "RefundDescription", "");
                RefundType          = DBTool.GetIntFromRow(row, "RefundType", 0);
                StoreId             = DBTool.GetStringFromRow(row, "StoreId", "");
                RefundIntelAmt      = DBTool.GetDoubleFromRow(row, "RefundIntelAmt", 0);
                RefundCouponAmt     = DBTool.GetDoubleFromRow(row, "RefundCouponAmt", 0);
                RefundResult        = DBTool.GetIntFromRow(row, "RefundResult", 0);
                OrderRefundTime     = DBTool.GetDateTimeFromRow(row, "OrderRefundTime");
                OrderRefundDesc     = DBTool.GetStringFromRow(row, "OrderRefundDesc", "");
                orderId             = DBTool.GetIntFromRow(row, "orderId", 0);
                return(true);
            }
            return(false);
        }
Exemplo n.º 22
0
 private void LoadFromRow(DataRow row)
 {
     Id          = DBTool.GetIntFromRow(row, "Id", 0);
     GoodsId     = DBTool.GetIntFromRow(row, "GoodsId", 0);
     DisplayName = DBTool.GetStringFromRow(row, "DisplayName", "");
     Num         = DBTool.GetIntFromRow(row, "Num", 0);
     Price       = DBTool.GetDoubleFromRow(row, "Price", 0);
     UpdateTime  = DBTool.GetDateTimeFromRow(row, "UpdateTime");
     DeptId      = DBTool.GetIntFromRow(row, "DeptId", 0);
     ComId       = DBTool.GetIntFromRow(row, "ComId", 0);
     SDeptId     = DBTool.GetIntFromRow(row, "SDeptId", 0);
     SMemberId   = DBTool.GetIntFromRow(row, "SMemberId", 0);
 }
Exemplo n.º 23
0
        /// <summary>
        /// 读取最新积分
        /// </summary>
        /// <returns></returns>
        public double ReadPointBalance()
        {
            string  sql = string.Format(" select top 1 Balance from PointDetail where memberId={0} order by UpdateTime desc ", this.Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count == 1)
            {
                return(DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "Balance", 0));
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// 读取客户--商品的最新销售价格
        /// </summary>
        /// <param name="comId"></param>
        /// <param name="goodsId"></param>
        /// <returns></returns>
        public double ReadRecComGoodsPrice(int comId, int goodsId)
        {
            string  sql = string.Format("select top 1 SalePrice from view_OrderDetail where ComId = {0} and GoodsId = {1} order by PlanDate Desc ", comId, goodsId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count == 1)
            {
                return(DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "SalePrice", 0));
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 25
0
        public double ReadVIPrice(int CounterId, int GoodsId)
        {
            string  sql = string.Format(" select VIPPrice from VIPCounterDetail where CounterId={0} and GoodsId={1} ", CounterId, GoodsId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count == 1)
            {
                return(DBTool.GetDoubleFromRow(ds.Tables[0].Rows[0], "VIPPrice", 0));
            }
            else
            {
                return(-1);
            }
        }
Exemplo n.º 26
0
 public void LoadFromRow(DataRow row)
 {
     Id          = DBTool.GetIntFromRow(row, "Id", 0);
     ComId       = DBTool.GetIntFromRow(row, "ComId", 0);
     DeptId      = DBTool.GetIntFromRow(row, "DeptId", 0);
     MemberId    = DBTool.GetIntFromRow(row, "MemberId", 0);
     IsDept      = DBTool.GetIntFromRow(row, "IsDept", 0);
     IsPersonal  = DBTool.GetIntFromRow(row, "IsPersonal", 0);
     YearBudget  = DBTool.GetDoubleFromRow(row, "Budget", 0);
     MonthBudget = DBTool.GetDoubleFromRow(row, "MonthBudget", 0);
     MaxOrderNum = DBTool.GetIntFromRow(row, "MaxOrderNum", 0);
     StartDate   = DBTool.GetDateTimeFromRow(row, "StartDate");
     EndDate     = DBTool.GetDateTimeFromRow(row, "EndDate");
     UpdateTime  = DBTool.GetDateTimeFromRow(row, "UpdateTime");
 }
Exemplo n.º 27
0
        /// <summary>
        /// 采购入库计算AC
        /// </summary>
        /// <param name="storeId"></param>
        /// <param name="GoodsId"></param>
        /// <param name="Pnum"></param>
        /// <param name="PInPrice"></param>
        /// <returns></returns>
        public double GetAC(int storeId, int goodsId, int pNum, double pInPrice)
        {
            DataTable dt = GetGoodsStore(goodsId, storeId).Tables[0];
            double    AC = 0;

            if (dt.Rows.Count > 0)
            {
                double kAc  = DBTool.GetDoubleFromRow(dt.Rows[0], "AC", 0);
                int    kNum = DBTool.GetIntFromRow(dt.Rows[0], "Num", 0);
                AC = (kAc * kNum + pNum * pInPrice) / (kNum + pNum);
            }
            else
            {
                AC = pInPrice;
            }
            return(AC);
        }
Exemplo n.º 28
0
        public bool GetAllApplyDetailByApplyId()
        {
            string  sql = string.Format("select * from VIPApplyDetail where ApplyId={0}", ApplyId);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id       = DBTool.GetIntFromRow(row, "Id", 0);
                ApplyId  = DBTool.GetIntFromRow(row, "ApplyId", 0);
                GoodsId  = DBTool.GetIntFromRow(row, "GoodsId", 0);
                Model    = DBTool.GetStringFromRow(row, "Model", "");
                Num      = DBTool.GetIntFromRow(row, "Num", 0);
                VIPPrice = DBTool.GetDoubleFromRow(row, "VIPPrice", 0);
                return(true);
            }
            return(false);
        }
Exemplo n.º 29
0
        public bool Load()
        {
            string  sql = string.Format("select * from GoodsACModify where id={0}", Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id         = DBTool.GetIntFromRow(row, "Id", 0);
                GoodsACId  = DBTool.GetIntFromRow(row, "GoodsACId", 0);
                OldAC      = DBTool.GetDoubleFromRow(row, "OldAC", 0);
                NewAC      = DBTool.GetDoubleFromRow(row, "NewAC", 0);
                UserId     = DBTool.GetIntFromRow(row, "UserId", 0);
                UpdateTime = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                return(true);
            }
            return(false);
        }
Exemplo n.º 30
0
        public bool Load()
        {
            string  sql = string.Format("select * from BudgetMemberBalance where id={0}", Id);
            DataSet ds  = m_dbo.GetDataSet(sql);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                Id         = DBTool.GetIntFromRow(row, "Id", 0);
                MemberId   = DBTool.GetIntFromRow(row, "MemberId", 0);
                Type       = DBTool.GetStringFromRow(row, "Type", "");
                Get        = DBTool.GetDoubleFromRow(row, "Get", 0);
                Spend      = DBTool.GetDoubleFromRow(row, "Spend", 0);
                Balance    = DBTool.GetDoubleFromRow(row, "Balance", 0);
                UpdateTime = DBTool.GetDateTimeFromRow(row, "UpdateTime");
                return(true);
            }
            return(false);
        }