コード例 #1
0
 public void getOrderCellphone_Ucode(string orderid, out string cellphone, out string ucode)
 {
     cellphone = "";
     ucode = "";
     AdjDBObject adjDbObject = new AdjDBObject();
     adjDbObject.GetSqlStringCommand("select cellphone,ucode from D_OrderInfo where orderid = @orderid");
     adjDbObject.AddInParameter("@orderid", DbType.String, orderid);
     DataTable dt = adjDbObject.ExecuteDataSet().Tables[0];
     if (dt.Rows.Count > 0)
     {
         cellphone = dt.Rows[0]["cellphone"].ToString();
         ucode = dt.Rows[0]["ucode"].ToString();
     }
     else
     {
         throw new Exception("没有该订单");
     }
 }
コード例 #2
0
 /// <summary>
 /// 是否首次生成订单
 /// </summary>
 /// <param name="phone"></param>
 /// <returns></returns>
 public int IsPayinfoFirst(string phone)
 {
     int count = 0;
     try
     {
         AdjDBObject adjDbObject = new AdjDBObject();
         string sqlCou = "SELECT COUNT(1) as count FROM dbo.D_OrderInfo (nolock) WHERE state=30 AND cellphone=@phone";
         adjDbObject.GetSqlStringCommand(sqlCou);
         adjDbObject.AddInParameter("@phone", DbType.String, phone);
         using (DataTable dt = adjDbObject.ExecuteDataSet().Tables[0])
         {
             count = int.Parse(dt.Rows[0]["count"].ToString());
         }
         return count;
     }
     catch (Exception ex)
     {
         return 0;
     }
 }
コード例 #3
0
        // 1216|sign|UCode|7a31f99279327f8b75506acbf0503973
        public string execute(string request)
        {
            string[] req = request.Split('|');
            var sign = EncodingUtil.GetMd5(req[2] + "aidaijia", "utf-8");
            if (sign.ToLower() == req[3].ToLower())
            {
                T_ParterEntity parter = new T_PartyDal().GetParterModelBySign(req[1].ToLower());
                if (parter != null)
                {
                    AdjDBObject db = new AdjDBObject();
                    string sql = "select Ucode, DriverName,'" + ConfigHelper.ImagePath + "/' + Photo Photo,DrivedYears,DriveCount,NewGrade,SatisfactionRate from d_driverinfo where UCode = @UCode";
                    db.GetSqlStringCommand(sql);
                    db.AddInParameter("@UCode", System.Data.DbType.String, req[2]);
                    DataTable dt = db.ExecuteDataSet().Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        return JsonConvert.SerializeObject(new {
                            Ucode = dt.Rows[0]["Ucode"].ToString(),
                            DriverName = dt.Rows[0]["DriverName"].ToString(),
                            DrivedYears = dt.Rows[0]["DrivedYears"].ToString(),
                            Photo = dt.Rows[0]["Photo"].ToString(),
                            DriveCount = dt.Rows[0]["DriveCount"].ToString(),
                            NewGrade = dt.Rows[0]["NewGrade"].ToString(),
                            SatisfactionRate = dt.Rows[0]["SatisfactionRate"].ToString()
                        });
                    }
                    throw new Exception("没有该司机!");
                }
                else
                {
                    throw new Exception("商户标识错误");
                }

            }
            else
            {
                throw new Exception("签名错误。");
            }
        }
コード例 #4
0
 public List<SjComment> GetPingLuns(string ucode)
 {
     AdjDBObject adjDbObject = new AdjDBObject();
        try
        {
        List<SjComment> ret = null;
        string cmdtext = "SELECT Ucode,Evaluate,CustomerName,Cellphone,Comment,Create_time FROM dbo.D_DriverComment where Status=2 AND Ucode=@ucode ORDER BY create_time DESC";
        adjDbObject.GetSqlStringCommand(cmdtext);
        adjDbObject.AddInParameter("@ucode", DbType.String, ucode);
        using (DataSet ds = adjDbObject.ExecuteDataSet())
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                ret = GlobalFunction.GetEntityListByTable<SjComment>(ds.Tables[0]);
            }
        }
        return ret;
        }
        catch (Exception)
        {
        return null;
        }
 }
コード例 #5
0
        // 1215|sign|orderid|7a31f99279327f8b75506acbf0503973
        public string execute(string request)
        {
            string[] req = request.Split('|');
            var sign = EncodingUtil.GetMd5(req[2] + "aidaijia", "utf-8");
            if (sign.ToLower() == req[3].ToLower())
            {
                T_ParterEntity parter = new T_PartyDal().GetParterModelBySign(req[1].ToLower());
                if (parter != null)
                {
                    AdjDBObject db = new AdjDBObject();
                    string sql = "SELECT Id,OrderId,OrderStatus,StatusText,create_time FROM D_OrderStatusChangeLog where OrderId = @OrderId";
                    db.GetSqlStringCommand(sql);
                    db.AddInParameter("@OrderId",System.Data.DbType.String,req[2]);
                    DataTable dt = db.ExecuteDataSet().Tables[0];
                    List<OrderHistory> list = new List<OrderHistory>();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        list.Add(new OrderHistory() {
                            orderid = dt.Rows[i]["OrderId"].ToString(),
                            OrderStatus = Convert.ToInt32(dt.Rows[i]["OrderStatus"]),
                            StatusText = dt.Rows[i]["StatusText"].ToString(),
                            create_time = Convert.ToDateTime(dt.Rows[i]["create_time"])
                        });
                    }
                    return JsonConvert.SerializeObject(list);
                }
                else
                {
                    throw new Exception("商户标识错误");
                }

            }
            else
            {
                throw new Exception("签名错误。");
            }
        }
コード例 #6
0
        /// <summary>
        /// 获取附近10个司机 优化过
        /// </summary>
        /// <param name="lat"></param>
        /// <param name="lng"></param>
        /// <returns></returns>
        public List<sjinfo> GetNewUserByLatlng(string lat, string lng, string parterid=null)
        {
            List<sjinfo> drvModels = new List<sjinfo>();
            AdjDBObject adjDbObject = new AdjDBObject();
            try
            {
                adjDbObject.GetStoredProcCommand("GetNearSjBylanlngCount");
                adjDbObject.AddInParameter("@lat", DbType.Double, lat);
                adjDbObject.AddInParameter("@lng", DbType.Double, lng);
                adjDbObject.AddInParameter("@online", DbType.Int32, 6);
                adjDbObject.AddInParameter("@onservice", DbType.Int32, 4);
                DataSet ds = adjDbObject.ExecuteDataSet();
                List<sjinfo> list = new List<sjinfo>();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        sjinfo model = new sjinfo();
                        model.uid = row["id"].ToString();
                        model.ucode = row["ucode"].ToString();
                        model.name = row["realname"].ToString();
                        model.phone = "";//row["phone"].ToString();//row["phone"].ToString().Substring(0, 3) + "****" + row["phone"].ToString().Substring(7, 4);
                        model.pic = ConfigHelper.ImagePath + row["pic"].ToString();
                        model.jialin = row["jialin"].ToString();
                        model.cishu = row["cishu"].ToString();
                        model.SatisfactionRate = row["SatisfactionRate"] == DBNull.Value ? "" : row["SatisfactionRate"].ToString();
                        // model.istogether = Convert.ToInt32(row["IsTogether"].ToString());
                        if (Convert.ToBoolean(row["onservice"]))
                        {
                            model.state = "服务中";
                        }
                        else
                        {
                            model.state = "空闲中";
                        }
                        model.lat = row["lat"].ToString();
                        model.lng = row["lng"].ToString();
                        double mi = Convert.ToDouble(row["juli"]);
                        model.juli = mi;
                        model.jiguan = row["huji"].ToString();
                        if (!String.IsNullOrEmpty(row["idcode"].ToString()))
                        {
                            model.idcode = row["idcode"].ToString().Substring(0, row["idcode"].ToString().Length - 4) + "****";
                        }
                        else
                        {
                            model.idcode = String.Empty;
                        }
                        model.goodrate = row["hp"].ToString();
                        model.xinji = row["cp"].ToString();

                        if (!string.IsNullOrEmpty(parterid) && parterid.Equals("32d374227e5b70ab6cc55f1b994f0e7c"))  //如果合作商是中国4S在线那么电话将显示
                        {
                            model.phone = "4006138138";
                        }

                        drvModels.Add(model);
                    }
                }
                if (ds.Tables[1].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[1].Rows)
                    {
                        sjinfo model = new sjinfo();
                        model.uid = row["id"].ToString();
                        model.ucode = row["ucode"].ToString();
                        model.name = row["realname"].ToString();
                        model.phone = row["phone"].ToString();
                        model.pic = ConfigHelper.ImagePath + row["pic"].ToString();
                        model.jialin = row["jialin"].ToString();
                        model.cishu = row["cishu"].ToString();
                        // model.istogether = Convert.ToInt32(row["IsTogether"].ToString());
                        if (Convert.ToBoolean(row["onservice"]))
                        {
                            model.state = "服务中";
                        }
                        else
                        {
                            model.state = "空闲中";
                        }
                        model.lat = row["lat"].ToString();
                        model.lng = row["lng"].ToString();
                        double mi = Convert.ToDouble(row["juli"]);
                        model.juli = mi;
                        model.jiguan = row["huji"].ToString();
                        if (!String.IsNullOrEmpty(row["idcode"].ToString()))
                        {
                            model.idcode = row["idcode"].ToString().Substring(0, row["idcode"].ToString().Length - 4) + "****";
                        }
                        else
                        {
                            model.idcode = String.Empty;
                        }
                        model.goodrate = row["hp"].ToString();
                        model.xinji = row["cp"].ToString();
                        drvModels.Add(model);
                    }
                }
            }
            catch
            {
            }
            return drvModels;
        }