Exemplo n.º 1
0
        public string AccountingForQueryGYD(String StartFph, int Number)
        {
            List <AccountingInfo> accList = new List <AccountingInfo>();
            string comm = @"SELECT top {1} kprq,fph,( SELECT    SUM(kpje)
                                    FROM      yx_t_ddfpgxb
                                    WHERE     fpid = a.id
                                ) AS je  FROM yx_t_fpxxb AS a 
                            WHERE FPH>='{0}'
                            ORDER BY fph";

            comm = String.Format(comm, StartFph, Number);
            nrWebClass.LiLanzDAL dal = new nrWebClass.LiLanzDAL("14204");
            using (IDataReader reader = dal.ExecuteReader(comm))
            {
                while (reader.Read())
                {
                    AccountingInfo acc = new AccountingInfo();
                    acc.Rq  = DateTime.Parse(reader[0].ToString());
                    acc.Fph = reader[1].ToString();
                    acc.Je  = Decimal.Parse(reader[2].ToString());
                    accList.Add(acc);
                }
            }
            XmlSerializer serializer = new XmlSerializer(typeof(List <AccountingInfo>));
            StringWriter  textWriter = new StringWriter();

            serializer.Serialize(textWriter, accList);
            return(textWriter.ToString());
        }
Exemplo n.º 2
0
        public string AccountingForQuery(String StartFph, int Number, string filter)
        {
            List <AccountingInfo> accList = new List <AccountingInfo>();
            string comm      = @"select top {0} a.kprq,a.pjh,a.hsje,a.sje,a.hsje-a.sje as bhsje,a.khmc,
            case when a.djbs=1 and djzt=0 then '未开票' when a.djbs=1 and djzt=1 then '正常填开' when a.djbs=0 then '作废' end as fpzt,
            case a.pjlx when 11 then '普通发票' when 12 then  '增值税专用发票' end as pjlx,djbs,djzt
            from zw_t_pjxxb a 
            inner join zw_t_pjkcd b 
            on a.rkid=b.id 
            {1}
            where b.tzid=1 
            order by pjh";
            string SqlFilter = "";

            if (StartFph != "")
            {
                SqlFilter = String.Format(@" and a.pjh>={0} ", StartFph);
            }
            if (filter != "")
            {
                SqlFilter += filter;
            }
            comm = String.Format(comm, Number, SqlFilter);
            nrWebClass.LiLanzDAL dal = new nrWebClass.LiLanzDAL();
            using (IDataReader reader = dal.ExecuteReader(comm))
            {
                while (reader.Read())
                {
                    AccountingInfo acc = new AccountingInfo();
                    acc.Rq      = DateTime.Parse(reader[0].ToString());
                    acc.Fph     = reader[1].ToString();
                    acc.Je      = Decimal.Parse(reader[2].ToString());
                    acc.Amount  = Decimal.Parse(reader[4].ToString());
                    acc.DutyFee = Decimal.Parse(reader[3].ToString());
                    if (reader["djbs"].ToString() == "1")
                    {
                        if (reader["djzt"].ToString() == "1")
                        {
                            acc.Status = 1;
                        }
                        else
                        {
                            acc.Status = 0;
                        }
                    }
                    else
                    {
                        acc.Status = 2;
                    }
                    accList.Add(acc);
                }
            }
            XmlSerializer serializer = new XmlSerializer(typeof(List <AccountingInfo>));
            StringWriter  textWriter = new StringWriter();

            serializer.Serialize(textWriter, accList);
            return(textWriter.ToString());
        }