Esempio n. 1
0
        public List <LLBill> NeighborBill(string id, string userName, double lng, double lat, int curPage, int pageSize)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            DataTable     dt     = Function.NeighbourBill(curPage, pageSize, lng, lat);
            List <LLBill> result = new List <LLBill>();

            foreach (DataRow row in dt.Rows)
            {
                LLBill n = new LLBill();
                n.id        = row["ID"].ToString();                                                   //客户
                n.client    = row["CLIENT"].ToString();                                               //客户
                n.code      = row["CODE"].ToString();                                                 //单号
                n.depar     = row["DEPAR"].ToString();                                                //部门
                n.finshdate = Convert.ToDateTime(row["FINSHDATE"].ToString()).ToString("yyyy-MM-dd"); //要求完成时间
                n.id        = row["ID"].ToString();
                n.inserter  = row["INSERTER"].ToString();                                             //提出人
                n.machinecn = row["MACHINECN"].ToString();                                            //机床编号
                n.mtitle    = row["MTITLE"].ToString();                                               //内容
                n.type      = row["TYPE"].ToString();                                                 //状态
                n.distance  = row["DISTANCE"].ToString() + "km";                                      //距离
                n.contactor = row["CONTACTOR"].ToString();                                            //联系人
                n.phone     = row["PHONE"].ToString();                                                //电话
                n.lng       = row["ZF29"].ToString();                                                 //经度
                n.lat       = row["ZF30"].ToString();                                                 //纬度
                result.Add(n);
            }
            return(result);
        }
Esempio n. 2
0
        public List <LLBill> GetDBBill(string client, string userName, string dept)//获取待办事项
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            List <LLBill> result = new List <LLBill>();

            string where = "";
            if (dept.Contains("维修"))
            {
                where = " and (depar = '" + userName + "'  or  depar = '维修部' or depar = '智能化' )";
            }
            if (dept.Contains("业务") || dept.Contains("销售") || dept.Contains("文员"))
            {
                where = " and (depar = '" + userName + "'  or  depar = '销售部' or depar = '智能化' )";
            }
            string sql = " select top 15 * from " +
                         "   (select * from L_ContactSheet as aa " +
                         "   left join " +
                         "   (select name, ZF29, ZF30,CONTACTOR,PHONE from clientservice_kfku ) as bb on aa.Client = bb.NAME " +
                         "   ) as cc" +
                         "   where  type=0  and del =0  and  Client='" + client + "' " + where + "  order by finshdate   ";
            DataTable tb = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            foreach (DataRow row in tb.Rows)
            {
                LLBill n = new LLBill();
                n.id        = row["ID"].ToString();                                                   //客户
                n.client    = row["CLIENT"].ToString();                                               //客户
                n.code      = row["CODE"].ToString();                                                 //单号
                n.depar     = row["DEPAR"].ToString();                                                //部门
                n.finshdate = Convert.ToDateTime(row["FINSHDATE"].ToString()).ToString("yyyy-MM-dd"); //要求完成时间
                n.id        = row["ID"].ToString();
                n.inserter  = row["INSERTER"].ToString();                                             //提出人
                n.machinecn = row["MACHINECN"].ToString();                                            //机床编号
                n.mtitle    = row["MTITLE"].ToString();                                               //内容
                n.type      = row["TYPE"].ToString();                                                 //状态
                //n.distance = row["DISTANCE"].ToString()+"km"; //距离
                n.contactor = row["CONTACTOR"].ToString();                                            //联系人
                n.phone     = row["PHONE"].ToString();                                                //电话
                n.lng       = row["ZF29"].ToString();                                                 //经度
                n.lat       = row["ZF30"].ToString();                                                 //纬度
                result.Add(n);
            }
            return(result);
        }