public ActionResult Edit(ApplicantEdit applicantEdit)
 {
     if (Request.IsAuthenticated)
     {
         try
         {
             ApplicantWeb.Models.Applicant applicant = db.Applicants.Find(applicantEdit.ApplicantId);
             if (ModelState.IsValid)
             {
                 applicant.Edit(applicantEdit);
                 db.Entry(applicant).State = EntityState.Modified;
                 db.SaveChanges();
                 return(Redirect(Url.Action("Details", "Applicants", new { id = applicant.ApplicantId })));
             }
             return(View(applicant));
         }
         catch
         {
             return(HttpNotFound());
         }
     }
     else
     {
         return(Redirect(Url.Action("Login", "Account")));
     }
 }
Esempio n. 2
0
 // GET: Attachments/Delete/5
 public ActionResult Delete(int?id, int?applicantId)
 {
     if (Request.IsAuthenticated)
     {
         try
         {
             if (id == null || applicantId == null)
             {
                 return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
             }
             ApplicantWeb.Models.Applicant applicant = db.Applicants.Find(applicantId);
             if (applicant == null)
             {
                 return(HttpNotFound());
             }
             TagCreate tagCreate = new TagCreate()
             {
                 TagId = db.Tags.Find(id).TagId, TagName = db.Tags.Find(id).TagName, ApplicantId = applicant.ApplicantId, Applicant = applicant
             };
             if (tagCreate == null)
             {
                 return(HttpNotFound());
             }
             return(PartialView("PartialDelete", tagCreate));
         }
         catch
         {
             return(HttpNotFound());
         }
     }
     else
     {
         return(Redirect(Url.Action("Login", "Account")));
     }
 }
 public ActionResult DeleteToApplicantToHistory(int attachmentId)
 {
     if (Request.IsAuthenticated)
     {
         try
         {
             Attachment attachment = db.Attachments.Find(attachmentId);
             attachment.History = db.Histories.Find(attachment.HistoryId);
             ApplicantWeb.Models.Applicant applicant = db.Applicants.Find(attachment.History.ApplicantId);
             attachment.ApplicantId = null;
             attachment.Applicant   = null;
             History history = db.Histories.Find(attachment.HistoryId);
             applicant.Attachments.Remove(attachment);
             db.SaveChanges();
             return(PartialView("PartialListToHistory", history));
         }
         catch
         {
             return(HttpNotFound());
         }
     }
     else
     {
         return(Redirect(Url.Action("Login", "Account")));
     }
 }
 public void InitHistories()
 {
     Applicant = new ApplicantWeb.Models.Applicant();
     HistoryFields = new HistoryFields(new DateTime(2015, 09, 15), ApplicantClassLibrary.TypeHistory.Interview, "Здорово!!!");
     HistoryCreate = new HistoryCreate(HistoryFields, Applicant.ApplicantId, Applicant);
     History = new History(HistoryCreate);
     HistoryEdit = new HistoryEdit(HistoryFields);
 }
 public void InitHistories()
 {
     Applicant     = new ApplicantWeb.Models.Applicant();
     HistoryFields = new HistoryFields(new DateTime(2015, 09, 15), ApplicantClassLibrary.TypeHistory.Interview, "Здорово!!!");
     HistoryCreate = new HistoryCreate(HistoryFields, Applicant.ApplicantId, Applicant);
     History       = new History(HistoryCreate);
     HistoryEdit   = new HistoryEdit(HistoryFields);
 }
Esempio n. 6
0
 public Attachment(AttachmentFields attachmentFields,int? applicantId, Applicant applicant,int? historyId, History history)
     : base(attachmentFields.Name, attachmentFields.Type, attachmentFields.Attach)
 {
     ApplicantId = applicantId;
     Applicant = Applicant;
     HistoryId = historyId;
     History = history;
 }
        public void InitAttachments()
        {
            Attachment1 = new Attachment();

            AttachmentFields = new AttachmentFields("Файл", ".txt", null);
            Applicant        = new ApplicantWeb.Models.Applicant();
            Attachment2      = new Attachment(AttachmentFields, Applicant.ApplicantId, Applicant);

            History     = new History();
            Attachment3 = new Attachment(AttachmentFields, Applicant.ApplicantId, Applicant, History.HistoryId, History);
        }
        public void InitAttachments()
        {
            Attachment1 = new Attachment();

            AttachmentFields = new AttachmentFields("Файл",".txt",null);
            Applicant=new ApplicantWeb.Models.Applicant();
            Attachment2 = new Attachment(AttachmentFields,Applicant.ApplicantId,Applicant);

            History = new History();
            Attachment3 = new Attachment(AttachmentFields,Applicant.ApplicantId, Applicant, History.HistoryId, History);
        }
Esempio n. 9
0
        public void InitTags()
        {
            TagFields = new TagFields("Asp.net");
            Tag1      = new Tag(TagFields);

            Applicants = new List <ApplicantWeb.Models.Applicant>();
            Applicant  = new ApplicantWeb.Models.Applicant();
            Applicants.Add(Applicant);
            Tag2 = new Tag(TagFields, Applicants);

            TagCreate = new TagCreate(TagFields, Applicant.ApplicantId);
        }
 // GET: Applicants/Details/5
 public ActionResult Details(int?id)
 {
     if (Request.IsAuthenticated)
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         ApplicantWeb.Models.Applicant applicant = db.Applicants.Find(id);
         if (applicant == null)
         {
             return(HttpNotFound());
         }
         return(View(applicant));
     }
     else
     {
         return(Redirect(Url.Action("Login", "Account")));
     }
 }
 public ActionResult DeleteConfirmed(int id)
 {
     if (Request.IsAuthenticated)
     {
         try
         {
             ApplicantWeb.Models.Applicant applicant = db.Applicants.Find(id);
             db.DeleteAttachments(applicant);
             db.DeleteHistories(applicant);
             db.Applicants.Remove(applicant);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
         catch
         {
             return(HttpNotFound());
         }
     }
     else
     {
         return(Redirect(Url.Action("Login", "Account")));
     }
 }
Esempio n. 12
0
 public HistoryCreate(HistoryFields historyFields, int? applicantId, Applicant applicant)
     : base(historyFields)
 {
     ApplicantId = applicantId;
     Applicant = applicant;
 }
Esempio n. 13
0
 public Attachment(AttachmentFields attachmentFields, int?applicantId, Applicant applicant)
     : base(attachmentFields.Name, attachmentFields.Type, attachmentFields.Attach)
 {
     ApplicantId = applicantId;
     Applicant   = Applicant;
 }
Esempio n. 14
0
 public HistoryCreate(HistoryFields historyFields, int?applicantId, Applicant applicant)
     : base(historyFields)
 {
     ApplicantId = applicantId;
     Applicant   = applicant;
 }
Esempio n. 15
0
 public Attachment(AttachmentFields attachmentFields,int? applicantId, Applicant applicant)
     : base(attachmentFields.Name, attachmentFields.Type, attachmentFields.Attach)
 {
     ApplicantId = applicantId;
     Applicant = Applicant;
 }