public ActionResult AddApplicant(JObApplicationdata jobapplication, HttpPostedFileBase file) { string applicationid = ""; string candidateid = Guid.NewGuid().ToString().Replace("-", ""); Business.ApplicationService.AppServiceClient bd = new Business.ApplicationService.AppServiceClient(); Business.CoreService.MyFile fileuploaded = new Business.CoreService.MyFile(); Business.CoreService.IobjectServicesWebappVer2Client coreclient = new Business.CoreService.IobjectServicesWebappVer2Client(); string customtoken = coreclient.Login("*****@*****.**", "password", ""); AmazonFile af = new AmazonFile(); fileuploaded = af.WriteFile(Request.Files[0].FileName, Request.Files[0].InputStream, candidateid, customtoken); coreclient.AddRelation(candidateid, fileuploaded.Id, "resume", customtoken); IList document = af.GetResourceTokens(null, candidateid, "resume", customtoken); string contentid = ""; contentid = ((Business.CoreService.ResourceToken)document[0]).ContentId; string fileurl = af.GetFileUrl(contentid, customtoken); Business.ApplicantActions objApplicantActions = new ApplicantActions(); try { applicationid = objApplicantActions.AddApplicant(Session["userid"].ToString(), Session["companyid"].ToString(), jobapplication.jobid, candidateid, "", contentid, "", jobapplication.data); } catch { applicationid = objApplicantActions.AddApplicant(candidateid, jobapplication.companyid, jobapplication.jobid, candidateid, "", contentid, "", jobapplication.data); } return Redirect(Request.UrlReferrer.ToString()); }
public ActionResult Add(ExternalInvoice einv, HttpPostedFileBase file) { Business.ApplicationService.AppServiceClient bd = new Business.ApplicationService.AppServiceClient(); Business.CoreService.MyFile fileuploaded = new Business.CoreService.MyFile(); Business.CoreService.IobjectServicesWebappVer2Client coreclient = new Business.CoreService.IobjectServicesWebappVer2Client(); AmazonFile af = new AmazonFile(); fileuploaded = af.WriteFile(Request.Files[0].FileName, Request.Files[0].InputStream, Session["companyid"].ToString(), Session["usertoken"].ToString()); coreclient.AddRelation(einv.invoiceid, fileuploaded.Id, "extinv", Session["usertoken"].ToString()); IList document = af.GetResourceTokens(null, einv.invoiceid, "extinv", Session["usertoken"].ToString()); string fileurl = ""; foreach (Business.CoreService.ResourceToken li in document) { fileurl = af.GetFileUrl(li.ContentId, Session["usertoken"].ToString()); } return RedirectToAction("inbound"); }
public ActionResult Add(ExternalInvoice einv, HttpPostedFileBase file) { Business.ApplicationService.AppServiceClient bd = new Business.ApplicationService.AppServiceClient(); Business.CoreService.MyFile fileuploaded = new Business.CoreService.MyFile(); Business.CoreService.IobjectServicesWebappVer2Client coreclient = new Business.CoreService.IobjectServicesWebappVer2Client(); AmazonFile af = new AmazonFile(); fileuploaded = af.WriteFile(Request.Files[0].FileName, Request.Files[0].InputStream, Session["companyid"].ToString(), Session["usertoken"].ToString()); coreclient.AddRelation(einv.invoiceid, fileuploaded.Id, "extinv", Session["usertoken"].ToString()); IList document = af.GetResourceTokens(null, einv.invoiceid, "extinv", Session["usertoken"].ToString()); string fileurl = ""; foreach (Business.CoreService.ResourceToken li in document) { fileurl = af.GetFileUrl(li.ContentId, Session["usertoken"].ToString()); } return(RedirectToAction("inbound")); }
public ActionResult AddCandidate(JObApplicationdata jobapplication, HttpPostedFileBase file) { string applicationid = ""; string candidateid = Guid.NewGuid().ToString().Replace("-", ""); Business.ApplicationService.AppServiceClient bd = new Business.ApplicationService.AppServiceClient(); Business.CoreService.MyFile fileuploaded = new Business.CoreService.MyFile(); Business.CoreService.IobjectServicesWebappVer2Client coreclient = new Business.CoreService.IobjectServicesWebappVer2Client(); string customtoken = coreclient.Login("*****@*****.**", "password", ""); AmazonFile af = new AmazonFile(); fileuploaded = af.WriteFile(Request.Files[0].FileName, Request.Files[0].InputStream, candidateid, customtoken); coreclient.AddRelation(candidateid, fileuploaded.Id, "resume", customtoken); IList document = af.GetResourceTokens(null, candidateid, "resume", customtoken); string contentid = ""; contentid = ((Business.CoreService.ResourceToken)document[0]).ContentId; string fileurl = af.GetFileUrl(contentid, customtoken); Business.ApplicantActions objApplicantActions = new ApplicantActions(); try { applicationid = objApplicantActions.AddCandidate(Session["userid"].ToString(), Session["companyid"].ToString(), jobapplication.jobid, candidateid, "", contentid, "", jobapplication.data); } catch { applicationid = objApplicantActions.AddCandidate(candidateid, jobapplication.companyid, jobapplication.jobid, candidateid, "", contentid, "", jobapplication.data); } return(Redirect(Request.UrlReferrer.ToString())); }
public JobPosting GetJobPosting(string jobid, string companyid, string accesstoken) { JobPosting appliedjob = new JobPosting(); List<Job> jobinfo = new Job().getJobDetailsByJobId(jobid, companyid); appliedjob.postedjob = jobinfo[0]; List<JobApplication> applications = new List<JobApplication>(); Business.ApplicantActions ObjApplicantActions = new ApplicantActions(); List<Business.ApplicationService.applicant> candidatesCollection = ObjApplicantActions.GetApplicantsinjob(System.Web.HttpContext.Current.Session["userid"].ToString(), companyid, jobid,"applicant"); foreach (Business.ApplicationService.applicant dr in candidatesCollection) { JobApplication tempjobapplication = new JobApplication(); tempjobapplication.applicationid = dr.transactionid.ToString(); portalcandidate tempcandidate = new portalcandidate(); tempcandidate.id = dr.candidateid.ToString(); tempcandidate.resumeid = dr.resumeid.ToString(); if (tempcandidate.resumeid == "" || tempcandidate.resumeid == null) { tempcandidate.resumeurl = ""; } else { AmazonFile af = new AmazonFile(); tempcandidate.resumeurl = af.GetFileUrl(dr.resumeid.ToString(), accesstoken); } tempcandidate.contactid = dr.contactid.ToString(); tempcandidate.data = dr.data.ToString(); tempjobapplication.candidate = tempcandidate; tempjobapplication.appliedon = dr.createddate.ToString(); try { tempjobapplication.applicationstatus = dr.status.ToString(); } catch { tempjobapplication.applicationstatus = "0"; } applications.Add(tempjobapplication); } appliedjob.applications = applications; return appliedjob; }
public List<JobApplication> GetJobApplicants(string jobid, string companyid) { List<JobApplication> applications = new List<JobApplication>(); Business.ApplicationService.AppServiceClient appclient = new Business.ApplicationService.AppServiceClient(); List<Business.ApplicationService.applicant> serviceapplicants = appclient.GetApplicantsinjob(System.Web.HttpContext.Current.Session["userid"].ToString(), companyid, jobid, "","applicant").ToList(); foreach (Business.ApplicationService.applicant serviceapplicant in serviceapplicants) { JobApplication tempjobapplication = new JobApplication(); tempjobapplication.applicationid = serviceapplicant.transactionid; portalcandidate tempcandidate = new portalcandidate(); tempcandidate.id = serviceapplicant.candidateid; tempcandidate.resumeid = serviceapplicant.resumeid; if (tempcandidate.resumeid == "" || tempcandidate.resumeid == null) { tempcandidate.resumeurl = ""; } else { try { AmazonFile af = new AmazonFile(); tempcandidate.resumeurl = af.GetFileUrl(serviceapplicant.resumeid, System.Web.HttpContext.Current.Session["usertoken"].ToString()); } catch { } } tempcandidate.contactid = serviceapplicant.contactid; tempcandidate.data = serviceapplicant.data; tempjobapplication.candidate = tempcandidate; try { tempjobapplication.applicationstatus = serviceapplicant.status.ToString(); } catch { tempjobapplication.applicationstatus = "0"; } applications.Add(tempjobapplication); } return applications; }
public List<attachment> GetInvoiceAttachments(string invoiceid, string usertoken) { AmazonFile af = new AmazonFile(); IList document = af.GetResourceTokens(null, invoiceid, "extinv", usertoken); List<attachment> attachments = new List<attachment>(); foreach (Business.CoreService.ResourceToken li in document) { attachment tempattachment = new attachment(); tempattachment.id = li.ContentId; tempattachment.path = af.GetFileUrl(li.ContentId, usertoken); tempattachment.title = li.Filename; tempattachment.type = li.ObjectType; attachments.Add(tempattachment); } return attachments; }