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(); }
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); }
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; }
public DataSet SelectAllDataset() { LandlordDAO landlordDAO = new LandlordDAO(); return landlordDAO.SelectAllDataset(); }
public DataSet SelectAllDataset() { LandlordDAO landlordDAO = new LandlordDAO(); return(landlordDAO.SelectAllDataset()); }