Esempio n. 1
0
        public WardSpeciality GetByID(int _wardSpeciality)
        {
            WardSpecialityDAC _wardSpecialityComponent = new WardSpecialityDAC();
            IDataReader       reader           = _wardSpecialityComponent.GetByIDWardSpeciality(_wardSpeciality);
            WardSpeciality    _wardSpecialitys = null;

            while (reader.Read())
            {
                _wardSpecialitys = new WardSpeciality();
                if (reader["WardSpeciality"] != DBNull.Value)
                {
                    _wardSpecialitys.WardSpecialityId = Convert.ToInt32(reader["WardSpeciality"]);
                }
                if (reader["WardId"] != DBNull.Value)
                {
                    _wardSpecialitys.WardId = Convert.ToInt32(reader["WardId"]);
                }
                if (reader["SpecialityId"] != DBNull.Value)
                {
                    _wardSpecialitys.SpecialityId = Convert.ToInt32(reader["SpecialityId"]);
                }
                if (reader["IsMainSpeciality"] != DBNull.Value)
                {
                    _wardSpecialitys.IsMainSpeciality = Convert.ToBoolean(reader["IsMainSpeciality"]);
                }
                if (reader["SpecialityOrder"] != DBNull.Value)
                {
                    _wardSpecialitys.SpecialityOrder = Convert.ToInt32(reader["SpecialityOrder"]);
                }
                _wardSpecialitys.NewRecord = false;
            }
            reader.Close();
            return(_wardSpecialitys);
        }
Esempio n. 2
0
        public bool Insert(int WardId, int SpecialityId, bool IsMainSpeciality, int SpecialityOrder)
        {
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();
            int WardSpeciality = 0;

            return(wardspecialityComponent.InsertNewWardSpeciality(ref WardSpeciality, WardId, SpecialityId, IsMainSpeciality, SpecialityOrder));
        }
Esempio n. 3
0
        public List <WardSpeciality> GetAll()
        {
            WardSpecialityDAC     _wardSpecialityComponent = new WardSpecialityDAC();
            IDataReader           reader = _wardSpecialityComponent.GetAllWardSpeciality().CreateDataReader();
            List <WardSpeciality> _wardSpecialityList = new List <WardSpeciality>();

            while (reader.Read())
            {
                if (_wardSpecialityList == null)
                {
                    _wardSpecialityList = new List <WardSpeciality>();
                }
                WardSpeciality _wardSpeciality = new WardSpeciality();
                if (reader["WardSpecialityId"] != DBNull.Value)
                {
                    _wardSpeciality.WardSpecialityId = Convert.ToInt32(reader["WardSpecialityId"]);
                }
                if (reader["WardId"] != DBNull.Value)
                {
                    _wardSpeciality.WardId = Convert.ToInt32(reader["WardId"]);
                }
                if (reader["SpecialityId"] != DBNull.Value)
                {
                    _wardSpeciality.SpecialityId = Convert.ToInt32(reader["SpecialityId"]);
                }
                if (reader["IsMain"] != DBNull.Value)
                {
                    _wardSpeciality.IsMain = Convert.ToBoolean(reader["IsMain"]);
                }
                _wardSpeciality.NewRecord = false;
                _wardSpecialityList.Add(_wardSpeciality);
            }
            reader.Close();
            return(_wardSpecialityList);
        }
Esempio n. 4
0
        public bool Insert(WardSpeciality wardspeciality)
        {
            int autonumber = 0;
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();
            bool endedSuccessfuly = wardspecialityComponent.InsertNewWardSpeciality(ref autonumber, wardspeciality.WardId, wardspeciality.SpecialityId, wardspeciality.IsMainSpeciality, wardspeciality.SpecialityOrder);

            if (endedSuccessfuly)
            {
                wardspeciality.WardSpecialityId = autonumber;
            }
            return(endedSuccessfuly);
        }
Esempio n. 5
0
        public bool Update(int WardId, int SpecialityId, bool IsMainSpeciality, int SpecialityOrder, int Original_WardSpeciality)
        {
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();

            return(wardspecialityComponent.UpdateWardSpeciality(WardId, SpecialityId, IsMainSpeciality, SpecialityOrder, Original_WardSpeciality));
        }
Esempio n. 6
0
        public bool Update(WardSpeciality wardspeciality, int old_wardSpeciality)
        {
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();

            return(wardspecialityComponent.UpdateWardSpeciality(wardspeciality.WardId, wardspeciality.SpecialityId, wardspeciality.IsMainSpeciality, wardspeciality.SpecialityOrder, old_wardSpeciality));
        }
Esempio n. 7
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            WardSpecialityDAC wardspecialitycomponent = new WardSpecialityDAC();

            return(wardspecialitycomponent.UpdateDataset(dataset));
        }
Esempio n. 8
0
        public void Delete(int Original_WardSpeciality)
        {
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();

            wardspecialityComponent.DeleteWardSpeciality(Original_WardSpeciality);
        }
Esempio n. 9
0
        public bool Insert(ref int WardSpecialityId, int WardId, int SpecialityId, bool IsMain)
        {
            WardSpecialityDAC wardspecialityComponent = new WardSpecialityDAC();

            return(wardspecialityComponent.InsertNewWardSpeciality(ref WardSpecialityId, WardId, SpecialityId, IsMain));
        }