Example #1
0
        private void buttonDelete_Click(object sender, RoutedEventArgs e)
        {
            int counter = 0;
            ObservableCollection <Manifestation> manifestations = Database.getInstance().Manifestations;

            if (SelectedType != null)
            {
                foreach (Manifestation manifestation in manifestations)
                {
                    if (manifestation.Type.Id.Equals(SelectedType.Id))
                    {
                        counter++;
                    }
                }

                if (counter > 0)
                {
                    DeleteType handler = new DeleteType(SelectedType);
                    handler.ShowDialog();
                }
                else
                {
                    Database.DeleteType(SelectedType);
                    SelectedType = null;
                }
            }
            else
            {
                MessageBox.Show("Molimo, odaberite tip manifestacije za brisanje", "Brisanje tipa manifestacije");
            }
        }
        public void DeleteRoi(DeleteType type)
        {
            if (DeleteType.One == type)
            {
                HalconDotNet.HDrawingObject removed = null;
                foreach (HalconDotNet.HDrawingObject obj in mHDrawRegions)
                {
                    if (obj.ID == mCurrentRoiId)
                    {
                        removed = obj;
                        break;
                    }
                }

                if (removed != null)
                {
                    removed.ClearDrawingObject();
                    mHDrawRegions.Remove(removed);
                }
            }
            else
            {
                int len = mHDrawRegions.Count;
                for (int i = 0; i < len; i++)
                {
                    mHDrawRegions[i].ClearDrawingObject();
                }
                mHDrawRegions.Clear();
            }
        }
Example #3
0
        public void sp_Delete(LoginData login, DeleteType Tipo, int id)
        {
            if (!isValidUser(login.USER, login.PASS))
            {
                throw new Exception(NOLOGIN);
            }
            char t;

            switch (Tipo)
            {
            case DeleteType.Comentario:
                t = 'C';
                break;

            case DeleteType.Platillo:
                t = 'P';
                break;

            case DeleteType.Restaurante:
                t = 'R';
                break;

            default:
                throw new Exception("Tipo no valido");
            }

            adapter = new SqlDataAdapter("sp_Delete", conexion);
            adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
            adapter.SelectCommand.Parameters.Add(new SqlParameter("@tipo", t));
            adapter.SelectCommand.Parameters.Add(new SqlParameter("@id", id));
            adapter.SelectCommand.Parameters.Add(new SqlParameter("@user", login.USER));
            adapter.Fill(new DataSet());
            adapter.Dispose();
        }
Example #4
0
        public static void DeleteFileAndRelated(string dbFileName, DeleteType deleteType)
        {
            dbFileName = StringHelper.TrimToEmpty(dbFileName);
            if (dbFileName.Length > 0)
            {
                var fileName = Path.Combine(RootPath, ToPath(dbFileName));

                if (deleteType == DeleteType.TryDeleteOrMark)
                {
                    var folder = Path.GetDirectoryName(fileName);
                    TemporaryFileHelper.TryDeleteMarkedFiles(folder);
                }
                TemporaryFileHelper.Delete(fileName, deleteType);

                string sourcePath = Path.GetDirectoryName(fileName);
                string sourceBase = Path.GetFileNameWithoutExtension(fileName);

                foreach (var f in Directory.GetFiles(sourcePath,
                                                     sourceBase + "_t*.jpg"))
                {
                    TemporaryFileHelper.Delete(f, deleteType);
                }

                TemporaryFileHelper.Delete(fileName + ".meta", deleteType);
            }
        }
Example #5
0
    public void Initialize(InventoryDTO dto, DeleteType deleteType)
    {
        this.dto    = dto;
        _deleteType = deleteType;

        ItemCfg   item    = ConfigManager.instance.GetItemCfg(dto.itemid);
        Transform content = _transform.Find("EquipInfo/Viewport/Content");
        Text      name    = content.Find("Text").GetComponent <Text>();

        name.text = item.Name;
        Button Btnclose = _transform.Find("BtnClose").GetComponent <Button>();

        Btnclose.onClick.AddListener(OnClickClose);

        Button Btndelete = _transform.Find("BtnDelete").GetComponent <Button>();

        Btndelete.onClick.AddListener(OnClickDelete);

        Button BtnUnload = _transform.Find("BtnUnload").GetComponent <Button>();

        BtnUnload.onClick.AddListener(OnClickUnload);
        BtnUnload.gameObject.SetActive(deleteType == DeleteType.Equip);

        Button BtnEquip = _transform.Find("BtnEquip").GetComponent <Button>();

        BtnEquip.onClick.AddListener(OnClickEquip);
        BtnEquip.gameObject.SetActive(deleteType != DeleteType.Equip);
    }
Example #6
0
        static async Task DDeleteType(DeleteType obj)
        {
            var        json        = JsonConvert.SerializeObject(obj);
            var        httpContent = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
            HttpClient client      = new HttpClient();
            var        request     = new HttpRequestMessage(HttpMethod.Delete, "http://localhost:2794/DictionaryConferenceType/DeleteType");

            request.Content = httpContent;
            await client.SendAsync(request);
        }
Example #7
0
        private async void DeleteType_Click(object sender, EventArgs e)
        {
            DeleteType obj = new DeleteType {
                Id = eventDetails.ConferenceTypeId, isRemote = eventDetails.isRemote
            };

            await DDeleteType(obj);

            RefreshLists("DictionaryType");
            DeleteType.Enabled = false;
            btnNext.Enabled    = false;
        }
Example #8
0
        private async void DeleteCountry_Click(object sender, EventArgs e)
        {
            DeleteType obj = new DeleteType {
                Id = eventDetails.DictionaryCountryId, isRemote = eventDetails.isRemote
            };

            await DDeleteCountry(obj);

            RefreshLists("DictionaryCountry");
            DeleteCountry.Enabled = false;
            btnNext2.Enabled      = false;
        }
Example #9
0
 /// <summary>
 ///   Deletes, tries to delete or marks a file for deletion depending on type.</summary>
 /// <param name="filePath">
 ///   File to be deleted (can be null).</param>
 /// <param name="type">
 ///   Delete type.</param>
 public static void Delete(string filePath, DeleteType type)
 {
     if (type == DeleteType.Delete)
     {
         Delete(filePath);
     }
     else if (type == DeleteType.TryDelete)
     {
         TryDelete(filePath);
     }
     else
     {
         TryDeleteOrMark(filePath);
     }
 }
        public void removeAttributes(String userId, List <LinkIDAttribute> attributes)
        {
            setTargetIdentity(userId);

            DeleteType            delete      = new DeleteType();
            List <DeleteItemType> deleteItems = new List <DeleteItemType>();

            foreach (LinkIDAttribute attribute in attributes)
            {
                deleteItems.Add(getDeleteItem(attribute));
            }

            DeleteResponseType response = this.client.Delete(delete);

            validateStatus(response.Status);
        }
Example #11
0
        public void Fdeleteorder(OrderService os)                             //删除订单
        {
            Console.WriteLine("你想按照哪种方式删除订单?请输入ById或者ByCustomer:");           //其实这里应该搞一个按钮,此处简化了
            string     str = Console.ReadLine();
            DeleteType d   = (DeleteType)Enum.Parse(typeof(DeleteType), str); //其实此处应该有一个try catch 此处简化了

            if (d == DeleteType.ById)
            {
                try
                {
                    Console.WriteLine("你想删除的订单id为?");
                    long id     = long.Parse(Console.ReadLine());
                    var  orders = os.OrderList.Where(o => o.ID == id);//使用linq语句,由于id是不重复的,所以只会得到一个order对象
                    foreach (var item in orders)
                    {
                        os.OrderList.Remove(item);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("按照ID删除错误:" + ex.Message);
                }
            }
            else if (d == DeleteType.ByCustomer)
            {
                try
                {
                    Console.WriteLine("你想删除的订单的顾客是?");
                    string customer = Console.ReadLine();
                    var    orderl   = os.OrderList.Where(o => o.Customer == customer);//使用linq语句,得到一个临时列表
                    foreach (var item in orderl)
                    {
                        os.OrderList.Remove(item);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("按照顾客" +
                                      "删除错误:" + ex.Message);
                }
            }
            else
            {
                Console.WriteLine("删除订单错误!");
            }
        }
 // DELETE: api/membership/5
 public IHttpActionResult Delete(int?id, bool status, DeleteType type)
 {
     try
     {
         if (!id.HasValue)
         {
             return(Ok(new { status = false, data = "", message = "please provide a valid id." }));
         }
         else
         {
             var membership = _db.tblMemberships.Find(id);
             if (membership != null)
             {
                 membership.IsActive = !membership.IsActive;
                 if (type == DeleteType.DeleteRecord)
                 {
                     _db.Entry(membership).State = EntityState.Deleted;
                 }
                 else
                 {
                     _db.Entry(membership).State = EntityState.Modified;
                 }
                 var response = _db.SaveChanges();
                 if (response > 0)
                 {
                     return(Ok(new { status = true, data = membership, message = "success" }));
                 }
                 else
                 {
                     return(Ok(new { status = false, data = "", message = "failed" }));
                 }
             }
             else
             {
                 return(Ok(new { status = false, data = "", message = "Not a valid data to update. Please provide a valid id." }));
             }
         }
     }
     catch (Exception ex)
     {
         return(Ok(new { status = false, data = "", message = "ex: " + ex.Message.ToString() }));
     }
 }
        ///展示用户权限
        public ActionResult ShowUserAction()
        {
            int id       = int.Parse(Request["userId"]);
            var Userinfo = userinfoService.LoadEnity(u => u.ID == id).FirstOrDefault();

            ViewBag.Userinfo = Userinfo;
            //查询所有的权限
            DeleteType Normal = DeleteType.Normarl;
            //系统中全部有的权限
            var AllactionList = actionInfoservice.LoadEnity(a => a.DelFlag == (short)Normal).ToList();

            ViewBag.AllactionList = AllactionList;
            //用户已有的权限
            var AllUserinfoList = (from a in Userinfo.R_UserInfo_ActionInfo
                                   select a).ToList();

            ViewBag.AllUserinfoList = AllUserinfoList;
            return(View());
        }
Example #14
0
 // DELETE: api/servicelocation/5
 public IHttpActionResult Delete(int?id, DeleteType type)
 {
     try
     {
         if (!id.HasValue)
         {
             return(Ok(new { status = false, data = "", message = "Please provide a valid ID." }));
         }
         else
         {
             var serviceLocation = _db.tblServiceLocations.Find(id);
             if (serviceLocation != null)
             {
                 if (type == DeleteType.DeleteRecord)
                 {
                     _db.Entry(serviceLocation).State = EntityState.Deleted;
                 }
                 else
                 {
                     serviceLocation.IsActive         = !serviceLocation.IsActive;
                     _db.Entry(serviceLocation).State = EntityState.Modified;
                 }
                 var response = _db.SaveChanges();
                 if (response > 0)
                 {
                     return(Ok(new { status = true, data = serviceLocation, message = "success" }));
                 }
                 else
                 {
                     return(Ok(new { status = false, data = "", message = "There was a problem to update the data." }));
                 }
             }
             else
             {
                 return(Ok(new { status = false, data = "", message = "Not a valid data to update. Please provide a valid id." }));
             }
         }
     }
     catch (Exception ex)
     {
         return(Ok(new { status = false, data = "", message = ex.Message.ToString() }));
     }
 }
Example #15
0
 public IHttpActionResult Delete(long?id, bool status, DeleteType type)
 {
     try
     {
         if (!id.HasValue)
         {
             return(Ok(new { status = false, data = "", message = "please provide a valid admin id." }));
         }
         else
         {
             var admin = _db.tblAdministrators.Find(id);
             if (admin != null)
             {
                 admin.IsActive = status;
                 if (type == DeleteType.DeleteRecord)
                 {
                     _db.Entry(admin).State = EntityState.Deleted;
                 }
                 else
                 {
                     _db.Entry(admin).State = EntityState.Modified;
                 }
                 var response = _db.SaveChanges();
                 if (response > 0)
                 {
                     return(Ok(new { status = true, data = admin, message = "success" }));
                 }
                 else
                 {
                     return(Ok(new { status = false, data = "", message = "failed" }));
                 }
             }
             else
             {
                 return(Ok(new { status = false, data = "", message = "not a valid data to update. Please provide a valid id." }));
             }
         }
     }
     catch (Exception ex)
     {
         return(Ok(new { status = false, data = "", message = "ex: " + ex.Message.ToString() }));
     }
 }
        /// <summary>
        /// Applicable only for Organizations. Direct the search command to execute itself and then issue a delete command on the organizations returned by the search execution
        /// </summary>
        /// <param name="option"> Defines if contacts linked to the organization will be also deleted or if the will become orphan</param>
        public void Delete(DeleteType option)
        {
            navigateCommand();

            Commands.SearchFor(keyword);
            var selecteddRecordsCount = Commands.SelectRecordsMatching(keyword);

            if (selecteddRecordsCount > 0)
            {
                var command = new DeleteOrganizationCommand();
                switch (option)
                {
                case DeleteType.OnlyOrganization:
                {
                    command.OnlyOrganization();
                    break;
                }

                case DeleteType.WithContacts:
                {
                    command.WithContacts();
                    break;
                }

                default:
                {
                    command.OnlyOrganization();
                    break;
                }
                }
            }
            else
            {
                Report.Report.ToLogFile(MessageType.Message,
                                        $"There are no records matching given keywords and so no records deleted.", null);
            }
        }
 private MeasurementDeleteCommand(DeleteType type, long id)
 {
     _type = type;
     _id   = id;
 }
Example #18
0
        public static void DeleteFileAndRelated(string dbFileName, DeleteType deleteType)
        {
            dbFileName = StringHelper.TrimToEmpty(dbFileName);
            if (dbFileName.Length > 0)
            {
                var fileName = Path.Combine(RootPath, ToPath(dbFileName));

                if (deleteType == DeleteType.TryDeleteOrMark)
                {
                    var folder = Path.GetDirectoryName(fileName);
                    TemporaryFileHelper.TryDeleteMarkedFiles(folder);
                }
                TemporaryFileHelper.Delete(fileName, deleteType);

                string sourcePath = Path.GetDirectoryName(fileName);
                string sourceBase = Path.GetFileNameWithoutExtension(fileName);

                foreach (var f in Directory.GetFiles(sourcePath,
                    sourceBase + "_t*.jpg"))
                {
                    TemporaryFileHelper.Delete(f, deleteType);
                }

                TemporaryFileHelper.Delete(fileName + ".meta", deleteType);
            }
        }
Example #19
0
    public void MenuAction(int i)
    {
        switch (i)
        {
        case 0:                 //Play Adventure.
            if (Game.beatFirstLevel)
            {
                currentMenu  = Menu.Adventure;
                adventureCam = true;
                camState     = 0;
            }
            else
            {
                LoadLevel(6);
            }
            break;

        case 1:                 //Play Bullet Hell.
            LoadLevel(4);
            break;

        case 2:                 //Play Legacy Mode.
            LoadLevel(2);
            break;

        case 3:                 //Play Legacy Bullet Hell Mode.
            LoadLevel(3);
            break;

        case 4:                 //The Ship Shop.
            camState    = 3;
            currentMenu = Menu.Shop;
            break;

        case 5:                 //Statistics.
            camState    = 1;
            currentMenu = Menu.Stats;
            break;

        case 6:                 //Options.
            camState    = 2;
            currentMenu = Menu.Settings;
            break;

        case 7:                 //Purchase Soundtrack.
            if (Game.steamy)
            {
                SteamFriends.ActivateGameOverlayToWebPage("https://store.steampowered.com/app/1194020/LoopLoop_DX_Official_Soundtrack/");
            }
            break;

        case 8:                 //Purchase Supporter Pack.
            if (Game.steamy)
            {
                SteamFriends.ActivateGameOverlayToWebPage("https://store.steampowered.com/app/1194021/LoopLoop_DX_Supporter_Pack/");
            }
            break;

        case 9:                 //Quit.
            LoadLevel(420);
            break;

        case 10:                 //Back from statistics.
            camState    = 0;
            currentMenu = Menu.Main;
            break;

        case 11:                 //Back from options.
            gamePadSettingsIndex = 0;
            atRightSettingsMenu  = false;
            camState             = 0;
            currentMenu          = Menu.Main;
            break;

        case 12:                 //Back from shop.
            camState    = 0;
            currentMenu = Menu.Main;
            break;

        case 13:                 //Back from delete menu.
            camState    = 2;
            currentMenu = Menu.Settings;
            break;

        case 14:                 //Delete Adventure.
            camState    = 4;
            dType       = DeleteType.Adventure;
            currentMenu = Menu.DeleteSave;
            break;

        case 15:                 //Delete ALLLLL
            camState    = 4;
            dType       = DeleteType.All;
            currentMenu = Menu.DeleteSave;
            break;

        case 16:     //Back from adventure.
            currentMenu = MenuManagerScript.Menu.Main;
            PlaySound.NoLoop(snd);
            float camTime = 1.5f;
            backFromAdventureTweenCounter = camTime + 0.1f;
            iTween.MoveTo(Camera.main.gameObject, iTween.Hash("x", 0, "y", 0, "time", camTime, "easetype", iTween.EaseType.easeInOutSine, "looptype", iTween.LoopType.none));
            adventureCam = false;
            break;
        }
        PlaySound.NoLoop(snd);         //Play button click sound.
    }
 public IActionResult DeleteType([FromBody] DeleteType obj)
 {
     _conferenceRepository.DeleteType(obj.Id, obj.isRemote);
     return(Ok());
 }
        /// <summary>
        /// Applicable only for Organizations. Direct the search command to execute itself and then issue a delete command on the organizations returned by the search execution
        /// </summary>
        /// <param name="option"> Defines if contacts linked to the organization will be also deleted or if the will become orphan</param>
        public void Delete(DeleteType option)
        {
            navigateCommand();

            Commands.SearchFor(keyword);
            var selecteddRecordsCount = Commands.SelectRecordsMatching(keyword);
            if (selecteddRecordsCount > 0)
            {
                var command = new DeleteRecordCommand();
                switch (option)
                {
                    case DeleteType.OnlyOrganization:
                        {
                            command.OnlyOrganization();
                            break;
                        }
                    case DeleteType.WithContacts:
                        {
                            command.WithContacts();
                            break;
                        }
                    default:
                        {
                            command.OnlyOrganization();
                            break;
                        }
                }
            }
            else
                Report.Report.ToLogFile(MessageType.Message,
                    $"There are no records matching given keywords and so no records deleted.", null);
        }
Example #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentMoveCommonSetting" /> class.
 /// </summary>
 /// <param name="isIncludeVersions">isIncludeVersions.</param>
 /// <param name="isIncludeWorkflowDefinition">isIncludeWorkflowDefinition.</param>
 /// <param name="isDisableInformationRightsManagement">isDisableInformationRightsManagement.</param>
 /// <param name="isPreserveNullColumnValues">isPreserveNullColumnValues.</param>
 /// <param name="isKeepModifiedByAndModifiedTime">isKeepModifiedByAndModifiedTime.</param>
 /// <param name="profileMappings">profileMappings.</param>
 /// <param name="backupSettings">backupSettings.</param>
 /// <param name="conflictResolutionSettings">conflictResolutionSettings.</param>
 /// <param name="filterPolicy">filterPolicy.</param>
 /// <param name="deleteType">deleteType.</param>
 /// <param name="isDeleteCheckedFiles">isDeleteCheckedFiles.</param>
 public ContentMoveCommonSetting(bool isIncludeVersions = default(bool), bool isIncludeWorkflowDefinition = default(bool), bool isDisableInformationRightsManagement = default(bool), bool isPreserveNullColumnValues = default(bool), bool isKeepModifiedByAndModifiedTime = default(bool), ContentMoveProfileMappings profileMappings = default(ContentMoveProfileMappings), BackupEnvironmentSetting backupSettings = default(BackupEnvironmentSetting), ConflictResolutionSetting conflictResolutionSettings = default(ConflictResolutionSetting), GuidModel filterPolicy = default(GuidModel), DeleteType deleteType = default(DeleteType), bool isDeleteCheckedFiles = default(bool))
 {
     this.ProfileMappings            = profileMappings;
     this.BackupSettings             = backupSettings;
     this.ConflictResolutionSettings = conflictResolutionSettings;
     this.FilterPolicy                         = filterPolicy;
     this.IsIncludeVersions                    = isIncludeVersions;
     this.IsIncludeWorkflowDefinition          = isIncludeWorkflowDefinition;
     this.IsDisableInformationRightsManagement = isDisableInformationRightsManagement;
     this.IsPreserveNullColumnValues           = isPreserveNullColumnValues;
     this.IsKeepModifiedByAndModifiedTime      = isKeepModifiedByAndModifiedTime;
     this.ProfileMappings                      = profileMappings;
     this.BackupSettings                       = backupSettings;
     this.ConflictResolutionSettings           = conflictResolutionSettings;
     this.FilterPolicy                         = filterPolicy;
     this.DeleteType           = deleteType;
     this.IsDeleteCheckedFiles = isDeleteCheckedFiles;
 }
Example #23
0
        private void DeleteMaps(DeleteType type)
        {
            CreateFullPull();

            int count = MapPull.Count - Maps;
            for (int i = 0; i < count; i++)
            {
                if (i % 2 == 0)
                {
                    switch (type)
                    {
                        case DeleteType.ENEMYS_BEST:
                            DeleteEnemysBest(GetSecondTeam().MapStats);
                            break;
                        case DeleteType.SELF_WORST:
                            DeleteSelfWorst(GetFirstTeam().MapStats);
                            break;
                        case DeleteType.MIX_STYLE:
                            DeleteMixStyle(GetFirstTeam().MapStats, true);
                            break;
                    }
                }
                else
                {
                    switch (type)
                    {
                        case DeleteType.ENEMYS_BEST:
                            DeleteEnemysBest(GetFirstTeam().MapStats);
                            break;
                        case DeleteType.SELF_WORST:
                            DeleteSelfWorst(GetSecondTeam().MapStats);
                            break;
                        case DeleteType.MIX_STYLE:
                            DeleteMixStyle(GetSecondTeam().MapStats, false);
                            break;
                    }
                }
            }

            //FixEmptyMaps();
        }
 private InstallationDeleteCommand(DeleteType type, long id)
 {
     _type = type;
     _id   = id;
 }
 /// <summary>
 ///   Deletes, tries to delete or marks a file for deletion depending on type.</summary>
 /// <param name="filePath">
 ///   File to be deleted (can be null).</param>
 /// <param name="type">
 ///   Delete type.</param>
 public static void Delete(string filePath, DeleteType type)
 {
     if (type == DeleteType.Delete)
         Delete(filePath);
     else if (type == DeleteType.TryDelete)
         TryDelete(filePath);
     else
         TryDeleteOrMark(filePath);
 }
Example #26
0
        /// <summary>
        /// ɾ����Ӧ��Դ���ǩ�Ķ�Ӧ��ϵ
        /// </summary>
        /// <param name="id">��ʶ</param>
        /// <param name="type">ɾ������</param>
        public void Delete(int id, DeleteType type)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from ResourceTag ");

            if (type == DeleteType.ByTagID)
            {
                strSql.Append(" where TagID=@ID ");
            }
            else
            {
                strSql.Append(" where ResourceID=@ID ");
            }

            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.Int,4)};
            parameters[0].Value = id;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
 public IActionResult DeleteCity([FromBody] DeleteType obj)
 {
     _cityRepository.DeleteCity(obj.Id, obj.isRemote);
     return(Ok());
 }