Example #1
0
        public List <FeeBill> MyFeeBills(string userName, 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();

            // P_MyBill result = new P_MyBill();
            int num = curPage * pageSize;
            // curPage++;
            string sql = " select top 10 o.* from( " +
                         " select row_number() over(order by id desc) as rownumber, a.* from( " +
                         " select * from TreatFee where BILLMAN = '" + userName + "' ) as a) as o where rownumber > " + num.ToString();
            DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            List <FeeBill> bills = new List <FeeBill>();

            foreach (DataRow row in dt.Rows)
            {
                FeeBill bill = new FeeBill();
                bill.billcode   = row["BILLCODE"].ToString();
                bill.billman    = row["BILLMAN"].ToString();
                bill.createtime = row["CREATETIME"].ToString();
                bill.state      = Convert.ToInt16(row["STATE"].ToString());
                if (bill.state == 0)
                {
                    bill.state_desc = "未审核";
                }
                else if (bill.state == 10)
                {
                    bill.state_desc = "审核通过";
                }
                else if (bill.state == -1)
                {
                    bill.state_desc = "审核失败";
                }
                bill.vbcode     = row["VBCODE"].ToString();
                bill.client     = row["CLIENT"].ToString();
                bill.eating     = row["EATING"].ToString();
                bill.other      = row["OTHER"].ToString();
                bill.person     = row["PERSON"].ToString();
                bill.traffic    = row["TRAFFIC"].ToString();
                bill.commission = row["COMMISSION"].ToString();
                bill.remark     = row["BLANK_STR_1"].ToString();
                bill.opinion    = row["BLANK_STR_2"].ToString();
                bills.Add(bill);
            }
            // result.list = bills;
            // result.page = curPage;
            return(bills);
        }
Example #2
0
        public List <FeeBill> FeeBills(string userName)
        {
            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 <FeeBill>  bills = new List <FeeBill>();
            TreatFee        t     = new TreatFee();
            List <TreatFee> list  = t.Select(" and BILLMAN='" + userName + "' order by id desc ");

            foreach (TreatFee tf in list)
            {
                FeeBill bill = new FeeBill();
                bill.billcode   = tf.BILLCODE;
                bill.billman    = tf.BILLMAN;
                bill.createtime = tf.CREATETIME;
                bill.state      = tf.STATE;
                if (bill.state == 0)
                {
                    bill.state_desc = "未审核";
                }
                else if (bill.state == 10)
                {
                    bill.state_desc = "审核通过";
                }
                else if (bill.state == -1)
                {
                    bill.state_desc = "审核失败";
                }
                bill.vbcode     = tf.VBCODE;
                bill.client     = tf.CLIENT;
                bill.eating     = tf.EATING;
                bill.other      = tf.OTHER;
                bill.person     = tf.PERSON;
                bill.traffic    = tf.TRAFFIC;
                bill.commission = tf.COMMISSION;
                bill.remark     = tf.BLANK_STR_1;
                bill.opinion    = tf.BLANK_STR_2;
                bills.Add(bill);
            }
            return(bills);
        }