コード例 #1
0
        public ActionResult LandLordVer(LandLordVeriModel model, HttpPostedFileBase file)
        {
            if (file != null && file.ContentLength > 0)
            {
                var fileName = "LLCal_" + CurrentMerchantID + "_" + ContractID + Path.GetExtension(file.FileName);
                var path = Path.Combine(Server.MapPath(GetLLScriptFilePath()), fileName);
                file.SaveAs(path);
                model.ScriptFile = fileName;
            }
            new ContractApi().UpdateLandlordVerification(model, base.ContractID, false);

            SetSuccessMessage("Updated.");

            return RedirectToAction("LandLordVer");
        }
コード例 #2
0
        public ActionResult LandLord(LandLordVeriModel model, HttpPostedFileBase file, string button)
        {
            if (file != null && file.ContentLength > 0)
            {
                var tempFile = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + Path.GetExtension(file.FileName);
                file.SaveAs(tempFile);

                //var fileName = "LLCal_" + CurrentMerchantID + "_" + ContractID + Path.GetExtension(file.FileName);
                var fileName = "LLCal_" + CurrentMerchantID + "_" + ContractID + ".mp3";
                var fullPath = Path.Combine(Server.MapPath(GetLLScriptFilePath()), fileName);
                model.ScriptFile = fileName;
                AudioHelper.ConvertToMP3(tempFile, fullPath);

            }
            contractApi.UpdateLandlordVerification(model, base.ContractID, false);

            if (button == "Complete")
            {
                return CompleteVeriTask();
            }
            SetSuccessMessage("Updated.");
            if (Request.IsAjaxRequest())
            {
                return new JsonResult { Data = "OK" };
            }
            return RedirectToAction("Landlord");
        }