Example #1
0
        public static int UpdateInformation(A2ZRECCTRLNODTO dto)
        {
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZRECCTRLNO set CtrlGLCashCode='" + dto.GLCashCode + "', CtrlRecType='" + dto.RecType + "',CtrlRecLastNo='" + dto.RecLastNo + "' WHERE CtrlGLCashCode ='" + dto.GLCashCode + "'and CtrlRecType='" + dto.RecType + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZCSCUBS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Example #2
0
        public static int InsertInformation(A2ZRECCTRLNODTO dto)
        {
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZRECCTRLNO(CtrlGLCashCode,CtrlRecType,CtrlRecLastNo)values('" + dto.GLCashCode + "','" + dto.RecType + "','" + dto.RecLastNo + "')";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZCSCUBS"));

            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Example #3
0
        public static A2ZRECCTRLNODTO GetInformation(int GLCashCode, Int16 RecType)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZRECCTRLNO WHERE CtrlGLCashCode='" + GLCashCode + "' and  CtrlRecType='" + RecType + "' ", "A2ZCSCUBS");


            var p = new A2ZRECCTRLNODTO();

            if (dt.Rows.Count > 0)
            {
                p.GLCashCode = Converter.GetInteger(dt.Rows[0]["CtrlGLCashCode"]);
                p.RecType    = Converter.GetSmallInteger(dt.Rows[0]["CtrlRecType"]);
                p.RecLastNo  = Converter.GetInteger(dt.Rows[0]["CtrlRecLastNo"]);
                p.Record     = Converter.GetInteger(1);
                return(p);
            }
            p.Record = 0;
            return(p);
        }
Example #4
0
        public static A2ZRECCTRLNODTO ReadLastVoucherNo(int CashCode, Int16 RecType)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZRECCTRLNO WHERE CtrlGLCashCode ='" + CashCode + "' and  CtrlRecType='" + RecType + "' ", "A2ZACOMS");


            var p = new A2ZRECCTRLNODTO();

            if (dt.Rows.Count > 0)
            {
                p.GLCashCode = Converter.GetInteger(dt.Rows[0]["CtrlGLCashCode"]);
                p.RecLastNo  = Converter.GetInteger(dt.Rows[0]["CtrlRecLastNo"]);


                return(p);
            }
            p.GLCashCode = 0;
            return(p);
        }
Example #5
0
        //---------------------------  VOUCHER'S INFORMATIONS ------------------------

        public static A2ZRECCTRLNODTO GetLastVoucherNo(int CashCode, Int16 RecType)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZRECCTRLNO WHERE CtrlGLCashCode ='" + CashCode + "' and  CtrlRecType='" + RecType + "'", "A2ZCSCUBS");


            var p = new A2ZRECCTRLNODTO();

            if (dt.Rows.Count > 0)
            {
                p.GLCashCode = Converter.GetInteger(dt.Rows[0]["CtrlGLCashCode"]);
                p.RecType    = Converter.GetSmallInteger(dt.Rows[0]["CtrlRecType"]);
                p.RecLastNo  = Converter.GetInteger(dt.Rows[0]["CtrlRecLastNo"]);
                p.RecLastNo  = p.RecLastNo + 1;

                int    rowEffect = 0;
                string strQuery  = "UPDATE A2ZRECCTRLNO set CtrlGLCashCode='" + p.GLCashCode + "', CtrlRecType='" + p.RecType + "',CtrlRecLastNo='" + p.RecLastNo + "' WHERE CtrlGLCashCode ='" + p.GLCashCode + "'and CtrlRecType='" + p.RecType + "'";
                rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZCSCUBS"));

                return(p);
            }
            p.GLCashCode = 0;
            return(p);
        }