예제 #1
0
        public int InvioceSelect(String invoiceNumber, String invoiceCode)
        {
            String sql = String.Format(@" select a.id from dbo.zw_t_pjkcd a
                                        INNER JOIN dbo.zw_t_pjxxb b ON a.id=b.rkid
                                        WHERE b.fpdm='{0}' AND b.pjh='{1}'",
                                       invoiceNumber, invoiceCode);

            nrWebClass.LiLanzDAL dal = new nrWebClass.LiLanzDAL();
            int i = dal.ExecuteNonQuery(sql);

            return(i);
        }
예제 #2
0
        public int InvioceVoid(int id, String invoiceNumber, String invoiceCode)
        {
            String sql = String.Format(@"UPDATE yx_t_fpxxb SET shbs=0,shr='',shrq=getdate(),fph='',fpdm='',fpzdr='' where shbs=1 and  id={2};
                                         update a set djbs=0,djzt=1  
                                         from zw_t_pjxxb a inner join zw_t_pjkcd b on a.rkid=b.id and b.shbs=1 where a.pjh='{0}' and a.fpdm='{1}' ",
                                       invoiceNumber, invoiceCode, id);

            nrWebClass.LiLanzDAL dal = new nrWebClass.LiLanzDAL();
            int i = dal.ExecuteNonQuery(sql);

            return(i);
        }
예제 #3
0
        public int InvioceUpdate(int id, DateTime invioceDate, String sn, String invoiceCode, string printer, double Amount, double TaxAmount)
        {
            String sql = String.Format(@"declare @hsje decimal(10,2),@sje decimal(10,2),@khmc varchar(100);
                                         select @hsje=sum(b.je),@sje=sum(round(b.je,2)-ROUND(b.je/1.17,2)),@khmc=max(f.zhmc) 
                                        FROM dbo.yx_t_fpxxb a INNER JOIN dbo.yx_t_fpxxmxb b ON a.id=b.id
                                        inner join zw_t_yhzlb f on a.khid=f.id   WHERE a.id='{4}';
                                        UPDATE yx_t_fpxxb SET kprq='{0}', fph='{1}', fpdm='{2}',fpzdr='{3}' where id={4};
                                         update a set djbs=1,djzt=1,hsje={5},sbl=0.17,sje={6},khmc=@khmc,kprq='{0}'  
                                         from zw_t_pjxxb a inner join zw_t_pjkcd b on a.rkid=b.id and b.shbs=1 where a.pjh='{1}' and a.fpdm='{2}' ",
                                       invioceDate, sn, invoiceCode, printer, id, Amount, TaxAmount);

            nrWebClass.LiLanzDAL dal = new nrWebClass.LiLanzDAL();
            int i = dal.ExecuteNonQuery(sql);

            return(i);
        }