void dgSMS_CellClick(object sender, DataGridViewCellEventArgs e) { using (GetAPI api = new GetAPI()) { var value = api.GetAPIs().Where(x => x.ID == Convert.ToInt64(dgSMS.SelectedRows[0].Cells[0].Value)).FirstOrDefault(); if (value != null) { txtSite.Text = value.Site; txtPage.Text = value.Page; txtMobile.Text = value.ParamMobileName; txtMessage.Text = value.ParamMessageName; cbActive.Checked = value.Active.Value; btnDelete = SystemProperties.BtnProperties(btnDelete, true, Imagename.Delete.ToString(), Imagename._delete.ToString()); btnEdit = SystemProperties.BtnProperties(btnEdit, true, Imagename.Edit.ToString(), Imagename._edit.ToString()); } } }
void LoadURLLink() { int i = 1; dgSMS.Rows.Clear(); using (GetAPI api = new GetAPI()) { api.GetAPIs().ForEach(x => { dgSMS.Rows.Add(x.ID, i, x.Site, x.Page, x.ParamMobileName, x.ParamMessageName, x.Active); i++; }); } ObjEnable(false); dgSMS.Enabled = true; }