コード例 #1
0
ファイル: TaiKhoanSmsDAO.cs プロジェクト: 12130157/iso-system
        public static ArrayList getAllTaiKhoanSMS()
        {
            ArrayList  listTaiKhoanSMS = new ArrayList();
            String     sql             = ConfigurationManager.AppSettings["sql.getAllTaiKhoanSMS"];
            SqlCommand objCommand      = new SqlCommand(sql);

            DataTable result = DataUtil.executeQuery(objCommand);

            foreach (DataRow row in result.Rows)
            {
                TaiKhoanSmsMODEL taiKhoanSMSModel = new TaiKhoanSmsMODEL();

                taiKhoanSMSModel.Id                 = row["ID"].ToString();
                taiKhoanSMSModel.So_Dien_Thoai      = row["So_dien_thoai"].ToString();
                taiKhoanSMSModel.Ma_Sinh_Vien       = row["Ma_sinh_vien"].ToString();
                taiKhoanSMSModel.Loai_Tai_Khoan     = row["Loai_tai_khoan"].ToString();
                taiKhoanSMSModel.Ngay_Dang_Ki       = row["Ngay_dang_ki"].ToString();
                taiKhoanSMSModel.Ngay_Cap_Nhat_Cuoi = row["Ngay_cap_nhat_cuoi"].ToString();
                taiKhoanSMSModel.User11             = row["User1"].ToString();
                taiKhoanSMSModel.User21             = row["User2"].ToString();
                taiKhoanSMSModel.User31             = row["User3"].ToString();
                taiKhoanSMSModel.User41             = row["User4"].ToString();
                taiKhoanSMSModel.User51             = row["User5"].ToString();

                listTaiKhoanSMS.Add(taiKhoanSMSModel);
            }
            return(listTaiKhoanSMS);
        }
コード例 #2
0
ファイル: TaiKhoanSmsDAO.cs プロジェクト: 12130157/iso-system
        public TaiKhoanSmsMODEL getTaiKhoanSMSByID(int Ma_tai_khoan_SMS)
        {
            TaiKhoanSmsMODEL taiKhoanSMSModel = new TaiKhoanSmsMODEL();

            //String sql = ConfigurationManager.AppSettings["sql.getTaiKhoanSMSByID"];
            //SqlCommand objCommand = new SqlCommand(sql);
            //objCommand.Parameters.AddWithValue("@Ma_tai_khoan_SMS", Ma_tai_khoan_SMS);

            //DataTable result = DataUtil.executeQuery(objCommand);

            SqlParameter[] parameter = new SqlParameter[1];
            int            i         = 0;

            parameter[i]         = new SqlParameter("Ma_tai_khoan_SMS", SqlDbType.NVarChar);
            parameter[i++].Value = Ma_tai_khoan_SMS;

            DataTable result = DataUtil.executeStore("sp_getTaiKhoanSMSByID", parameter);

            foreach (DataRow row in result.Rows)
            {
                taiKhoanSMSModel.Id                 = row["ID"].ToString();
                taiKhoanSMSModel.So_Dien_Thoai      = row["So_dien_thoai"].ToString();
                taiKhoanSMSModel.Ma_Sinh_Vien       = row["Ma_sinh_vien"].ToString();
                taiKhoanSMSModel.Loai_Tai_Khoan     = row["Loai_tai_khoan"].ToString();
                taiKhoanSMSModel.Ngay_Dang_Ki       = row["Ngay_dang_kY"].ToString();
                taiKhoanSMSModel.Ngay_Cap_Nhat_Cuoi = row["Ngay_cap_nhat_cuoi"].ToString();
                taiKhoanSMSModel.User11             = row["User1"].ToString();
                taiKhoanSMSModel.User21             = row["User2"].ToString();
                taiKhoanSMSModel.User31             = row["User3"].ToString();
                taiKhoanSMSModel.User41             = row["User4"].ToString();
                taiKhoanSMSModel.User51             = row["User5"].ToString();
            }
            return(taiKhoanSMSModel);
        }
コード例 #3
0
ファイル: FormAddAccount.cs プロジェクト: 12130157/iso-system
        private void loaddata()
        {
            taiKhoanSMSModel = taiKhoanSMSDao.getTaiKhoanSMSByID(Convert.ToInt32(Constants.id));

            txt_NumberPhone.Text = taiKhoanSMSModel.So_Dien_Thoai;
            txt_StudentID.Text   = taiKhoanSMSModel.Ma_Sinh_Vien;
            dtp_NgayDangKy.Text  = taiKhoanSMSModel.Ngay_Dang_Ki;

            // kiện selected  cua cbo_AccountType
            loaiTaiKhoanSMSModel         = loaiTaiKhoanSMSDao.getLoaiTaiKhoanSMSByID(Convert.ToInt32(taiKhoanSMSModel.Loai_Tai_Khoan));
            cbo_AccountType.SelectedText = loaiTaiKhoanSMSModel.Ten.ToString();
            txt_ServiceCharges.Text      = loaiTaiKhoanSMSModel.Phi_Dich_Vu;
            txt_Note.Text = loaiTaiKhoanSMSModel.Ghi_Chu;
        }
コード例 #4
0
ファイル: TaiKhoanSmsDAO.cs プロジェクト: 12130157/iso-system
        public Boolean updateTaiKhoanSMSById(TaiKhoanSmsMODEL taiKhoanSMSModel)
        {
            try
            {
                SqlParameter[] parameter = new SqlParameter[11];
                int            i         = 0;

                parameter[i]         = new SqlParameter("ID", SqlDbType.NVarChar);
                parameter[i++].Value = taiKhoanSMSModel.Id;

                parameter[i]         = new SqlParameter("So_dien_thoai", SqlDbType.NVarChar);
                parameter[i++].Value = taiKhoanSMSModel.So_Dien_Thoai;

                parameter[i]         = new SqlParameter("Ma_sinh_vien", SqlDbType.NVarChar);
                parameter[i++].Value = taiKhoanSMSModel.Ma_Sinh_Vien;

                parameter[i]         = new SqlParameter("Loai_tai_khoan", SqlDbType.NVarChar);
                parameter[i++].Value = taiKhoanSMSModel.Loai_Tai_Khoan;

                parameter[i]         = new SqlParameter("Ngay_dang_ky", SqlDbType.NVarChar);
                parameter[i++].Value = taiKhoanSMSModel.Ngay_Dang_Ki;

                parameter[i]         = new SqlParameter("Ngay_cap_nhat_cuoi", SqlDbType.NVarChar);
                parameter[i++].Value = "";

                parameter[i]         = new SqlParameter("User1", SqlDbType.VarChar);
                parameter[i++].Value = "";

                parameter[i]         = new SqlParameter("User2", SqlDbType.NVarChar);
                parameter[i++].Value = "";

                parameter[i]         = new SqlParameter("User3", SqlDbType.NVarChar);
                parameter[i++].Value = "";

                parameter[i]         = new SqlParameter("User4", SqlDbType.NVarChar);
                parameter[i++].Value = "";

                parameter[i]         = new SqlParameter("User5", SqlDbType.NVarChar);
                parameter[i++].Value = "";

                Boolean kq = DataUtil.executeNonStore("sp_SMS_UpdateTaiKhoanSMSByID", parameter);
                return(kq);
            }
            catch (Exception)
            {
                throw;
            }
        }