public HttpResponseMessage UpdateProfilePic([FromBody] ProfilePicModel photo) { if (photo != null) { photo.Action = "Update"; customerManager.ProfilePic(photo); return(Request.CreateResponse(HttpStatusCode.OK, "Picture Updated Successfully")); } return(Request.CreateErrorResponse(HttpStatusCode.NotAcceptable, "invalid request")); }
public void updateAdvtPic(ActiveAdvtModel advtVM) { ProfilePicModel photo = new ProfilePicModel() { Path = advtVM.ImagePath, Id = advtVM.ID, Action = "Update", Type = "Advertisement" }; vendorDao.Pic(photo); }
//customer profile pic path*** public void profilePic(ProfilePicModel photo) { if (photo.Action == "Update") { string query = @"UPDATE Images SET Path = @Path WHERE FId = @FId AND Type = @Type"; Conn.Execute(query, new { Path = photo.Path, FId = photo.Id, Type = "Customer" }); } else if (photo.Action == "Create") { string query = "INSERT INTO Images (Path, FId, Type, IsActive) VALUES (@Path, @FId, @Type, 1)"; Conn.Execute(query, new { Path = photo.Path, FId = photo.Id, Type = photo.Type }); } }
//User Registeration public void Create(CustomerModel customerVm) { int user_id = customerDao.Insert(customerVm); customerVm.ID = user_id; customerDao.InsertAddress(customerVm); ProfilePicModel photo = new ProfilePicModel(); photo.Id = user_id; photo.Path = "../../../images/a.png"; photo.Type = "Customer"; photo.Action = "Create"; ProfilePic(photo); }
public bool Create(VendorModel vendorVm) { int user_id = vendordao.Insert(vendorVm); vendorVm.ID = user_id; vendordao.InsertAddress(vendorVm); ProfilePicModel photo = new ProfilePicModel(); photo.Id = user_id; photo.Path = "../../../images/a.png"; photo.Type = "Vendor"; photo.Action = "Create"; ProfilePic(photo); return(true); }
public async Task <ProfilePicResponseModel> PostFileUpload(string name, byte[] byteArr) { try { var endPoint = String.Format(PostFileUploadKey); ProfilePicModel obj = new ProfilePicModel { LabId = $"{name}", ImageData = (byteArr) }; var result = await HttpClientBase.Post <ProfilePicResponseModel>(endPoint, JsonConvert.SerializeObject(obj)); return(result); } catch (Exception ex) { return(new ProfilePicResponseModel() { Message = ex.Message }); } }
public void ProfilePic(ProfilePicModel photo) { customerDao.profilePic(photo); }
public void ProfilePic(ProfilePicModel photo) { vendordao.Pic(photo); }