예제 #1
0
        public int DeleteCellphone(string beforeCellphone)
        {
            int i = 0;

            using (OleDbCommand command = new OleDbCommand())
            {
                i = ExecuteNonQuery(CellphoneStringsInner.DeleteCellphone(beforeCellphone));
            }

            return(i);
        }
예제 #2
0
        public CellphoneModel UpdateCellphone(CellphoneModel cellphoneModel)
        {
            int i = -1;

            using (OleDbCommand command = new OleDbCommand())
            {
                i = ExecuteNonQuery(CellphoneStringsInner.UpdateCellphone(cellphoneModel));
            }

            return(GetOneBeforeCellphone(cellphoneModel.beforeCellphone));
        }
예제 #3
0
        public List <CellphoneModel> GetAllCellphones()
        {
            DataTable dt = new DataTable();

            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(CellphoneStringsInner.GetAllCellphones());
            }

            List <CellphoneModel> arrCellphone = new List <CellphoneModel>();

            foreach (DataRow ms in dt.Rows)
            {
                arrCellphone.Add(CellphoneModel.ToObject(ms));
            }

            return(arrCellphone);
        }
예제 #4
0
        public CellphoneModel GetOneBeforeCellphone(string beforeCellphone)
        {
            DataTable dt = new DataTable();

            if (beforeCellphone.Equals(string.Empty) || beforeCellphone.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            CellphoneModel cellphoneModel = new CellphoneModel();

            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(CellphoneStringsInner.GetOneBeforeCellphone(beforeCellphone));
            }

            foreach (DataRow ms in dt.Rows)
            {
                cellphoneModel = CellphoneModel.ToObject(ms);
            }

            return(cellphoneModel);
        }