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");
        }
Пример #3
0
        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()));
        }
Пример #5
0
        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;
        }