Esempio n. 1
0
 /// <summary>
 /// 根据工号获取司机信息
 /// </summary>
 /// <param name="ucode"></param>
 /// <returns></returns>
 public DriverInfoEntity GetDriverInfoByUcode(string ucode)
 {
     AdjDBObject adjDbObject = new AdjDBObject();
     string sql = "SELECT * FROM [dbo].[D_DriverInfo] (NOLOCK) WHERE Ucode = @Ucode";
     adjDbObject.GetSqlStringCommand(sql);
     adjDbObject.AddInParameter("@Ucode", DbType.String, ucode);
     try
     {
         using (IDataReader dr = adjDbObject.ExecuteReader())
         {
             List<DriverInfoEntity> users = GlobalFunction.GetEntityList<DriverInfoEntity>(dr);
             if (users != null)
             {
                 return users[0];
             }
             else
             {
                 return null;
             }
         }
     }
     catch (Exception e)
     {
         LogHelper lh = new LogHelper();
         lh.log(e.ToString(), HttpContext.Current.Server.MapPath("Log/error"));
         return null;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 判断优惠券是否存在
 /// </summary>
 /// <param name="couponCode"></param>
 /// <returns></returns>
 public bool isExistCoupon(string couponCode)
 {
     AdjDBObject adjDbObject = new AdjDBObject();
     adjDbObject.GetSqlStringCommand("select count(1) from d_youhui where Youhuima = @Youhuima");
     adjDbObject.AddInParameter("@Youhuima", System.Data.DbType.String, couponCode);
     return Convert.ToInt32(adjDbObject.ExecuteScalar()) > 0;
 }
 public bool CreateDistributeOrderStatusChangeLog(DistributeOrderStatusChangeLogEntity model)
 {
     try
        {
        AdjDBObject adjDbObject = new AdjDBObject();
        string sql = "INSERT INTO D_DistributeOrderStatusChangeLog(DistributeOrderId,Status,StatusText,create_time,create_user )VALUES(@DistributeOrderId,@Status,@StatusText,getdate(),@create_user )";
        adjDbObject.GetSqlStringCommand(sql);
        adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId);
        adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status);
        adjDbObject.AddInParameter("@StatusText", DbType.String, model.StatusText);
        adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user);
        adjDbObject.Execute();
        return true;
        }
        catch (Exception)
        {
        return false;
        }
 }
 /// <summary>
 /// 创建派单明细
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool CreateDistributeOrderDetail(DistributeOrderDetailEntity model)
 {
     try
     {
         AdjDBObject adjDbObject = new AdjDBObject();
         StringBuilder strSql = new StringBuilder();
         strSql.Append("insert into D_DistributeOrderDetail(");
         strSql.Append("delete_time,delete_user,DistributeOrderId,Status,Ucode,create_time,create_user,update_time,update_user,delete_flag");
         strSql.Append(") values (");
         strSql.Append("NULL,NULL,@DistributeOrderId,@Status,@Ucode,GETDATE(),@create_user,NULL,NULL,NULL");
         strSql.Append(") ");
         adjDbObject.GetSqlStringCommand(strSql.ToString());
         adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId);
         adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status);
         adjDbObject.AddInParameter("@Ucode", DbType.String, model.Ucode);
         adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user);
         adjDbObject.Execute();
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
Esempio n. 5
0
 /// <summary>
 /// ADO获取实体BY SIGN
 /// </summary>
 /// <param name="sign"></param>
 /// <returns></returns>
 public T_ParterEntity GetParterModelBySign(string sign)
 {
     T_ParterEntity pEntity = null;
     AdjDBObject adjDbObject = new AdjDBObject();
     string cmdtext = "select * from dbo.T_Parter (nolock) WHERE  sign=@sign";
     adjDbObject.GetSqlStringCommand(cmdtext);
     adjDbObject.AddInParameter("@sign", DbType.String, sign);
     using (IDataReader datareader = adjDbObject.ExecuteReader())
     {
         List<T_ParterEntity> reList = GlobalFunction.GetEntityList<T_ParterEntity>(datareader);
         if (reList != null)
         {
             pEntity = reList[0];
         }
     }
     return pEntity;
 }
Esempio n. 6
0
 /// <summary>
 /// 新增一条投诉记录
 /// </summary>
 /// <param name="complain"></param>
 /// <returns></returns>
 public int addComplain(D_OrderComplaint complain)
 {
     AdjDBObject db = new AdjDBObject();
     StringBuilder sb = new StringBuilder();
     sb.AppendLine("insert into D_OrderComplaint ");
     sb.AppendLine("(OrderId ,CustomerId,CustomerName,Cellphone,Ucode,DriverName,ComplaintType,ComplaintContent,create_time,create_user,delete_flag)");
     sb.AppendLine("values");
     sb.AppendLine("(@OrderId ,@CustomerId,@CustomerName,@Cellphone,@Ucode,@DriverName,1,@ComplaintContent,getdate(),@create_user,0)");
     db.GetSqlStringCommand(sb.ToString());
     db.AddInParameter("@OrderId",System.Data.DbType.String,complain.OrderId);
     db.AddInParameter("@CustomerId", System.Data.DbType.String, complain.CustomerId);
     db.AddInParameter("@CustomerName", System.Data.DbType.String, complain.CustomerName);
     db.AddInParameter("@Cellphone", System.Data.DbType.String, complain.Cellphone);
     db.AddInParameter("@Ucode", System.Data.DbType.String, complain.Ucode);
     db.AddInParameter("@DriverName", System.Data.DbType.String, complain.DriverName);
     db.AddInParameter("@ComplaintContent", System.Data.DbType.String, complain.ComplaintContent);
     db.AddInParameter("@create_user", System.Data.DbType.String, complain.CreateUser);
     return db.Execute();
 }
Esempio n. 7
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("没有该订单");
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 根据sign获取当天访问量
 /// </summary>
 /// <param name="sign"></param>
 /// <returns></returns>
 public int GetcountBysign(string sign)
 {
     int cou = 0;
     try
     {
         AdjDBObject adjDbObject = new AdjDBObject();
         string cmdtext = "select count(*) as counts  from T_ParterDyLog where sign=@sign  and addtime between'" +
                     DateTime.Now.ToString("yyyy-MM-dd") + "' and '" +
                     DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + "' ";
         adjDbObject.GetSqlStringCommand(cmdtext);
         adjDbObject.AddInParameter("@sign", DbType.String, sign);
         cou = int.Parse(adjDbObject.ExecuteScalar().ToString());
     }
     catch (Exception ex)
     {
         cou = 0;
     }
     return cou;
 }
Esempio n. 9
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;
     }
 }
Esempio n. 10
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("签名错误。");
            }
        }
Esempio n. 11
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;
        }
 }
Esempio n. 12
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("签名错误。");
            }
        }
Esempio n. 13
0
        public bool AddParterDyLog(T_ParterDyLog model)
        {
            AdjDBObject adjDbObject = new AdjDBObject();
            bool isok = true;
            try
            {
                adjDbObject.GetStoredProcCommand("sp3_T_ParterDyLog_i");
                adjDbObject.AddOutParameter("@id", DbType.Int32, 4);
                adjDbObject.AddInParameter("@sign", DbType.String, model.sign);
                adjDbObject.AddInParameter("@typeid", DbType.Int32, model.typeid);
                adjDbObject.AddInParameter("@imei", DbType.String, model.imei);
                adjDbObject.AddInParameter("@lat", DbType.String, model.lat);
                adjDbObject.AddInParameter("@lng", DbType.String, model.lng);
                adjDbObject.AddInParameter("@addtime", DbType.DateTime, model.addtime);
                adjDbObject.Execute();

            }
            catch (Exception ex)
            {
                isok = false;
            }
            return isok;
        }
Esempio n. 14
0
 public bool addCoupon(string couponsCode, double couponsValue, string partyid, CustomerInfoEntity ci)
 {
     AdjDBObject adjDbObject = new AdjDBObject();
     StringBuilder sb = new StringBuilder();
     sb.AppendLine("insert into d_youhui");
     sb.AppendLine("(BatchId,cardcode,Money,Youhuima,Type,UseState,property,usecount,Remark ,Addtime,CREATE_USER,ExpiredDate,UsePeople,UserPeopleId,UserType)");
     sb.AppendLine("values");
     sb.AppendLine("(@BatchId,@cardcode,@Money,@Youhuima,@Type,@UseState,@property,@usecount,@Remark ,@Addtime,@CREATE_USER,@ExpiredDate,@UsePeople,@UserPeopleId,@UserType)");
     adjDbObject.GetSqlStringCommand(sb.ToString());
     adjDbObject.AddInParameter("@BatchId",System.Data.DbType.Int32,0);
     adjDbObject.AddInParameter("@cardcode", System.Data.DbType.String, couponsCode);
     adjDbObject.AddInParameter("@Money", System.Data.DbType.Decimal, couponsValue);
     adjDbObject.AddInParameter("@Youhuima", System.Data.DbType.String, couponsCode);
     adjDbObject.AddInParameter("@Type", System.Data.DbType.Int32, 0);
     adjDbObject.AddInParameter("@UseState", System.Data.DbType.Int32, 0);
     adjDbObject.AddInParameter("@property", System.Data.DbType.Int32, 20);
     adjDbObject.AddInParameter("@usecount", System.Data.DbType.Int32, 0);
     adjDbObject.AddInParameter("@Remark", System.Data.DbType.String, partyid);
     adjDbObject.AddInParameter("@Addtime", System.Data.DbType.DateTime, DateTime.Now);
     adjDbObject.AddInParameter("@CREATE_USER", System.Data.DbType.String, "Third Party");
     adjDbObject.AddInParameter("@ExpiredDate", System.Data.DbType.DateTime, DateTime.Now.AddYears(1));
     adjDbObject.AddInParameter("@UsePeople", System.Data.DbType.String, "");
     adjDbObject.AddInParameter("@UserPeopleId", System.Data.DbType.String, ci.CustomerId);
     adjDbObject.AddInParameter("@UserType", System.Data.DbType.String, 1);
     return adjDbObject.Execute() > 0;
 }
 /// <summary>
 /// 添加预约
 /// </summary>
 /// <param name="model">预约实体</param>
 /// <returns></returns>
 public bool AddAppointmentOrderInfo(AppointmentOrderInfoEntity model)
 {
     AdjDBObject adjDbObject = new AdjDBObject();
     bool isok = true;
     try
     {
         adjDbObject.GetStoredProcCommand("sp3_D_AppointmentOrderInfo_i");
         adjDbObject.AddOutParameter("@Id", DbType.Int32, 4);
         adjDbObject.AddInParameter("@AppointOrderId", DbType.String, model.AppointOrderId);
         adjDbObject.AddInParameter("@OrderId", DbType.String, model.OrderId);
         adjDbObject.AddInParameter("@AppointOrderType", DbType.Int32, model.AppointOrderType);
         adjDbObject.AddInParameter("@AppointOrderState", DbType.Int32, model.AppointOrderState);
         adjDbObject.AddInParameter("@BusinessType", DbType.Int32, model.BusinessType);
         adjDbObject.AddInParameter("@AppointOrderFrom", DbType.Int32, model.AppointOrderFrom);
         adjDbObject.AddInParameter("@CustomerId", DbType.String, model.CustomerId);
         adjDbObject.AddInParameter("@CustomerName", DbType.String, model.CustomerName);
         adjDbObject.AddInParameter("@CustomerType", DbType.Int32, model.CustomerType);
         adjDbObject.AddInParameter("@AccountType", DbType.Int32, model.AccountType);
         adjDbObject.AddInParameter("@Cellphone", DbType.String, model.Cellphone);
         adjDbObject.AddInParameter("@FromCellphone", DbType.String, model.FromCellphone);
         adjDbObject.AddInParameter("@AppointAddress", DbType.String, model.AppointAddress);
         adjDbObject.AddInParameter("@AppointTimeStr", DbType.String, model.AppointTimeStr);
         adjDbObject.AddInParameter("@AppointTime", DbType.DateTime, model.AppointTime);
         //adjDbObject.AddInParameter("@EstimateEndTime", DbType.DateTime, model.EstimateEndTime);
         adjDbObject.AddInParameter("@IsLock", DbType.Boolean, false);
         adjDbObject.AddInParameter("@LockUser", DbType.String, model.LockUser);
         adjDbObject.AddInParameter("@partyId", DbType.Int32, model.PartyId);
         adjDbObject.AddInParameter("@SendOrderUser", DbType.String, model.SendOrderUser);
         adjDbObject.AddInParameter("@AppointOrderSign", DbType.String, model.AppointOrderSign);
         adjDbObject.AddInParameter("@PhoneCallTime", DbType.Int32, model.PhoneCallTime);
         adjDbObject.AddInParameter("@lng", DbType.Double, model.Lng);
         adjDbObject.AddInParameter("@lat", DbType.Double, model.Lat);
         adjDbObject.AddInParameter("@create_time", DbType.DateTime, model.Create_time);
         adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user);
         //adjDbObject.AddInParameter("@update_time", DbType.DateTime, model.Update_time);
         // adjDbObject.AddInParameter("@update_user", DbType.String, model.Update_user);
         //adjDbObject.AddInParameter("@delete_time", DbType.DateTime, model.Delete_time);
         // adjDbObject.AddInParameter("@delete_user", DbType.String, model.Delete_user);
         // adjDbObject.AddInParameter("@delete_flag", DbType.Boolean, model.Delete_flag);
         adjDbObject.Execute();
     }
     catch (Exception ex)
     {
         isok = false;
     }
     return isok;
 }
Esempio n. 16
0
        /// <summary>
        /// 根据ID获取司机工号
        /// </summary>
        /// <returns></returns>
        public string GetUcodeById(string uid)
        {
            string result = string.Empty;
            AdjDBObject adjDbObject = new AdjDBObject();
            string sql = "SELECT top 1 Ucode FROM [dbo].[D_DriverInfo] (NOLOCK) WHERE  id= @uid";
            adjDbObject.GetSqlStringCommand(sql);
            adjDbObject.AddInParameter("@uid", DbType.String, uid);
            try
            {
                using (IDataReader dr = adjDbObject.ExecuteReader())
                {
                    if (dr.Read())
                    {
                        result = dr[0].ToString();
                    }
                    return result;
                }
            }
            catch (Exception)
            {

                return "";
            }
        }
        /// <summary>
        /// 添加派单
        /// </summary>
        /// <param name="model">派单实体</param>
        /// <returns></returns>
        public bool AddDistributeOrderInfo(DistributeOrderInfoEntity model)
        {
            AdjDBObject adjDbObject = new AdjDBObject();
            bool isok = true;
            try
            {
                StringBuilder strSql = new StringBuilder();
                strSql.Append("insert into D_DistributeOrderInfo(");
                strSql.Append("PartyId,DistributeUser,Cellphone,Address,SuccessTime,Ucode,lng,lat,CustomerId,CustomerName,CustomerType,DistributeOrderId,AccountType,FromCellphone,AppointmentTime,create_time,create_user,update_time,update_user,delete_flag,delete_time,delete_user,AppointOrderId,OrderId,BusinessType,OrderFrom,OrderType,Status,DistributeUserType");
                strSql.Append(") values (");
                strSql.Append("@PartyId,@DistributeUser,@Cellphone,@Address,@SuccessTime,@Ucode,@lng,@lat,@CustomerId,@CustomerName,@CustomerType,@DistributeOrderId,@AccountType,@FromCellphone,@AppointmentTime,GETDATE(),@create_user,@update_time,@update_user,@delete_flag,@delete_time,@delete_user,@AppointOrderId,@OrderId,@BusinessType,@OrderFrom,@OrderType,@Status,@DistributeUserType");
                strSql.Append(") ");

                adjDbObject.GetSqlStringCommand(strSql.ToString());
                adjDbObject.AddInParameter("@partyId", DbType.String, model.PartyId);
                adjDbObject.AddInParameter("@DistributeUser", DbType.String, model.DistributeUser);
                adjDbObject.AddInParameter("@Cellphone", DbType.String, model.Cellphone);
                adjDbObject.AddInParameter("@Address", DbType.String, model.Address);
                adjDbObject.AddInParameter("@SuccessTime", DbType.DateTime, model.SuccessTime);
                adjDbObject.AddInParameter("@Ucode", DbType.String, model.Ucode);
                adjDbObject.AddInParameter("@lng", DbType.Decimal, model.Lng);
                adjDbObject.AddInParameter("@lat", DbType.Decimal, model.Lat);
                adjDbObject.AddInParameter("@CustomerId", DbType.String, model.CustomerId);
                adjDbObject.AddInParameter("@CustomerName", DbType.String, model.CustomerName);
                adjDbObject.AddInParameter("@CustomerType", DbType.Int32, model.CustomerType);
                adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId);
                adjDbObject.AddInParameter("@AccountType", DbType.Int32, model.AccountType);
                adjDbObject.AddInParameter("@FromCellphone", DbType.String, model.Fromcellphone);
                adjDbObject.AddInParameter("@AppointmentTime", DbType.DateTime, model.AppointmentTime);
                adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user);
                adjDbObject.AddInParameter("@update_time", DbType.DateTime, model.Update_time);
                adjDbObject.AddInParameter("@update_user", DbType.String, model.Update_user);
                adjDbObject.AddInParameter("@delete_flag", DbType.Boolean, model.Delete_flag);
                adjDbObject.AddInParameter("@delete_time", DbType.DateTime, model.Delete_time);
                adjDbObject.AddInParameter("@delete_user", DbType.String, model.Delete_user);
                adjDbObject.AddInParameter("@AppointOrderId", DbType.String, model.AppointOrderId);
                adjDbObject.AddInParameter("@OrderId", DbType.String, model.OrderId);
                adjDbObject.AddInParameter("@BusinessType", DbType.Int32, model.BusinessType);
                adjDbObject.AddInParameter("@OrderFrom", DbType.Int32, model.OrderFrom);
                adjDbObject.AddInParameter("@OrderType", DbType.Int32, model.OrderType);
                adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status);
                adjDbObject.AddInParameter("@DistributeUserType", DbType.Int32, model.DistributeUserType);
                adjDbObject.Execute();
            }
            catch (Exception ex)
            {
                isok = false;
            }
            return isok;
        }
 public bool UpdateOnDoService(int OnDoService, string ucode)
 {
     bool isok = false;
     string sql = "UPDATE dbo.D_DriverInfo SET OnDOService = @OnDOService WHERE Ucode = @Ucode";
     AdjDBObject adjDbObject = new AdjDBObject();
     adjDbObject.GetSqlStringCommand(sql);
     adjDbObject.AddInParameter("@OnDOService", DbType.Int32, OnDoService);
     adjDbObject.AddInParameter("@Ucode", DbType.String, ucode);
     int i = adjDbObject.Execute();
     if (i != 0)
     {
         isok = true;
     }
     return isok;
 }
Esempio n. 19
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;
        }
Esempio n. 20
0
        /// <summary>
        /// 添加新用户
        /// </summary>
        /// <returns></returns>
        public bool AddCustomerInfo(CustomerInfoEntity accident)
        {
            bool isok = true;
            AdjDBObject adjdbobject = new AdjDBObject();
            try
            {
                string cmdtext =
                    "INSERT INTO dbo.D_CustomerInfo( CustomerId ,CustomerName ,RecommendCode ,Cellphone ,Email ,HomeAddress ,CustomerType ,AccountType ,IsNewCustomer ,LastCalledAddress ,Amount ,BusinessmanId ,create_time ,create_user,ParentPhone ) VALUES(@CustomerId ,@CustomerName ,@RecommendCode ,@Cellphone, @Email, @HomeAddress, @CustomerType ,@AccountType ,@IsNewCustomer, @LastCalledAddress, @Amount ,@BusinessmanId ,@create_time, @create_user,@ParentPhone )";

                adjdbobject.GetSqlStringCommand(cmdtext);
                adjdbobject.AddInParameter("@CustomerId", DbType.String, accident.CustomerId);
                adjdbobject.AddInParameter("@CustomerName", DbType.String, accident.CustomerName);
                adjdbobject.AddInParameter("@RecommendCode", DbType.String, accident.RecommendCode);
                adjdbobject.AddInParameter("@Cellphone", DbType.String, accident.Cellphone);
                adjdbobject.AddInParameter("@ParentPhone", DbType.String, accident.ParentPhone);
                adjdbobject.AddInParameter("@Email", DbType.String, "");
                adjdbobject.AddInParameter("@HomeAddress", DbType.String, accident.HomeAddress);
                adjdbobject.AddInParameter("@CustomerType", DbType.Int32, accident.CustomerType);
                adjdbobject.AddInParameter("@AccountType", DbType.Int32, accident.AccountType);
                adjdbobject.AddInParameter("@IsNewCustomer", DbType.Int32, accident.IsNewCustomer);
                adjdbobject.AddInParameter("@LastCalledAddress", DbType.String, accident.LastCalledAddress);
                adjdbobject.AddInParameter("@Amount", DbType.Decimal, accident.Amount);
                adjdbobject.AddInParameter("@BusinessmanId", DbType.Int32, accident.BusinessmanId);
                adjdbobject.AddInParameter("@create_time", DbType.DateTime, DateTime.Now);
                adjdbobject.AddInParameter("@create_user", DbType.String, "ThirdPartyAPI");
              adjdbobject.Execute();
            }
            catch (Exception ex)
            {
                isok = false;
            }
            return isok;
        }
Esempio n. 21
0
 /// <summary>
 /// 根据电话号码获取客户实体
 /// </summary>
 /// <param name="phone">电话号码</param>
 /// <returns></returns>
 public CustomerInfoEntity GetClientInfoByPhone(string phone)
 {
     CustomerInfoEntity tuijian = null;
        // AdjDBObject dbObject = new AdjDBObject("NewAidaijia");
     AdjDBObject adjDbObject = new AdjDBObject();
     string cmdtext = "select * from D_CustomerInfo WITH(NOLOCK) where cellphone=@phone";
     adjDbObject.GetSqlStringCommand(cmdtext);
     adjDbObject.AddInParameter("@phone", DbType.String, phone);
     using (IDataReader datareader = adjDbObject.ExecuteReader())
     {
         List<CustomerInfoEntity> reList = GlobalFunction.GetEntityList<CustomerInfoEntity>(datareader);
         if (reList != null)
         {
             tuijian = reList[0];
         }
     }
     return tuijian;
 }