コード例 #1
0
 public ActionResult UpServerPhoto(Model.FlowerTreatment FlowerTreatment)
 {
     try
     {
         HttpPostedFileBase file = Request.Files["file"];
         FlowerTreatment.ChangePhoto         = Utility.ChangeText.SaveUploadPicture(file, "Serveraf");
         FlowerTreatment.FlowerTreatmentType = "服务后";
         FlowerTreatment.State   = "已完成";
         FlowerTreatment.endtime = DateTime.Now;
         Business.Sys_FlowerTreatment Sys_FlowerTreatment = new Business.Sys_FlowerTreatment();
         if (Sys_FlowerTreatment.AddServerPhoto(FlowerTreatment))
         {
             return(Json(new { msg = "1", path = FlowerTreatment.ChangePhoto }));
         }
     }
     catch (Exception ex)
     {
         Utility.Log.WriteTextLog("服务后提交图", "UpServerPhoto", FlowerTreatment.id.ToString(), "", ex.ToString());
     }
     return(View());
 }
コード例 #2
0
        public ActionResult AddServerPhoto(Model.FlowerTreatment FlowerTreatment)
        {
            try
            {
                HttpPostedFileBase file = Request.Files["attach_paths"];
                FlowerTreatment.ChangePhoto         = Utility.ChangeText.SaveUploadPicture(file, "Serveraf");
                FlowerTreatment.FlowerTreatmentType = "服务后";
                FlowerTreatment.State   = "已完成";
                FlowerTreatment.endtime = DateTime.Now;
                Business.Sys_FlowerTreatment Sys_FlowerTreatment = new Business.Sys_FlowerTreatment();
                if (Sys_FlowerTreatment.AddServerPhoto(FlowerTreatment))
                {
                    return(RedirectToAction("TreatRecord", "MFlower", new { ArrangementId = FlowerTreatment.ArrangementId, s = "add" }));
                }
            }
            catch (Exception ex)
            {
                Utility.Log.WriteTextLog("服务后提交图", "AddServerPhoto", FlowerTreatment.id.ToString(), "", ex.ToString());
            }

            return(View());
        }