Exemplo n.º 1
0
 private void LoadGrid()
 {
     DataSet ds;
     ds = new LandlordDAO().SelectAllDataset();
     ds.Tables[0].PrimaryKey = new DataColumn[] { ds.Tables[0].Columns["LandlordId"] };
     gvLandloadList.SettingsText.ConfirmDelete = Messages.Delete_Confirm;
     gvLandloadList.DataSource = ds.Tables[0];
     gvLandloadList.DataBind();
 }
Exemplo n.º 2
0
        public bool Save()
        {
            bool result = false;

            Database     db         = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
            DbConnection connection = db.CreateConnection();

            connection.Open();
            DbTransaction transaction = connection.BeginTransaction();

            try
            {
                LandlordDAO landlordDAO = new LandlordDAO();
                if (landlordDAO.IsLandlordExist(this))
                {
                    result = landlordDAO.Update(this, db, transaction);
                }
                else
                {
                    result = landlordDAO.Insert(this, db, transaction);
                }

                transaction.Commit();
            }
            catch (System.Exception ex)
            {
                transaction.Rollback();
                result = false;
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return(result);
        }
Exemplo n.º 3
0
        public bool Save()
        {
            bool result = false;

            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
            DbConnection connection = db.CreateConnection();
            connection.Open();
            DbTransaction transaction = connection.BeginTransaction();

            try
            {
                LandlordDAO landlordDAO = new LandlordDAO();
                if (landlordDAO.IsLandlordExist(this))
                {
                    result = landlordDAO.Update(this, db, transaction);
                }
                else
                {
                    result = landlordDAO.Insert(this, db, transaction);
                }

                transaction.Commit();
            }
            catch (System.Exception ex)
            {
                transaction.Rollback();
                result = false;
                throw ex;
            }
            finally
            {
                connection.Close();
            }
            return result;
        }
Exemplo n.º 4
0
 public DataSet SelectAllDataset()
 {
     LandlordDAO landlordDAO = new LandlordDAO();
     return landlordDAO.SelectAllDataset();
 }
Exemplo n.º 5
0
        public DataSet SelectAllDataset()
        {
            LandlordDAO landlordDAO = new LandlordDAO();

            return(landlordDAO.SelectAllDataset());
        }