public void Delete(object pp) { GroupMaster _DM = pp as GroupMaster; if (_DM != null) { if (_DM.GroupDetails.Where(w => w.IsDelete != true).Count() > 0) { CustomDialogBox tempDB = new CustomDialogBox("Already used by Details.", DialogType.Information); tempDB.ShowDialog(); } else { CustomDialogBox tempDB = new CustomDialogBox("Are you sure ?", DialogType.Question); bool? result = tempDB.ShowDialog(); if (result == true) { _DM.IsDelete = true; _DM.Deletedate = DateTime.Now; _Entities.Entry(_DM).State = EntityState.Modified; _Entities.SaveChanges(); _CollectionOfGroupMaster.Remove(_DM); } } } }
bool Cansave() { if (string.IsNullOrEmpty(GroupName)) { CustomDialogBox tempDB = new CustomDialogBox("Enter GroupName.", DialogType.Information); tempDB.ShowDialog(); return(false); } else { return(true); } }
public void Login(object pp) { try { // System.Windows.MessageBox.Show(_Entities.Database.Connection.ConnectionString); UserMaster _user = _Entities.UserMasters.Where(w => w.UserName == UserName && w.Password == UserPassword).SingleOrDefault(); if (_user != null) { loginGrid = "Hidden"; VisAll = "Visible"; Userlogin = _user.UserName; } else { CustomDialogBox tempDB = new CustomDialogBox("UserName And Password Not Correct.", DialogType.Information); tempDB.ShowDialog(); } } catch (Exception ex) { System.Windows.MessageBox.Show(ex.ToString()); } }