Exemplo n.º 1
0
 public ActionResult Add(ComplaintTicket imageModel)
 {
     if (imageModel.ImageFile != null)
     {
         string fileName  = Path.GetFileNameWithoutExtension(imageModel.ImageFile.FileName);
         string extension = Path.GetExtension(imageModel.ImageFile.FileName);
         fileName = fileName + DateTime.Now.ToString("yymmssfff") + extension;
         imageModel.Attachment = "~/Image/" + fileName;
         string folderPath = Server.MapPath("~/Image/");
         if (System.IO.File.Exists(folderPath))
         {
             fileName = Path.Combine(folderPath, fileName);
             imageModel.ImageFile.SaveAs(fileName);
         }
         else
         {
             System.IO.Directory.CreateDirectory(folderPath);
             fileName = Path.Combine(folderPath, fileName);
             imageModel.ImageFile.SaveAs(fileName);
         }
     }
     //db.ComplaintTicket.Add(imageModel);
     //db.SaveChanges();
     //ModelState.Clear();
     return(View());
 }
Exemplo n.º 2
0
        void HandleSupportTicketSubmitComplaint(SupportTicketSubmitComplaint packet)
        {
            if (!Global.SupportMgr.GetComplaintSystemStatus())
            {
                return;
            }

            ComplaintTicket comp = new ComplaintTicket(GetPlayer());

            comp.SetPosition(packet.Header.MapID, packet.Header.Position);
            comp.SetFacing(packet.Header.Facing);
            comp.SetChatLog(packet.ChatLog);
            comp.SetTargetCharacterGuid(packet.TargetCharacterGUID);
            comp.SetComplaintType((GMSupportComplaintType)packet.ComplaintType);
            comp.SetNote(packet.Note);

            Global.SupportMgr.AddTicket(comp);
        }