Ejemplo n.º 1
0
        /// <summary>
        /// 订单分页查询
        /// </summary>
        /// <param name="CurrentPage"></param>
        /// <returns></returns>
        public List <SaveOrders> DivideShow(int CurrentPage)
        {
            List <SaveOrders> ListOrder  = new List <SaveOrders>();
            string            Sqlstring1 = "select top (8) StoreUser.UserName,Good.GoodName,OrderID,TotalPrices,SaveOrders.IsDeal from  SaveOrders left join SingleGoodInfo on SaveOrders.SingleGoodID=SingleGoodInfo.SingleGoodID left join StoreUser on  StoreUser.UserID=SaveOrders.UserID  left join Good on SingleGoodInfo.GoodID=Good.GoodID where OrderID not in (select top (" + CurrentPage * 8 + ") OrderID from SaveOrders order by OrderID asc)order by OrderID";

            SqlHelper.ReadDateReadBegin(Sqlstring1);
            while (SqlHelper.SqlReader.Read())
            {
                SaveOrders mOrder = new SaveOrders();
                mOrder.ReceiveStr  = SqlHelper.SqlReader["UserName"].ToString();
                mOrder.Getstr      = SqlHelper.SqlReader["GoodName"].ToString();
                mOrder.OrderID     = SqlHelper.SqlReader["OrderID"].ToString();
                mOrder.TotalPrices = Convert.ToInt32(SqlHelper.SqlReader["TotalPrices"]);
                string str = SqlHelper.SqlReader["IsDeal"].ToString();
                switch (str)
                {
                case "0":
                    mOrder.IsDeal = "未处理";
                    break;

                case "1":
                    mOrder.IsDeal = "已处理";
                    break;

                case "2":
                    mOrder.IsDeal = "已取消";
                    break;
                }
                ListOrder.Add(mOrder);
            }
            SqlHelper.ReadDateReadEnd();
            return(ListOrder);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改处理订单管理员ID
        /// </summary>
        /// <param name="alter"></param>
        /// <returns></returns>
        //public bool AlterStaffID(SaveOrders alter)
        //{
        //    string sqlstr="update Orders set StaffID ='"+alter .StaffID +"'"+" where OrderID='"+alter .StaffID +"'"+";update SaveOrders set StaffID ='"+alter .StaffID +"'"+" where OrderID='"+alter .StaffID +"'";
        //    if (SqlHelper.ExecuteNonQuery(sqlstr) > 0)
        //    {
        //        return true;
        //    }
        //    else
        //    {
        //        return false;
        //    }
        //}
        /// <summary>
        /// 时间获取
        /// </summary>
        /// <param name="GetTime"></param>
        /// <returns></returns>
        public bool GetTradeTime(SaveOrders GetTime)
        {
            string sqlstring = "";

            switch (GetTime.TradeStatus.ToString())
            {
            case "1":
                sqlstring = "update  SaveOrders  set SubmitTime = getdate() where OrderID='" + GetTime.OrderID + "'" + ";update Orders set SubmitTime = getdate() where OrderID='" + GetTime.OrderID + "'";;
                break;

            case "2":
                sqlstring = "update  SaveOrders  set SendTime = getdate() where OrderID='" + GetTime.OrderID + "'" + ";update Orders set SendTime = getdate() where OrderID='" + GetTime.OrderID + "'";
                break;

            case "3":
                sqlstring = "update SaveOrders set  EndTime = getdate() where OrderID='" + GetTime.OrderID + "'" + "; update Orders set EndTime = getdate() where OrderID='" + GetTime.OrderID + "'";
                break;
            }
            if (GetTime.TradeStatus.ToString() != "0")
            {
                if (SqlHelper.ExecuteNonQuery(sqlstring) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public bool DeleteOrder(SaveOrders mSaveOrder)
        {
            string sqlstring = "delete from SaveOrders where OrderID='" + mSaveOrder.OrderID + "'";

            if (SqlHelper.ExecuteNonQuery(sqlstring) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 验证输入的订单号是否存在
        /// </summary>
        /// <param name="mOrder"></param>
        /// <returns></returns>
        public bool OrderExam(SaveOrders mOrder)
        {
            string sqlstring = "select UserID from SaveOrders where OrderID='" + mOrder.OrderID + "'";


            if (SqlHelper.ReadSclar(sqlstring) != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["hOrderID"] != null)
                {
                    tbxOrderID.Text = Session["hOrderID"].ToString();
                }
                SaveOrders hOrder = new Models.SaveOrders();
                hOrder.OrderID = tbxOrderID.Text;
                OA           mOrder      = new OA();
                OAController mController = new OAController();
                arry                  = mController.SearchOrder(mOrder, hOrder);
                tbxAddress.Text       = arry[1];
                tbxCalloffReason.Text = arry[7];
                tbxEndTime.Text       = arry[9];
                tbxNumber.Text        = arry[2];
                tbxSendTime.Text      = arry[8];
                tbxStaffID.Text       = arry[10];
                tbxSubmitTime.Text    = arry[5];
                tbxToTalPrice.Text    = arry[3];
                tbxUserID.Text        = arry[0];
                switch (arry[6])
                {
                case "0":
                    //TradeStatus.SelectedIndex = 0;
                    this.lblTradeStatus.Text = "买家未付款";
                    break;

                case "1":
                    //TradeStatus.SelectedIndex = 1;
                    this.lblTradeStatus.Text = "买家付款";
                    break;

                case "2":
                    // TradeStatus.SelectedIndex = 2;
                    this.lblTradeStatus.Text = "商城发货";
                    break;

                case "3":
                    //TradeStatus.SelectedIndex = 3;
                    this.lblTradeStatus.Text = "交易完成";
                    break;
                }
            }
            Session["hOrder"] = "";
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 对订单的修改
        /// </summary>
        /// <returns></returns>
        public bool AlterOrderStatus(SaveOrders alter)
        {
            string    sqlstring  = "update Orders set TradeStatus ='" + alter.TradeStatus + "'" + "where OrderID='" + alter.OrderID + "'" + ";update SaveOrders set TradeStatus ='" + alter.TradeStatus + "'" + "where OrderID='" + alter.OrderID + "'" + ";update SaveOrders set IsDeal ='" + alter.IsDeal + "'" + "where OrderID='" + alter.OrderID + "'" + ";update Orders set IsDeal ='" + alter.IsDeal + "'" + "where OrderID='" + alter.OrderID + "'" + ";update SaveOrders set StaffID='" + alter.StaffID + "'" + "where OrderID='" + alter.OrderID + "'" + ";update Orders set StaffID='" + alter.StaffID + "'" + "where OrderID='" + alter.OrderID + "'";
            string    sqlstring2 = "select UserInfo.MoneySum from StoreUser left join UserInfo on UserInfo.UserID=StoreUser.UserID where UserName='******'";
            StoreUser mStore     = new StoreUser();

            mStore.UserName = alter.ReceiveStr;
            int    TempUserID = StoreUser.UserNameGetID(mStore);
            int    Money      = Convert.ToInt32(SqlHelper.ReadSclar(sqlstring2)) + Convert.ToInt32(alter.TotalPrices);
            string sqlstring3 = "update UserInfo set MoneySum ='" + Money + "'" + "where UserID='" + TempUserID + "'";

            if (alter.TradeStatus == '3' && alter.Number != 0)
            {
                string         sqlstring4      = "select Good.SalesVolume from SaveOrders left join SaveSingleGoodInfo on SaveOrders.SingleGoodID=SaveSingleGoodInfo.SingleGoodID left join Good on SaveSingleGoodInfo.GoodID=Good.GoodID  where OrderID='" + alter.OrderID + "'";
                string         sqlstring5      = "select GoodID from SaveOrders left join SaveSingleGoodInfo on SaveOrders.SingleGoodID=SaveSingleGoodInfo.SingleGoodID where OrderID='" + alter.OrderID + "'";
                int            SalesVolume     = (Convert.ToInt32(SqlHelper.ReadSclar(sqlstring4)) + alter.Number);
                int            GoodID          = Convert.ToInt32(SqlHelper.ReadSclar(sqlstring5));
                string         sqlstring6      = "update Good set SalesVolume='" + SalesVolume + "'" + " where GoodID='" + GoodID + "'";
                string         sqlstring8      = "select Good.GoodIncentory from SaveOrders left join SaveSingleGoodInfo on SaveOrders.SingleGoodID=SaveSingleGoodInfo.SingleGoodID left join Good on SaveSingleGoodInfo.GoodID=Good.GoodID  where OrderID='" + alter.OrderID + "'";
                int            GoodIncentory   = (Convert.ToInt32(SqlHelper.ReadSclar(sqlstring8)) - alter.Number);
                string         sqlstring7      = "update Good set GoodIncentory='" + GoodIncentory + "'" + " where GoodID='" + GoodID + "'";
                SingleGoodInfo mSingleGoodInfo = new SingleGoodInfo();
                mSingleGoodInfo.SingleGoodID = alter.SingleGoodID;
                int    TempGoodID = SingleGoodInfo.SingleGoodIDGetGood(mSingleGoodInfo);
                string sqlstring1 = "delete top(" + alter.Number + ") from SaveSingleGoodInfo  where GoodID='" + TempGoodID + "'";
                if (SqlHelper.ExecuteNonQuery(sqlstring) > 0 && SqlHelper.ExecuteNonQuery(sqlstring1) > 0 && SqlHelper.ExecuteNonQuery(sqlstring3) > 0 && SqlHelper.ExecuteNonQuery(sqlstring6) > 0 && SqlHelper.ExecuteNonQuery(sqlstring7) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if (SqlHelper.ExecuteNonQuery(sqlstring) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Ejemplo n.º 7
0
        public string[] OrderInfoRead(SaveOrders Order)
        {
            string sqlstring1 = "select StoreUser.UserName,ShipAddress.Address,SingleGoodID,Number,TotalPrices,SubmitTime,TradeStatus,CalloffReason,SendTime,EndTime,Admin.TrueName,SaveOrders.IsDeal from SaveOrders left join StoreUser on StoreUser.UserID=SaveOrders.UserID left Join Admin on Admin.StaffID=SaveOrders.StaffID left join ShipAddress on SaveOrders.AddressID=ShipAddress.AddressID where SaveOrders.OrderID=N'" + Order.OrderID + "'";

            SqlHelper.ReadDateReadBegin(sqlstring1);
            while (SqlHelper.SqlReader.Read())
            {
                arr[0]  = SqlHelper.SqlReader["UserName"].ToString();
                arr[1]  = SqlHelper.SqlReader["Address"].ToString();
                arr[2]  = SqlHelper.SqlReader["Number"].ToString();
                arr[3]  = SqlHelper.SqlReader["TotalPrices"].ToString();
                arr[5]  = SqlHelper.SqlReader["SubmitTime"].ToString();
                arr[6]  = SqlHelper.SqlReader["TradeStatus"].ToString();
                arr[7]  = SqlHelper.SqlReader["CalloffReason"].ToString();
                arr[8]  = SqlHelper.SqlReader["SendTime"].ToString();
                arr[9]  = SqlHelper.SqlReader["EndTime"].ToString();
                arr[10] = SqlHelper.SqlReader["TrueName"].ToString();
                arr[12] = SqlHelper.SqlReader["IsDeal"].ToString();
                arr[4]  = SqlHelper.SqlReader["SingleGoodID"].ToString();
            }
            SqlHelper.ReadDateReadEnd();
            return(arr);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 高级管理员查看订单信息列表
        /// </summary>
        /// <param name="surrentPage"></param>
        /// <returns></returns>
        public List <SaveOrders> OrderShow(int surrentPage)
        {
            List <SaveOrders> listOrder  = new List <SaveOrders>();
            string            Sqlstring1 = "select top 8  OrderID,UserID,TotalPrices,SubmitTime,TradeStatus from SaveOrders where OrderID not in (select top " + surrentPage * 8 + " OrderID from SaveOrders order by OrderID asc) order by OrderID";

            SqlHelper.ReadDateReadBegin(Sqlstring1);
            while (SqlHelper.SqlReader.Read())
            {
                SaveOrders morder = new SaveOrders();
                morder.OrderID     = SqlHelper.SqlReader["OrderID"].ToString();
                morder.UserID      = Convert.ToInt32(SqlHelper.SqlReader["UserID"]);
                morder.TotalPrices = Convert.ToDouble(SqlHelper.SqlReader["TotalPrices"]);
                morder.SubmitTime  = SqlHelper.SqlReader["SubmitTime"].ToString();
                switch (Convert.ToChar(SqlHelper.SqlReader["TradeStatus"]))
                {
                case '0':
                    morder.aTradeStatus = "买家未付款";
                    break;

                case '1':
                    morder.aTradeStatus = "买家付款";
                    break;

                case '2':
                    morder.aTradeStatus = "商城发货";
                    break;

                case '3':
                    morder.aTradeStatus = "交易完成";
                    break;
                }
                listOrder.Add(morder);
            }
            SqlHelper.ReadDateReadEnd();
            return(listOrder);
        }
Ejemplo n.º 9
0
        protected void Alter_Click(object sender, EventArgs e)
        {
            if (Session["hUserName"] != null)
            {
                StrUserName = Session["hUserName"].ToString();
            }
            OA         m      = new OA();
            SaveOrders status = new SaveOrders();
            Admins     madmin = new Admins();

            madmin.UserName    = StrUserName;
            madmin.StaffID     = Admins.UserNameGetStaffID(madmin);
            status.StaffID     = madmin.StaffID;
            status.TradeStatus = Convert.ToChar(Status);

            if (Status == "3")
            {
                TradeStatus.Enabled = false;
            }
            if (Session["hOrderID"] != null)
            {
                tbxOrderID.Text = Session["hOrderID"].ToString();
            }
            else
            {
                tbxOrderID.Text = receive;
            }
            status.OrderID = tbxOrderID.Text;

            if (tbxNumber.Text == null)
            {
                tbxNumber.Text = "0";
            }
            else
            {
                status.Number = Convert.ToInt32(tbxNumber.Text);
            }
            status.Number       = Convert.ToInt32(tbxNumber.Text);
            status.SingleGoodID = Convert.ToInt32(Session["SingleGoodID"]);
            status.IsDeal       = Deal;
            OAController mCon = new OAController();

            if (Status == "3")
            {
                status.TotalPrices = Convert.ToDouble(tbxToTalPrice.Text);
                status.ReceiveStr  = tbxUserID.Text;

                //将用户用户名传入
            }



            if (mCon.TradeStatus(m, status) && mCon.GetTimeCon(m, status))
            {
                Tip.Text = "修改成功";
                //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ggg", "<script language='javascript'>alert('" + "修改成功!!" + "');</script>");
            }
            else
            {
                Tip.Text = "修改失败";
                //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ggg", "<script language='javascript'>alert('" + "修改失败!!" + "');</script>");
            }
            //读取数据代码
            {
                if (Session["hOrderID"] != null)
                {
                    tbxOrderID.Text = Session["hOrderID"].ToString();
                }
                else
                {
                    tbxOrderID.Text = receive;
                }

                SaveOrders hOrder = new Models.SaveOrders();
                hOrder.OrderID = tbxOrderID.Text;

                OA           mOrder      = new OA();
                OAController mController = new OAController();
                arry = mController.SearchOrder(mOrder, hOrder);


                tbxAddress.Text       = arry[1];
                tbxCalloffReason.Text = arry[7];
                tbxEndTime.Text       = arry[9];
                tbxNumber.Text        = arry[2];
                tbxSendTime.Text      = arry[8];
                tbxStaffID.Text       = arry[10];
                tbxSubmitTime.Text    = arry[5];
                tbxToTalPrice.Text    = arry[3];
                tbxUserID.Text        = arry[0];
                switch (arry[6])
                {
                case "0":
                    TradeStatus.SelectedIndex = 0;
                    break;

                case "1":
                    TradeStatus.SelectedIndex = 1;
                    break;

                case "2":
                    TradeStatus.SelectedIndex = 2;
                    break;

                case "3":
                    TradeStatus.SelectedIndex = 3;
                    break;
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = Request.QueryString["OrderID"];

            receive = str;

            if (!IsPostBack)
            {
                if (Session["hOrderID"] != null)
                {
                    tbxOrderID.Text = Session["hOrderID"].ToString();
                }
                else
                {
                    tbxOrderID.Text = str;
                }


                SaveOrders   hOrder      = new Models.SaveOrders();
                OA           mOrder      = new OA();
                OAController mController = new OAController();
                hOrder.OrderID = tbxOrderID.Text;
                arry           = mController.SearchOrder(mOrder, hOrder);

                if (arry[6] == "3")
                {
                    TradeStatus.Enabled = false;
                }
                hOrder.IsDeal = arry[12];
                if (hOrder.IsDeal == "2")
                {
                    this.TradeStatus.Enabled = false;
                }

                tbxAddress.Text         = arry[1];
                tbxCalloffReason.Text   = arry[7];
                tbxEndTime.Text         = arry[9];
                tbxNumber.Text          = arry[2];
                tbxSendTime.Text        = arry[8];
                tbxStaffID.Text         = arry[10];
                tbxSubmitTime.Text      = arry[5];
                tbxToTalPrice.Text      = arry[3];
                tbxUserID.Text          = arry[0];
                Session["SingleGoodID"] = arry[4];
                switch (arry[6])
                {
                case "0":
                    TradeStatus.SelectedIndex = 0;
                    break;

                case "1":
                    TradeStatus.SelectedIndex = 1;
                    break;

                case "2":
                    TradeStatus.SelectedIndex = 2;
                    break;

                case "3":
                    TradeStatus.SelectedIndex = 3;
                    break;
                }
                Session["hOrder"] = "";
            }
        }