示例#1
0
            public static bool DeleteAll()
            {
                List <Group> ListCache = List.ToArray().ToList();

                Logger.Log.SystemMessage("Deleteing All Groups...");
                foreach (Group ThisGroup in ListCache)
                {
                    GroupDB.Delete(ThisGroup);
                }
                string GroupsDir = "./Database/Groups/";

                Utilities.IO.PrepareDirectory("./Database/");
                Utilities.IO.PrepareDirectory("./Database/Groups");
                DirectoryInfo[] GroupsDirContents = new DirectoryInfo(GroupsDir).GetDirectories();
                foreach (DirectoryInfo ThisDir in GroupsDirContents)
                {
                    try
                    {
                        ThisDir.Delete(true);
                    }
                    catch (Exception e)
                    {
                        Logger.Log.Bug(e, String.Format("Directory In Use: {0}", ThisDir.FullName));
                    }
                }
                Logger.Log.SystemMessage("All Groups Deleted.");
                return(true);
            }
示例#2
0
 protected void dtgGroups_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "edit")
     {
         GroupInfo group = GroupDB.GetInfo(Convert.ToInt32(e.Item.Cells[0].Text));
         if (group == null)
         {
             cmdEmpty_Click(null, null);
             return;
         }
         txtID.Text   = group.Group_ID.ToString();
         txtName.Text = group.Group_Name;
         txtDes.Text  = group.Group_Description;
     }
     if (e.CommandName == "del")
     {
         try
         {
             GroupDB.Delete(Convert.ToInt32(e.Item.Cells[0].Text));
             lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS;
             cmdEmpty_Click(null, null);
         }
         catch
         {
             lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR;
         }
     }
     if (e.CommandName == "roles")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "maingroupcmdroles&groupid=" + e.Item.Cells[0].Text);
     }
     if (e.CommandName == "members")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "maingroupmembers&groupid=" + e.Item.Cells[0].Text);
     }
     if (e.CommandName == "stores")
     {
         Response.Redirect(AppEnv.ADMIN_CMD + "cmdusergroupstoremanagement&groupid=" + e.Item.Cells[0].Text);
     }
 }
示例#3
0
 public void Delete(Int32 ID)
 {
     m_db.Delete(ID);
 }