Ejemplo n.º 1
0
 public ActionResult CreateJob()
 {
     Logger.Debug("Inside Job Controller- Create Job");
     try
     {
         if (Session["OrganizationGUID"] != null)
         {
             JobFormModel jobFormModel = new JobFormModel();
             jobFormModel.JobPageList = jobPageList;
             jobFormModel.JobItemList = jobItemList;
             Jschema.JobForm1         = new JavaScriptSerializer().Serialize(jobFormModel);
             _IJobSchemaRepository.InsertJobSchema(Jschema);
             // _IJobSchemaRepository.Save();
             return(RedirectToAction("Index"));
         }
         else
         {
             return(RedirectToAction("SessionTimeOut", "User"));
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex.Message);
         //_IJobSchemaRepository.DeleteJobPageItemByJobLogicalGUID(Jschema.JobLogicalID);
         //_IJobSchemaRepository.DeleteJobPageByJobLogicalGUID(Jschema.JobLogicalID);
         //_IJobSchemaRepository.DeleteJobSchema(Jschema.JobLogicalID);
         //_IJobSchemaRepository.Save();
         return(RedirectToAction("Index"));
     }
 }
Ejemplo n.º 2
0
        public ActionResult Create(JobFormModel model)
        {
            var item = Mapper.Map <JobFormModel, Job>(model);

            GetSession.Save(item);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult Editjob()
        {
            Logger.Debug("Inside Job Controller- Create Job");
            try
            {
                if (Session["OrganizationGUID"] != null)
                {
                    int   deleteresult = 0;
                    Int16 jobclass;
                    if (short.TryParse(Jschema.JobClass.ToString(), out jobclass) && Jschema.OrganizationGUID != null)
                    {
                        IList <Job> job = _IJobSchemaRepository.GetjobByJobFormClass(jobclass, new Guid(Jschema.OrganizationGUID.ToString())).ToList();
                        if (job != null && job.Count > 0)
                        {
                            deleteresult = _IJobSchemaRepository.SetDeleteFlag(Jschema.JobFormGUID);
                        }
                        else
                        {
                            deleteresult = _IJobSchemaRepository.DeleteJobSchema(Jschema.JobFormGUID);
                            //deleteresult = _IJobSchemaRepository.Save();
                        }
                    }

                    if (deleteresult > 0)
                    {
                        JobFormModel jobFormModel = new JobFormModel();
                        jobFormModel.JobPageList = jobPageList;
                        jobFormModel.JobItemList = jobItemList;
                        Jschema.JobForm1         = new JavaScriptSerializer().Serialize(jobFormModel);
                        Jschema.JobFormGUID      = Guid.NewGuid();
                        Jschema.IsActive         = true;
                        int JobResult = _IJobSchemaRepository.InsertJobSchema(Jschema);
                        //int JobResult = _IJobSchemaRepository.Save();
                    }

                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(RedirectToAction("SessionTimeOut", "User"));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message);
                //_IJobSchemaRepository.DeleteJobPageItemByJobLogicalGUID(Jschema.JobLogicalID);
                //_IJobSchemaRepository.DeleteJobPageByJobLogicalGUID(Jschema.JobLogicalID);
                //_IJobSchemaRepository.DeleteJobSchema(Jschema.JobLogicalID);
                //_IJobSchemaRepository.Save();
                return(RedirectToAction("Index"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Edit(JobFormModel model)
        {
            if (ModelState.IsValid)
            {
                var item = GetSession.Get <Job>(model.Id);

                Mapper.Map <JobFormModel, Job>(model, item);

                GetSession.Update(item);

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Ejemplo n.º 5
0
        public ActionResult Create()
        {
            var model = new JobFormModel();

            return(View(model));
        }