Esempio n. 1
0
        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);
                    }
                }
            }
        }
Esempio n. 2
0
 bool Cansave()
 {
     if (string.IsNullOrEmpty(GroupName))
     {
         CustomDialogBox tempDB = new CustomDialogBox("Enter GroupName.", DialogType.Information);
         tempDB.ShowDialog();
         return(false);
     }
     else
     {
         return(true);
     }
 }
Esempio n. 3
0
 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());
     }
 }