コード例 #1
0
ファイル: Jobs.aspx.cs プロジェクト: netthanhhung/Neos
 protected void JobAjaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
 {
     if (e.Argument.IndexOf("OpenSelectedJob") > -1)
     {
         if (gridJobs.SelectedItems.Count == 1)
         {
             Response.Redirect(string.Format("~/JobProfile.aspx?JobId={0}&mode=edit", GetSelectedJobID()), true);
         }
     }
     else if (e.Argument.IndexOf("DeleteSelectedJob") > -1)
     {
         if (gridJobs.SelectedItems.Count == 1)
         {
             JobAjaxManager.AjaxSettings.AddAjaxSetting(JobAjaxManager, gridJobs);
             JobRepository jobRepo = new JobRepository();
             jobRepo.Delete(new Job(GetSelectedJobID()));
             gridJobs.Rebind();
         }
     }
     else if (e.Argument.IndexOf("PreviewJob") > -1)
     {
         if (gridJobs.SelectedItems.Count == 1)
         {
             string script = string.Format("openPopUp('{0}')", WebConfig.NeosJobDetailURL + GetSelectedJobID());
             JobAjaxManager.ResponseScripts.Add(script);
             JobAjaxManager.ResponseScripts.Add("processJobToolBar(\"JobGridSelected\");");
         }
     }
 }
コード例 #2
0
        //DELORT
        internal Job Delete(string id)
        {
            Job original = GetById(id);

            _repo.Delete(id);
            return(original);;
        }
コード例 #3
0
ファイル: JobService.cs プロジェクト: codedive/MyDemo1
 public void DeleteJob(int jobId)
 {
     //unitOfWork.StartTransaction();
     JobRepository repo = new JobRepository(unitOfWork);
     repo.Delete(x => x.JobId == jobId);
     //unitOfWork.Commit();
 }
コード例 #4
0
        public bool Delete(string JobId, out string strResult)
        {
            strResult = string.Empty;
            bool result = false;
            Guid joId   = new Guid(JobId);
            var  job    = JobRepository.GetQueryable().FirstOrDefault(j => j.ID == joId);

            if (job != null)
            {
                try
                {
                    JobRepository.Delete(job);
                    JobRepository.SaveChanges();
                    result = true;
                }
                catch (Exception)
                {
                    strResult = "原因:已在使用";
                }
            }
            else
            {
                strResult = "原因:未找到当前需要删除的数据!";
            }
            return(result);
        }
コード例 #5
0
        internal Job Delete(int id)
        {
            Job original = Get(id);

            _repo.Delete(id);
            return(original);
        }
コード例 #6
0
        public void DeleteJobWithContent(int id)
        {
            _tracer.TraceEvent(TraceEventType.Start, 0);

            var contentRepository = new PageContentRepository(this._settings);

            using (contentRepository.AcquireLock(id))
            {
                using (var scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    Job job;
                    using (var context = new CoreContext())
                    {
                        var repository = new JobRepository(context);
                        job = repository.Load(id);
                        repository.Delete(job);
                        context.SaveChanges();
                    }

                    if (job.HasReferenceScraped)
                    {
                        contentRepository.DeleteReferenceContent(id);
                    }

                    if (job.HasTestScraped)
                    {
                        contentRepository.DeleteTestContent(id);
                    }

                    scope.Complete();
                }
            }

            _tracer.TraceEvent(TraceEventType.Stop, 0);
        }
コード例 #7
0
 internal string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Deleted!");
     }
     return("Unable to be deleted");
 }
コード例 #8
0
 public string Delete(int id)
 {
     if (_repo.Delete(id))
     {
         return("Has been deleted");
     }
     return("no delete");
 }
コード例 #9
0
ファイル: SchedulerModule.cs プロジェクト: tarik1603/Antd
        public SchedulerModule() {
            this.RequiresAuthentication();

            Get["/scheduler"] = x => {
                dynamic vmod = new ExpandoObject();
                vmod.JobList = JobRepository.GetAll();
                return View["page-scheduler", vmod];
            };

            Post["/scheduler/now"] = x => {
                var alias = (string)Request.Form.Alias;
                var command = (string)Request.Form.Command;
                Job.Schedule(alias, command);
                return Response.AsRedirect("/");
            };

            Post["/scheduler/cron"] = x => {
                var alias = (string)Request.Form.Alias;
                var command = (string)Request.Form.Command;
                var cron = (string)Request.Form.CronResult;
                Job.Schedule(alias, command, cron);
                return Response.AsRedirect("/");
            };

            //Post["/scheduler/other"] = x => {
            //    var _alias = (string)Request.Form.Alias;
            //    var _command = (string)Request.Form.Command;
            //    var _cron = (string)Request.Form.CronResult;
            //    Job.Schedule(_alias, _command, _cron);
            //    dynamic model = new ExpandoObject();
            //    return Response.AsRedirect("/");
            //};

            Get["/scheduler/enable/{guid}"] = x => {
                string guid = x.guid;
                JobRepository.Enable(guid);
                return Response.AsJson(true);
            };

            Get["/scheduler/disable/{guid}"] = x => {
                string guid = x.guid;
                JobRepository.Disable(guid);
                return Response.AsJson(true);
            };

            Get["/scheduler/Launch/{guid}"] = x => {
                string guid = x.guid;
                Job.ReSchedule(guid);
                return Response.AsJson(true);
            };

            Get["/scheduler/delete/{guid}"] = x => {
                string guid = x.guid;
                JobRepository.Delete(guid);
                return Response.AsJson(true);
            };
        }
コード例 #10
0
        public RestResult Delete(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException(nameof(id));
            }

            _repository.Delete(Guid.Parse(id));
            return(Rest(null));
        }
コード例 #11
0
        public async Task <IActionResult> Delete(int id)
        {
            var user = await jobRepository.Get(id);

            if (user == null)
            {
                return(NotFound(new { status = ResultStatus.STATUS_NOT_FOUND, message = "Không tìm thấy nghề nghiệp" }));
            }
            await jobRepository.Delete(id);

            return(Ok(new { status = ResultStatus.STATUS_OK, message = "Xóa thành công!" }));
        }
コード例 #12
0
 //[HttpGet]
 public ActionResult Delete(int id)
 {
     try
     {
         _jobRepository = new JobRepository();
         _jobRepository.Delete(id);
         //ViewBag.Mensagem = "Job excluído com sucesso";
         return(RedirectToAction("Index"));
     }
     catch (Exception)
     {
         return(RedirectToAction("Index"));
     }
 }
コード例 #13
0
        public bool Delete(string JobId)
        {
            Guid joId = new Guid(JobId);
            var  job  = JobRepository.GetQueryable()
                        .FirstOrDefault(j => j.ID == joId);

            if (job != null)
            {
                JobRepository.Delete(job);
                JobRepository.SaveChanges();
            }
            else
            {
                return(false);
            }
            return(true);
        }
コード例 #14
0
ファイル: Jobs.aspx.cs プロジェクト: netthanhhung/Neos
    protected void OnGridJobs_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName.ToLower() == "delete")
        {
            int jobID = Int32.Parse(e.CommandArgument.ToString());
            JobRepository jobRepo = new JobRepository();
            jobRepo.Delete(new Job(jobID));

            gridJobs.Rebind();
        }
    }
コード例 #15
0
ファイル: JobService.cs プロジェクト: wyijx/MRConstCo
 public void DeleteJob(int id)
 {
     _jobRepo.Delete(id);
     _jobRepo.SaveChanges();
 }
コード例 #16
0
 public IActionResult Delete(int id)
 {
     _jobRepository.Delete(id);
     return(NoContent());
 }