Beispiel #1
0
        public VSBill YW_Detail_Bill(string code)
        {
            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();
            L_VisitSend s  = new L_VisitSend();
            VSBill      vs = new VSBill();
            //未接收消息
            List <L_VisitSend> list = s.Select(" and CODE='" + code + "' ");

            if (list.Count <= 0)
            {
                return(null);//没有未接收消息
            }
            else
            {
                L_VisitSend l = list[0];
                vs.id        = l.ID;
                vs.client    = l.VISITCLIENT;
                vs.hisname   = l.VISITNAME;
                vs.hisphone  = l.VISITTEL;
                vs.content   = l.VISITCONTENT;
                vs.notice    = l.DOTHING;
                vs.visittype = l.VISITTYPE;
                vs.date      = l.VISITDATE.ToShortDateString();
                vs.state     = l.STATE;
                vs.code      = l.CODE;
            }
            return(vs);
        }
Beispiel #2
0
        public List <VSBill> YWBillGet(string userName, string where)
        {
            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();
            L_VisitSend   s          = new L_VisitSend();
            List <VSBill> returnlist = new List <VSBill>();
            string        today_1    = System.DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
            string        today      = System.DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
            //未接收消息
            List <L_VisitSend> list = s.Select(" and SENDUSER='******'  and  LEFT(CODE,1)<>'*'   and  VISITDATE < '" + today + "'  " + where, " top 20 * ");

            if (list.Count <= 0)
            {
                return(null);//没有消息
            }
            else
            {
                foreach (L_VisitSend l in list)
                {
                    VSBill vs = new VSBill();
                    vs.id        = l.ID;
                    vs.client    = l.VISITCLIENT;
                    vs.hisname   = l.VISITNAME;
                    vs.hisphone  = l.VISITTEL;
                    vs.content   = l.VISITCONTENT;
                    vs.notice    = l.DOTHING;
                    vs.visittype = l.VISITTYPE;
                    vs.date      = l.VISITDATE.ToShortDateString();
                    vs.code      = l.CODE;
                    vs.state     = l.STATE;
                    vs.rq1       = l.RQ1.ToString();
                    vs.rq2       = l.RQ2.ToString();
                    vs.zf5       = l.ZF5;
                    returnlist.Add(vs);
                }
            }
            return(returnlist);
        }
Beispiel #3
0
        public List <VSBill> YWBillGet_P(string userName, int index, 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();
            int           num        = curPage * pageSize;
            List <VSBill> returnlist = new List <VSBill>();
            //未接收消息
            string ORDER = " order by id ";
            string WHERE = string.Empty;

            if (index == 0)//未接收
            {
                WHERE = " and state=0 and visittype='上门拜访' ";
            }
            else if (index == 1)//处理中
            {
                WHERE = " and state=7 and visittype='上门拜访' ";
            }
            else//完成
            {
                WHERE = " and state=10 and visittype='上门拜访' ";
                ORDER = " order by id desc ";
            }
            string today = System.DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
            string sql   = " select top " + pageSize.ToString() + " o.* from (  " +
                           " select row_number() over(" + ORDER + ") as rownumber, N_A.* from( " +
                           " select * from L_VisitSend " +
                           " where 1 = 1  and SENDUSER='******' and  LEFT(CODE,1)<>'*'  and  VISITDATE < '" + today + "'  " + WHERE +
                           " ) as N_A) as o where rownumber> " + num.ToString();
            DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            // List<L_VisitSend> list = s.Select(" and SENDUSER='******'  and  LEFT(CODE,1)<>'*'   and  VISITDATE < '" + today + "'  " + where, " top 20 * ");
            if (dt == null || dt.Rows.Count <= 0)
            {
                return(null);//没有消息
            }
            else
            {
                foreach (DataRow row in dt.Rows)
                {
                    VSBill vs = new VSBill();
                    vs.id        = Convert.ToInt32(row["ID"].ToString());
                    vs.client    = row["VISITCLIENT"].ToString();
                    vs.hisname   = row["VISITNAME"].ToString();
                    vs.hisphone  = row["VISITTEL"].ToString();
                    vs.content   = row["VISITCONTENT"].ToString();
                    vs.notice    = row["DOTHING"].ToString();
                    vs.visittype = row["VISITTYPE"].ToString();
                    vs.date      = row["VISITDATE"].ToString();
                    vs.code      = row["CODE"].ToString();
                    vs.state     = Convert.ToInt32(row["STATE"].ToString());
                    vs.rq1       = row["RQ1"].ToString();
                    vs.rq2       = row["RQ2"].ToString();
                    vs.zf5       = row["ZF5"].ToString();
                    returnlist.Add(vs);
                }
            }
            return(returnlist);
        }