Exemplo n.º 1
0
        public ActionResult GetParentChild(string Pid)
        {
            B_CertificateRequest R = new B_CertificateRequest();
            List <M_Customer>    C = R.getCustomerClients(Pid);

            ViewBag.CustomerIDs = new SelectList(C, "ClientId", "Customer_Name");

            return(PartialView("P_RatesSetCustomer"));
        }
Exemplo n.º 2
0
        public ActionResult Index(M_Cerificate Model)
        {
            B_CertificateRequest objCreq = new B_CertificateRequest();

            string r = "Error";

            Model.Createdby = _session.User_Id;
            Model.ParentId  = _session.Customer_ID;
            Model.Status    = "G";/// need to be change if the save certificate implemented including the CreateSample()

            string reff = objCreq.setCertificateRequest(Model);

            if (reff != null)
            {
                var DocumentUpload = Model.Support_Docs;
                if (DocumentUpload != null)
                {
                    string DirectoryPath = "~/Uploads/Web_SDcouments/" +
                                           DateTime.Now.ToString("yyyy") +
                                           "/" + DateTime.Now.ToString("MMM") + "/" + DateTime.Now.ToString("dd") + "/" + reff;
                    if (!Directory.Exists(Server.MapPath(DirectoryPath)))
                    {
                        Directory.CreateDirectory(Server.MapPath(DirectoryPath));
                    }
                    foreach (var Doc in DocumentUpload)
                    {
                        string             strFileUpload = "file_" + Doc.SupportingDocument_Id;
                        HttpPostedFileBase file          = Request.Files[strFileUpload];

                        if (file != null && file.ContentLength > 0)
                        {
                            var fileName = Path.GetFileName(file.FileName.Replace(" ", "_"));
                            var path     = Path.Combine(Server.MapPath(DirectoryPath), fileName);

                            M_SupportDocumentUpload Su = new M_SupportDocumentUpload();
                            Su.RequestRefNo         = reff;
                            Su.SignatureRequired    = false;
                            Su.SupportingDocumentID = Doc.SupportingDocument_Id;
                            Su.UploadedBy           = _session.User_Id;
                            Su.UploadedPath         = DirectoryPath + "/" + fileName;
                            Su.DocumentName         = fileName;
                            if (Doc.Signature_Required)
                            {
                                Su.SignatureRequired = true;
                                Su.Remarks           = "NCE_Certification";
                            }
                            else
                            {
                                Su.SignatureRequired = false;
                            }
                            objCreq.setSupportingDocumentFRequest(Su);
                            file.SaveAs(path);
                        }
                    }
                }
                CreateSample(Model, reff);
                ViewBag._Result = "Succes";
                r = "Succes";
            }

            var result = new { Msg = r, Cid = Model.Client_Id, RqId = reff };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }