Esempio n. 1
0
        public static A2ZTRNCODEDTO GetInformation(int TrnCode)
        {
            var prm = new object[1];

            prm[0] = TrnCode;



            DataTable dt = BLL.CommonManager.Instance.GetDataTableBySpWithParams("Sp_CSGetInfoTrnCode", prm, "A2ZCSCUBS");


            //DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZTRNCODE WHERE TrnCode = " + TrnCode, "A2ZCSMCUS");


            var p = new A2ZTRNCODEDTO();

            if (dt.Rows.Count > 0)
            {
                p.TrnCode        = Converter.GetInteger(dt.Rows[0]["TrnCode"]);
                p.TrnDescription = Converter.GetString(dt.Rows[0]["TrnDes"]);
                p.AccType        = Converter.GetInteger(dt.Rows[0]["AccType"]);
                p.AccTypeMode    = Converter.GetSmallInteger(dt.Rows[0]["AccTypeMode"]);
                p.PayType        = Converter.GetSmallInteger(dt.Rows[0]["PayType"]);
                return(p);
            }
            p.TrnCode = 0;

            return(p);
        }
Esempio n. 2
0
        public static int UpdateInformation01(A2ZTRNCODEDTO dto)
        {
            dto.TrnDescription = (dto.TrnDescription != null) ? dto.TrnDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = "UPDATE A2ZTRNCODE set TrnCode='" + dto.TrnCode + "', TrnDes='" + dto.TrnDescription + "' where AccType='" + dto.AccType + "'";

            rowEffect = Converter.GetInteger(BLL.CommonManager.Instance.ExecuteNonQuery(strQuery, "A2ZCSCUBS"));
            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Esempio n. 3
0
        public static int InsertInformation(A2ZTRNCODEDTO dto)
        {
            dto.TrnDescription = (dto.TrnDescription != null) ? dto.TrnDescription.Trim().Replace("'", "''") : "";
            int    rowEffect = 0;
            string strQuery  = @"INSERT into A2ZTRNCODE(TrnCode,TrnDes,AccType,AccTypeMode,PayType)values('" + dto.TrnCode + "','" + dto.TrnDescription + "','" + dto.AccType + "','" + dto.AccTypeMode + "','" + dto.PayType + "')";

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

            if (rowEffect == 0)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Esempio n. 4
0
        public static A2ZTRNCODEDTO GetInformation999(int AType, Int64 AccountNo)
        {
            DataTable dt = BLL.CommonManager.Instance.GetDataTableByQuery("SELECT * FROM A2ZTRNCODE WHERE AccType = '" + AType + "' and AccNo = '" + AccountNo + "'", "A2ZCSCUBS");

            var p = new A2ZTRNCODEDTO();

            if (dt.Rows.Count > 0)
            {
                p.TrnCode        = Converter.GetInteger(dt.Rows[0]["TrnCode"]);
                p.TrnDescription = Converter.GetString(dt.Rows[0]["TrnDes"]);
                p.AccType        = Converter.GetInteger(dt.Rows[0]["AccType"]);
                p.AccTypeMode    = Converter.GetSmallInteger(dt.Rows[0]["AccTypeMode"]);
                return(p);
            }
            p.TrnCode = 0;

            return(p);
        }