示例#1
0
        public int DeleteCellphone(string beforeCellphone)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(CellphoneStringsMySql.DeleteCellphone(beforeCellphone));
            }

            return(i);
        }
示例#2
0
        public CellphoneModel UpdateCellphone(CellphoneModel cellphoneModel)
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CellphoneStringsMySql.UpdateCellphone(cellphoneModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                cellphoneModel = CellphoneModel.ToObject(ms);
            }

            return(cellphoneModel);
        }
示例#3
0
        public List <CellphoneModel> GetAllCellphones()
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CellphoneStringsMySql.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 (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CellphoneStringsMySql.GetOneBeforeCellphone(beforeCellphone));
            }

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

            return(cellphoneModel);
        }