Ejemplo n.º 1
0
        public bool Insert(string WardForName)
        {
            WardForDAC wardforComponent = new WardForDAC();
            int        WardForId        = 0;

            return(wardforComponent.InsertNewWardFor(ref WardForId, WardForName));
        }
Ejemplo n.º 2
0
        public List <WardFor> GetAll()
        {
            WardForDAC     _wardForComponent = new WardForDAC();
            IDataReader    reader            = _wardForComponent.GetAllWardFor().CreateDataReader();
            List <WardFor> _wardForList      = new List <WardFor>();

            while (reader.Read())
            {
                if (_wardForList == null)
                {
                    _wardForList = new List <WardFor>();
                }
                WardFor _wardFor = new WardFor();
                if (reader["WardForId"] != DBNull.Value)
                {
                    _wardFor.WardForId = Convert.ToInt32(reader["WardForId"]);
                }
                if (reader["WardForName"] != DBNull.Value)
                {
                    _wardFor.WardForName = Convert.ToString(reader["WardForName"]);
                }
                _wardFor.NewRecord = false;
                _wardForList.Add(_wardFor);
            }
            reader.Close();
            return(_wardForList);
        }
Ejemplo n.º 3
0
        public bool Insert(WardFor wardfor)
        {
            int        autonumber       = 0;
            WardForDAC wardforComponent = new WardForDAC();
            bool       endedSuccessfuly = wardforComponent.InsertNewWardFor(ref autonumber, wardfor.WardForName);

            if (endedSuccessfuly)
            {
                wardfor.WardForId = autonumber;
            }
            return(endedSuccessfuly);
        }
Ejemplo n.º 4
0
        public WardFor GetByID(int _wardForId)
        {
            WardForDAC  _wardForComponent = new WardForDAC();
            IDataReader reader            = _wardForComponent.GetByIDWardFor(_wardForId);
            WardFor     _wardFor          = null;

            while (reader.Read())
            {
                _wardFor = new WardFor();
                if (reader["WardForId"] != DBNull.Value)
                {
                    _wardFor.WardForId = Convert.ToInt32(reader["WardForId"]);
                }
                if (reader["WardForName"] != DBNull.Value)
                {
                    _wardFor.WardForName = Convert.ToString(reader["WardForName"]);
                }
                _wardFor.NewRecord = false;
            }
            reader.Close();
            return(_wardFor);
        }
Ejemplo n.º 5
0
        public void Delete(int Original_WardForId)
        {
            WardForDAC wardforComponent = new WardForDAC();

            wardforComponent.DeleteWardFor(Original_WardForId);
        }
Ejemplo n.º 6
0
        public bool Update(string WardForName, int Original_WardForId)
        {
            WardForDAC wardforComponent = new WardForDAC();

            return(wardforComponent.UpdateWardFor(WardForName, Original_WardForId));
        }
Ejemplo n.º 7
0
        public bool Update(WardFor wardfor, int old_wardForId)
        {
            WardForDAC wardforComponent = new WardForDAC();

            return(wardforComponent.UpdateWardFor(wardfor.WardForName, old_wardForId));
        }
Ejemplo n.º 8
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            WardForDAC wardforcomponent = new WardForDAC();

            return(wardforcomponent.UpdateDataset(dataset));
        }