Ejemplo n.º 1
0
 public JsonResult ImageUpload()
 {
     var status = false;
     for (int i = 0; i < Request.Files.Count; i++)
     {
         HttpPostedFileBase myFile = Request.Files[i];
         if (myFile != null && myFile.ContentLength != 0)
         {
             var userID = UserDetail == null ? 0 : UserDetail.UserId;
             string pathForSaving = Server.MapPath("~/ServiceImagesUpload");
             if (SharedFunction.CreateFolderIfNeeded(pathForSaving))
             {
                 try
                 {
                     int defaultImage = Convert.ToInt32(Path.GetFileNameWithoutExtension(myFile.FileName));
                     string fileName = SharedFunction.getUnixTimeStamp() + Path.GetExtension(myFile.FileName);
                     myFile.SaveAs(Path.Combine(pathForSaving, fileName));
                     string path = "~/ServiceImagesUpload/" + fileName;
                     var bioManager = new BioManager();
                     status = bioManager.AddAttachment(Convert.ToInt32(Session["BioServiceId"]), path, userID, defaultImage);
                 }
                 catch (Exception ex)
                 {
                     return Json(ex.InnerException);
                 }
             }
         }
     }
     return Json(status);
 }
Ejemplo n.º 2
0
 public JsonResult AddServices(string Address, string Pincode, string ServiceLookingType, string ServiceRequestType, string ServiceRequestMsg, string CompanyName, string ContactPersonName, string Email, string MobileNo, string location)
 {
     var userId = UserDetail == null ? 0 : UserDetail.UserId;
     var bioManager = new BioManager();
     var status = bioManager.AddServices(Address, Pincode, ServiceLookingType, ServiceRequestType, ServiceRequestMsg, CompanyName, ContactPersonName, Email, MobileNo, userId, location);
     Session["BioServiceId"] = status;
     return Json(status != 0);
 }
Ejemplo n.º 3
0
 public JsonResult Add(string BioServiceType, string ApplicantType, string ApplicantName, string pan, string cin, string pincode, string address, float ProposedCapacity, float EstimatedProjectCost, float AvgLast3yrTurnOver, string CompanyName, string name, string mobileNumber, string email, string location)
 {
     var userId = UserDetail == null ? 0 : UserDetail.UserId;
     var enquiry4Manager = new BioManager();
     var status = enquiry4Manager.Add(BioServiceType, ApplicantType, ApplicantName, pan, cin, pincode, address, ProposedCapacity, EstimatedProjectCost, AvgLast3yrTurnOver, CompanyName, name, mobileNumber, email, userId, location);
     Session["Enquery_ID"] = status;
     AppMail();
     return Json(status != 0);
 }