Esempio n. 1
0
        public string GetOrderList(int userid, string orderno)
        {
            string valid = myHeader.isValid();

            if (!valid.Equals(string.Empty))
            {
                return(valid);
            }
            MG_BLL.Pay.MgooOrders.Orders o = new MG_BLL.Pay.MgooOrders.Orders(myHeader);
            return(Utils.ToJson(o.GetOrderList(userid, orderno)));
        }
Esempio n. 2
0
        public string GetTariffList(string model)
        {
            string valid = myHeader.isValid();

            if (!valid.Equals(string.Empty))
            {
                return(valid);
            }
            MG_BLL.Pay.MgooOrders.Orders o = new MG_BLL.Pay.MgooOrders.Orders(myHeader);
            return(Utils.ToJson(o.GetPriceList(model)));
        }
Esempio n. 3
0
        public string AddOrders(string deviceid, string tariffid, string tradetype)
        {
            string valid = myHeader.isValid();

            if (!valid.Equals(string.Empty))
            {
                return(valid);
            }
            MG_BLL.Pay.MgooOrders.Orders o = new MG_BLL.Pay.MgooOrders.Orders(myHeader);
            // o.AddOrder(myHeader.UserID,deviceid,"","",);
            return("Hello World");
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string deviceid = Request.QueryString["deviceid"];

            open_id = Request.QueryString["openid"];
            // imei = Request.QueryString["imei"];
            if (!string.IsNullOrEmpty(deviceid) && !string.IsNullOrEmpty(open_id))
            {
                try
                {
                    device_id = Convert.ToInt32(deviceid);
                    MG_DAL.SQLServerOperating s = new MG_DAL.SQLServerOperating();
                    string    strSql            = @"select DeviceID,SerialNumber,DeviceName,PhoneNum,ActiveDate,HireExpireDate,u.UserID,u.UserName,di.DataText,cast((datediff(DAY,ActiveDate,GETDATE()) + 0.1)/(datediff(DAY,ActiveDate,HireExpireDate)+0.1) as  numeric(10,2)) as UseSituation, datediff(MM,GETDATE(),HireExpireDate) TheRest,
                                 (select count(*) from devices where Deleted=0 and UserID=d.UserID) DeviceCount,
                                 (select count(*) from devices where Deleted=0 and UserID=d.UserID and HireExpireDate > GETDATE() and HireExpireDate <= DATEADD(MM,1,GETDATE())) ExpireCount
                                  from devices d inner join Users u on u.UserID=d.UserID inner join dictionary di on di.DataValue = d.Model where d.Deleted=0 and DeviceID=@DeviceID";
                    DataTable dt = s.Selects(strSql, new SqlParameter[] { new SqlParameter("DeviceID", device_id) });
                    //X11 8 50   开头的 都是60一年,其他都是120一年    60 100 130               120 200 250
                    if (dt.Rows.Count <= 0)
                    {
                        return;
                    }
                    DataRow DeviceInfo = dt.Rows[0];
                    var     expire     = Convert.ToDateTime(DeviceInfo["HireExpireDate"].ToString());
                    expire_date = expire.ToString("yyyy-MM-dd");
                    if (expire < DateTime.Now)
                    {
                        use_situation = 100;
                    }
                    else
                    {
                        use_situation = Convert.ToInt32(Convert.ToDouble(DeviceInfo["UseSituation"].ToString()) * 100);
                    }
                    user_name    = DeviceInfo["UserName"].ToString();
                    imei         = DeviceInfo["SerialNumber"].ToString();
                    device_count = DeviceInfo["DeviceCount"].ToString();
                    expire_count = DeviceInfo["ExpireCount"].ToString();
                    device_name  = string.IsNullOrEmpty(DeviceInfo["DeviceName"].ToString()) ? DeviceInfo["SerialNumber"].ToString() : DeviceInfo["DeviceName"].ToString();
                    user_id      = Convert.ToInt32(DeviceInfo["UserID"].ToString());
                    int.TryParse(DeviceInfo["TheRest"].ToString(), out the_rest);
                    the_rest = the_rest - 1;
                    if (the_rest < 0)
                    {
                        the_rest = 0;
                    }
                    MG_BLL.Pay.MgooOrders.Orders o = new MG_BLL.Pay.MgooOrders.Orders();
                    PriceList = o.GetPriceList(DeviceInfo["DataText"].ToString());
                }
                catch (Exception)
                {
                }
            }
        }
Esempio n. 5
0
        public string QueryOrder(string orderno, string transactionid)
        {
            string valid = myHeader.isValid();

            if (!valid.Equals(string.Empty))
            {
                return(valid);
            }
            MG_BLL.Pay.MgooOrders.Orders o = new MG_BLL.Pay.MgooOrders.Orders();
            var orderStatus = o.QueryOrder(orderno, transactionid);

            if (orderStatus == "2")
            {
                return(MG_BLL.Utils.GetResult("SUCCESS", MG_BLL.statusCode.Code.success, orderno));
            }
            return(MG_BLL.Utils.GetResult("FAILURE", MG_BLL.statusCode.Code.failure, orderno));
        }