public ActionResult Create(GetPopDashboardViewModel viewModel) { var request = viewModel.MapTo <SaveSignatureRequest>(); var response = _signatureService.SaveSignature(request); var data = new { id = response.Id, userId = response.UserId, username = response.Username, type = response.TypeSignature.ToString(), typeInt = response.TypeSignature, signatureImage = response.SignatureImage }; return(Json(data, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Save Signature /// </summary> /// <param name="tillNumber">Till number</param> /// <param name="saleNumber">Sale number</param> /// <param name="imageFile">Image</param> /// <param name="error">Error</param> /// <returns>True or false</returns> public bool SaveSignature(int tillNumber, int saleNumber, string imageFile, out ErrorMessage error) { error = new ErrorMessage(); if (!_policyManager.TE_SIGNATURE) { error = new ErrorMessage { MessageStyle = new MessageStyle { Message = "Please select Required to collect customer signature policy in BackOffice", MessageType = 0 }, StatusCode = HttpStatusCode.BadRequest }; return(false); } return(_signatureService.SaveSignature(tillNumber, saleNumber, imageFile)); }