//this methoud to connect to services class to update data in authors table public bool AuthorsUpdate() { connectBetweenModelInterface(); DateTime d1 = Convert.ToDateTime(authorsModels.AuthorDate); string d2 = d1.ToString("dd/MM/yyyy"); return(AuthoresServices.authoresUpdate(authorsModels.ID, authorsModels.AuthorName, d2, authorsModels.CountryID)); }
public bool DeleteAuthorAll() { connectBetweenModelInterface(); bool check = AuthoresServices.DeleteAuthorAll(); AutoNumber(); return(check); }
public DataTable getLastRow() { DataTable tbl = new DataTable(); tbl = AuthoresServices.getLastRow(); return(tbl); }
public void getRow(int row) { DataTable tbl = new DataTable(); tbl = AuthoresServices.getAllAuthorDataCountryID(); iAuthors.ID = Convert.ToInt32(tbl.Rows[row][0]); iAuthors.AuthorName = Convert.ToString(tbl.Rows[row][1]); try { DateTime dt = DateTime.ParseExact(Convert.ToString(tbl.Rows[row][2]), "dd/MM/yyyy", null); iAuthors.AuthorDate = dt.ToString(); } catch (Exception) { } iAuthors.selectdValue = Convert.ToInt32(tbl.Rows[row][3]); iAuthors.btnSave = true; iAuthors.btnDelete = true; iAuthors.btnDeleteAll = true; iAuthors.btnAdd = false; }
public void AutoNumber() { string val = Convert.ToString(AuthoresServices.getAuthorMaxID().Rows[0][0]); if (val == null || val == "") { iAuthors.ID = 1; } else { iAuthors.ID = Convert.ToInt32(AuthoresServices.getAuthorMaxID().Rows[0][0]) + 1; } iAuthors.AuthorName = ""; iAuthors.AuthorDate = DateTime.Now.ToShortDateString(); iAuthors.selectdIndex = 0; iAuthors.Dgv = AuthoresServices.getAllAuthorData(); iAuthors.btnSave = false; iAuthors.btnDelete = false; iAuthors.btnDeleteAll = false; iAuthors.btnAdd = true; }
public void FillCbx() { iAuthors.cbxCountry = AuthoresServices.getAllData(); iAuthors.AuthorDisplayMember = "اسم الدولة"; iAuthors.AuthorValueMember = "رقم الدولة"; }