Exemplo n.º 1
0
        public bool RemoveAct(System.Guid idAct)
        {
            Action instance = Db.Actions.Where(p => p.ID_Act == idAct).FirstOrDefault();

            if (instance != null)
            {
                DelData backup = new DelData()
                {
                    DeletedData = "Action" +
                                  "|" + instance.ID_Act.ToString() +
                                  "|" + instance.Whom.ToString() +
                                  "|" + instance.What.ToString() +
                                  "|" + instance.When.ToString() +
                                  "|" + instance.Todo.ToString() +
                                  "|" + instance.Coment +
                                  "|" + instance.AdminID.ToString()
                };
                Db.DelDatas.InsertOnSubmit(backup); //бэкапим данные

                Db.Actions.DeleteOnSubmit(instance);
                Db.Actions.Context.SubmitChanges();
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public bool RemoveItem(System.Guid idItem)
        {
            Item instance = Db.Items.Where(p => p.ID_Item == idItem).FirstOrDefault();

            if (instance != null)
            {
                DelData backup = new DelData()
                {
                    DeletedData = "Item" +
                                  "|" + instance.ID_Item.ToString() +
                                  "|" + instance.Itemname +
                                  "|" + instance.Serial +
                                  "|" + instance.Belongs.ToString() +
                                  "|" + instance.Place.ToString() +
                                  "|" + instance.Cast.ToString() +
                                  "|" + (instance.Username == null ? "null" : instance.Username.ToString()) +
                                  "|" + (instance.Broken == null ? "null" : instance.Broken.ToString()) +
                                  "|" + (instance.Verifi == null ? "null" : instance.Verifi.ToString())
                };
                Db.DelDatas.InsertOnSubmit(backup); //бэкапим данные

                Db.Items.DeleteOnSubmit(instance);
                Db.Items.Context.SubmitChanges();
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        public bool RemovePack(System.Guid idPack)
        {
            Package instance = Db.Packages.Where(p => p.ID_Pack == idPack).FirstOrDefault();

            if (instance != null)
            {
                DelData backup = new DelData()
                {
                    DeletedData = "Package" +
                                  "|" + instance.ID_Pack.ToString() +
                                  "|" + instance.Name +
                                  "|" + instance.Coment
                };
                Db.DelDatas.InsertOnSubmit(backup); //бэкапим данные

                Db.Packages.DeleteOnSubmit(instance);
                Db.Packages.Context.SubmitChanges();
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        private void MovieBTN_Click(object sender, EventArgs e)
        {
            DialogResult confirmation = MessageBox.Show("Are you sure you want to remove " + Title + "?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (confirmation == DialogResult.Yes)
            {
                DelData DD = new DelData();
                DD.DeleteMovie(Convert.ToInt32(MovieID));

                this.Hide();
                RemoveMovie delform = new RemoveMovie();
                delform.ShowDialog();
                this.Close();
            }
            else
            {
                this.Hide();
                RemoveMovie delform = new RemoveMovie();
                delform.ShowDialog();
                this.Close();
            }
        }
Exemplo n.º 5
0
        private void ConfirmBTN_Click(object sender, EventArgs e)
        {
            DialogResult confirmation = MessageBox.Show("Are you sure you want to remove the time:" + time.ToString("HH:mm dd/MM/yyyy") + "?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (confirmation == DialogResult.Yes)
            {
                DelData DD = new DelData();
                DD.DeleteTime(Convert.ToInt32(DateID));

                this.Hide();
                DelTimes delform = new DelTimes(MovieID, Title);
                delform.ShowDialog();
                this.Close();
            }
            else
            {
                this.Hide();
                DelTimes delform = new DelTimes(MovieID, Title);
                delform.ShowDialog();
                this.Close();
            }
        }
Exemplo n.º 6
0
        public bool RemoveUser(System.Guid idUser)
        {
            User instance = Db.Users.Where(p => p.ID_User == idUser).FirstOrDefault();

            if (instance != null)
            {
                DelData backup = new DelData()
                {
                    DeletedData = "User" +
                                  "|" + instance.ID_User.ToString() +
                                  "|" + instance.Username +
                                  "|" + instance.Post +
                                  "|" + instance.Phone +
                                  "|" + instance.IsAdmin.ToString()
                };
                Db.DelDatas.InsertOnSubmit(backup); //бэкапим данные

                Db.Users.DeleteOnSubmit(instance);
                Db.Users.Context.SubmitChanges();
                return(true);
            }

            return(false);
        }