Exemplo n.º 1
0
 /// <summary>
 /// 获取下一级地区列表
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static List <Model.Model.w_address_basic_data> GetNextAddressListFromId(int id)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.w_address_basic_data), "TopAddressID=@id", new SqlParameter[] {
         new SqlParameter("@id", id)
     });
     ids = db.Read(sql);
     return(ids.GetVOList <Model.Model.w_address_basic_data>());
 }
Exemplo n.º 2
0
 //用户绑定物流判断
 public static Tuple <bool, string, List <Model.Model.LC_User> > GetUserBindingsList(string Phone)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "ZNumber='" + Phone + "'");
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(new Tuple <bool, string, List <Model.Model.LC_User> >(false, ids.errormsg, null));
     }
     if (ids.ReadIsOk())
     {
         return(new Tuple <bool, string, List <Model.Model.LC_User> >(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()));
     }
     return(new Tuple <bool, string, List <Model.Model.LC_User> >(true, "没有任何数据!", new List <Model.Model.LC_User>()));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 根据ID获取用户数据
 /// </summary>
 /// <param name="id"></param>
 /// <param name="db"></param>
 /// <returns></returns>
 internal static Tuple <bool, string, Model.Model.LC_User> GetUserVoFromId(long id, SuperDataBase.Model.DBSandbox db)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "id=@id", new SqlParameter[] {
         new SqlParameter("@id", id)
     }, string.Empty, 1);
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(new Tuple <bool, string, Model.Model.LC_User>(false, ids.errormsg, null));
     }
     if (!ids.ReadIsOk())
     {
         return(new Tuple <bool, string, Model.Model.LC_User>(false, "没有任何数据!", null));
     }
     return(new Tuple <bool, string, Model.Model.LC_User>(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()[0]));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 根据UID获取用户数据
 /// </summary>
 /// <param name="uid"></param>
 /// <returns></returns>
 internal static (bool, string, Model.Model.LC_User) GetUserVoFromUID(string uid)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "uid=@uid", new SqlParameter[] {
         new SqlParameter("@id", uid)
     }, string.Empty, 1);
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(false, ids.errormsg, null);
     }
     if (!ids.ReadIsOk())
     {
         return(false, "没有任何数据!", null);
     }
     return(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()[0]);
 }
Exemplo n.º 5
0
 public static (bool, string, int) GetLineCountKXZ(string logisticsID)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_Line), "UID=@logisticsID", new SqlParameter[] {
         new SqlParameter("@logisticsID", logisticsID)
     });
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(false, ids.errormsg, 0);
     }
     if (!ids.ReadIsOk())
     {
         return(false, "没有任何数据!", 0);
     }
     return(true, string.Empty, ids.num);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 根据OPENID获取用户数据
 /// </summary>
 /// <param name="openid"></param>
 /// <returns></returns>
 public static (bool, string, Model.Model.LC_User) GetUserVOFromOpenID(string openid, SuperDataBase.Model.DBSandbox db)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_User), "wx_openid=@wx_openid", new SqlParameter[] {
         new SqlParameter("@wx_openid", openid)
     });
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(false, ids.errormsg, null);
     }
     if (!ids.ReadIsOk())
     {
         return(false, "没有找到任何数据!", null);
     }
     return(true, string.Empty, ids.GetVOList <Model.Model.LC_User>()[0]);
 }
Exemplo n.º 7
0
 /// <summary>
 /// 根据收货电话筛选地区
 /// </summary>
 /// <param name="Phone"></param>
 /// <returns></returns>
 public static Tuple <bool, string, List <Model.Model.LC_Customer> > GetPhoneAdressList(string Phone)
 {
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_Customer), "SHPhone=@SHPhone", new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@SHPhone", Phone)
     }, "DdTime desc", 1);
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(new Tuple <bool, string, List <Model.Model.LC_Customer> >(false, ids.errormsg, null));
     }
     if (ids.ReadIsOk())
     {
         return(new Tuple <bool, string, List <Model.Model.LC_Customer> >(true, string.Empty, ids.GetVOList <Model.Model.LC_Customer>()));
     }
     return(new Tuple <bool, string, List <Model.Model.LC_Customer> >(true, "没有任何数据!", new List <Model.Model.LC_Customer>()));
 }
Exemplo n.º 8
0
        /// <summary>
        /// 生成货号
        /// </summary>
        /// <param name="lc"></param>
        /// <returns></returns>
        public static Tuple <bool, string> GetGoodNo(ref Model.Model.LC_Customer lc)
        {
            sql = makesql.MakeSelectSql(typeof(Model.Model.LC_Line), "[End]=@End", new SqlParameter[] {
                new SqlParameter("@End", lc.finish)
            });
            ids = db.Read(sql);
            if (!ids.flag)
            {
                Tools.SaveLog.AddLog(ids.errormsg, "获取路线错误");
            }
            if (!ids.ReadIsOk())
            {
                return(new Tuple <bool, string>(false, "没有任何数据!"));
            }

            Model.Model.LC_Line lcl = ids.GetVOList <Model.Model.LC_Line>()[0];

            DateTime starttime = DateTime.Now.ToString("yyyy-MM-dd 00:00:00").ConvertData <DateTime>();
            DateTime endtime   = DateTime.Now.ToString("yyyy-MM-dd 23:59:59").ConvertData <DateTime>();

            //获取当前线路当日总单数
            sql = makesql.MakeCount(nameof(Model.Model.LC_Customer), "finish=@finish and DdTime between @starttime and @endtime", new SqlParameter[] {
                new SqlParameter("@finish", lcl.End),
                new SqlParameter("@starttime", starttime),
                new SqlParameter("@endtime", endtime)
            });
            ids = db.Read(sql);
            if (!ids.flag)
            {
                return(new Tuple <bool, string>(false, ids.errormsg));
            }

            long nowOrderNumber = ids.Count();

            StringBuilder goodbuffer = new StringBuilder();

            goodbuffer.Append(lcl.Lineletter);
            goodbuffer.Append(DateTime.Now.Day.ToString().PadLeft(2, '0'));
            goodbuffer.Append("-");
            goodbuffer.Append(nowOrderNumber);
            goodbuffer.Append("-");
            goodbuffer.Append(lc.Number);
            return(new Tuple <bool, string>(true, goodbuffer.ToString()));
        }
Exemplo n.º 9
0
 /// <summary>
 /// 获取职位数据
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static (bool, string, Model.Model.LC_Position) GetPosition(int?id)
 {
     if (id.ConvertData <int>() <= 0)
     {
         return(false, "没有数据", null);
     }
     sql = makesql.MakeSelectSql(typeof(Model.Model.LC_Position), "id=@id", new SqlParameter[] {
         new SqlParameter("@id", id)
     });
     ids = db.Read(sql);
     if (!ids.flag)
     {
         return(false, ids.errormsg, null);
     }
     if (!ids.ReadIsOk())
     {
         return(false, "没有任何数据!", null);
     }
     return(true, string.Empty, ids.GetVOList <Model.Model.LC_Position>()[0]);
 }
Exemplo n.º 10
0
        private static long 未回收汇总(UserLoginVO myuservo, DateTime starttime, DateTime endtime, string startuid, string enduid)
        {
            string where = string.Empty;
            if (!starttime.IsNull() && !endtime.IsNull())
            {
                where += " and a.LastOperationTime between @starttime and @endtime";
            }
            if (startuid.StrIsNotNull() && enduid.StrIsNotNull())
            {
                where += " and b.beginUID=@beginUID and b.finishUID=@finishUID";
            }
            else
            {
                startuid = string.Empty;
                enduid   = string.Empty;
            }
            //获取与我相关的全部订单
            sql = new SuperDataBase.Vo.SqlVO($@"SELECT
	                count(OrderNumber)
                FROM
	                {nameof(Model.Model.LC_Payment_History)} a,
	                {nameof(Model.Model.LC_Customer)} b
                WHERE
	                a.OrderNumber = b.OrderID AND
                b.finishUID ='{myuservo.uid}' {where}
                group by OrderNumber");
            ids = db.Read(sql);
            if (!ids.flag)
            {
                return(0);
            }
            long allnum = ids.Count();
            long yssnum = 获取回收汇总(myuservo, starttime, endtime, startuid, enduid);

            return(allnum - yssnum);
        }