public bool SigantorySignatureUpload(M_Signatory Model, string pfxpath, string Imgpath, string Createdby) { try { using (DBLinqDataContext datacontext = new DBLinqDataContext()) { datacontext.Connection.ConnectionString = Connection_; var result = datacontext._getUserSignatureDetails(Model.UserId).FirstOrDefault(); if (result == null) { datacontext._setSignatorySignatureDetails(Model.UserId, pfxpath, Imgpath, Createdby); datacontext.SubmitChanges(); return(true); } else { if (result.UserID.Equals(Model.UserId)) { datacontext._setUpdateUserSignatureDetails(Model.UserId, pfxpath, Imgpath, Createdby); datacontext.SubmitChanges(); return(true); } } } return(false); } catch (Exception ex) { // Console.WriteLine(ex.Message.ToString()); ErrorLog.LogError(ex); return(false); } }
public JsonResult SignatorySignature(M_Signatory Model) { bool result = false; try { string DirectoryPath = "~/Signature/" + Model.UserId + "/" + DateTime.Now.ToString("yyyy_MM_dd"); var pfx = Model.Signature_Path; var imgPath = Model.Singature_Img; if (pfx != null && imgPath != null && Model.UserId == null) { if (objUser.SigantorySignatureUpload(Model, DirectoryPath + "/" + pfx.FileName.Replace(" ", "_"), DirectoryPath + "/" + imgPath.FileName.Replace(" ", "_"), _session.User_Id)) { if (!Directory.Exists(Server.MapPath(DirectoryPath))) { Directory.CreateDirectory(Server.MapPath(DirectoryPath)); } pfx.SaveAs(Server.MapPath(DirectoryPath + "/" + pfx.FileName.Replace(" ", "_"))); imgPath.SaveAs(Server.MapPath(DirectoryPath + "/" + imgPath.FileName.Replace(" ", "_"))); } result = true; } } catch (Exception Ex) { ErrorLog.LogError(Ex); } return(Json(result, JsonRequestBehavior.AllowGet)); }
public List <M_Signatory> _getSignatoryUser() { try { List <M_Signatory> list = new List <M_Signatory>(); using (DBLinqDataContext datacontext = new DBLinqDataContext()) { datacontext.Connection.ConnectionString = Connection_; System.Data.Linq.ISingleResult <_getSignatoryUsersResult> ckuser = datacontext._getSignatoryUsers(Group_Singatory); foreach (_getSignatoryUsersResult result in ckuser) { M_Signatory s = new M_Signatory(); s.UserId = result.UserID; s.UserName = result.PersonName; list.Add(s); } } return(list); } catch (Exception ex) { // Console.WriteLine(ex.Message.ToString()); ErrorLog.LogError(ex); return(null); } }
public JsonResult BulkSign(M_Signatory Model) { string result = "Error"; //var strin = new JavaScriptSerializer().DeserializeObject(Model.RequestID); _session.C_Password = Model.Password_; var strin = Model.RequestID; string[] arr = strin.ToString().Split(','); for (int a = 0; a < arr.Length; a++) { string[] s = arr[a].Split('_'); if (s[1].Equals("U")) { CRHeader = objCr.getUploadedCertificateRequest(s[0]); SupList = objCr.getSupportingDOCfRequest(s[0]); bool r = Approve_UCertificateRequest(CRHeader.Client_Id, CRHeader.RequestReff, CRHeader.CertificateUploadPath, CRHeader.SealRequired); result = r.ToString(); } else if (s[1].Equals("W")) { CRHeader = objCr.getSavedCertificateRequest(s[0]); SupList = objCr.getSupportingDOCfRequest(s[0]); bool r = CreateCertificate(CRHeader.TemplateId); result = r.ToString(); } } return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult Approve_Certificate(M_Signatory Model) { String result = "Error"; bool r = false; _session.C_Password = Model.Password_; if (Model.RequestType.Equals("W")) { CRHeader = objCr.getSavedCertificateRequest(Model.RequestID); SupList = objCr.getSupportingDOCfRequest(Model.RequestID); r = CreateCertificate(CRHeader.TemplateId); } else if (Model.RequestType.Equals("U")) { CRHeader = objCr.getUploadedCertificateRequest(Model.RequestID); SupList = objCr.getSupportingDOCfRequest(Model.RequestID); r = Approve_UCertificateRequest(CRHeader.Client_Id, CRHeader.RequestReff, CRHeader.CertificateUploadPath, CRHeader.SealRequired); } if (r) { result = "Success"; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Approve_Support(M_Signatory Model) { M_SupportDocumentUpload SModel = objSDApprv.getSDocbyID(Model.RequestID); string r = "Error"; _session.C_Password = Model.Password_; if (SModel != null) { bool rr = Sign_SDocument(SModel.RequestRefNo, SModel.UploadedPath); if (rr) { r = "Sucess"; } } return(Json(r, JsonRequestBehavior.AllowGet)); }
public JsonResult BulkSign(M_Signatory Model) { bool r = false; _session.C_Password = Model.Password_; var strin = Model.RequestID; string[] arr = strin.ToString().Split(','); for (int a = 0; a < arr.Length; a++) { M_SupportDocumentUpload SModel = objSDApprv.getSDocbyID(arr[a]); _session.C_Password = Model.Password_; r = Sign_SDocument(SModel.RequestRefNo, SModel.UploadedPath); } return(Json(r, JsonRequestBehavior.AllowGet)); }