Ejemplo n.º 1
0
        public BillDetail Get(int nID, int nUserID)
        {
            Connection.Open();
            Command.CommandText = BillDetailDA.Get(nID, nUserID);

            SqlDataReader reader       = Command.ExecuteReader();
            BillDetail    _oBillDetail = new BillDetail();

            if (reader.HasRows)
            {
                _oBillDetail = MakeObject(reader);
            }
            reader.Close();
            Connection.Close();
            return(_oBillDetail);
        }
Ejemplo n.º 2
0
        public List <BillDetail> Gets(int nBUID, int nBillDetail)
        {
            Connection.Open();
            Command.CommandText = BillDetailDA.Gets(nBUID, nBillDetail);

            SqlDataReader     reader        = Command.ExecuteReader();
            BillDetail        _oBillDetail  = new BillDetail();
            List <BillDetail> _oBillDetails = new List <BillDetail>();

            if (reader.HasRows)
            {
                _oBillDetails = MakeObjects(reader);
            }
            reader.Close();
            Connection.Close();
            return(_oBillDetails);
        }
Ejemplo n.º 3
0
        public string Delete(BillDetail oBillDetail, int nUserID)
        {
            string sReturnMessage = "";

            Connection.Open();
            Command.CommandText = BillDetailDA.IUD(oBillDetail, EnumDBOperation.Delete, nUserID);
            try
            {
                Command.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                sReturnMessage = e.Message.Split('~')[0];
            }
            Connection.Close();
            return(sReturnMessage);
        }
Ejemplo n.º 4
0
        public BillDetail IUD(BillDetail oBillDetail, int nUserID)
        {
            Connection.Open();
            if (oBillDetail.BillDetailID == 0)
            {
                Command.CommandText = BillDetailDA.IUD(oBillDetail, EnumDBOperation.Insert, nUserID);
            }
            else
            {
                Command.CommandText = BillDetailDA.IUD(oBillDetail, EnumDBOperation.Update, nUserID);
            }
            SqlDataReader reader       = Command.ExecuteReader();
            BillDetail    _oBillDetail = new BillDetail();

            if (reader.HasRows)
            {
                _oBillDetail = MakeObject(reader);
            }
            reader.Close();
            Connection.Close();
            return(_oBillDetail);
        }