예제 #1
0
        public TelephoneModel UpdateTelephone(TelephoneModel telephoneModel)
        {
            DataTable dt = new DataTable();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(TelephoneStringsSql.UpdateTelephone(telephoneModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                telephoneModel = TelephoneModel.ToObject(ms);
            }
            return(telephoneModel);
        }
예제 #2
0
        public List <TelephoneModel> GetAllTelephones()
        {
            DataTable dt = new DataTable();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(TelephoneStringsSql.GetAllTelephones());
            }

            List <TelephoneModel> arrTelephone = new List <TelephoneModel>();

            foreach (DataRow ms in dt.Rows)
            {
                arrTelephone.Add(TelephoneModel.ToObject(ms));
            }
            return(arrTelephone);
        }
예제 #3
0
        public TelephoneModel GetOneBeforeTelephone(string beforeTelephone)
        {
            DataTable dt = new DataTable();

            if (beforeTelephone.Equals(string.Empty) || beforeTelephone.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            TelephoneModel telephoneModel = new TelephoneModel();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(TelephoneStringsSql.GetOneBeforeTelephone(beforeTelephone));
            }

            foreach (DataRow ms in dt.Rows)
            {
                telephoneModel = TelephoneModel.ToObject(ms);
            }
            return(telephoneModel);
        }