public int HubSignUnsignApproval(string obj) { TifinSubmiteHub TifinSubmithub = Newtonsoft.Json.JsonConvert.DeserializeObject <TifinSubmiteHub>(obj); if (TifinSubmithub.OtpNumber <= 0 && (TifinSubmithub.Img != null || TifinSubmithub.Img != "")) { byte[] img = System.Convert.FromBase64String(TifinSubmithub.Img); TifinSubmithub.Img = ""; if (TifinSubmithub.Save() > 0) { string path = "/TifinInfoImg/" + TifinSubmithub.TifinInfoId + ".jpg"; if (Upload.SaveImgToPng(img, path) == false) { return(3); // error in uplad img try again } } else { int OtpCode = TifinSubmithub.OtpNumber; return(2); } } else { int OtpCode = TifinSubmithub.OtpNumber; // otp verification code here; } return(1); }
public static List <TifinSubmiteHub> TifinInfoList() { System.Data.SqlClient.SqlCommand cmd = null; System.Data.SqlClient.SqlDataReader SDR = null; List <TifinSubmiteHub> ListTmp = new List <TifinSubmiteHub>(); TifinSubmiteHub ObjRoutes = null; DBCon Obj = new DBCon(); try { string Query = "SELECT * FROM TifinSubmitInfo"; cmd = new System.Data.SqlClient.SqlCommand(Query, Obj.Con); SDR = cmd.ExecuteReader(); while (SDR.Read()) { ObjRoutes = new TifinSubmiteHub { TifinInfoId = SDR.GetInt32(0), HubId = SDR.GetInt32(1), Img = SDR.GetString(2), PersonName = SDR.GetString(3), Mobile = SDR.GetString(4), Remarks = SDR.GetString(5), CreationDate = SDR.GetDateTime(6) }; ListTmp.Add(ObjRoutes); } } catch (System.Exception e) { e.ToString(); } finally { cmd.Dispose(); SDR.Close(); Obj.Con.Close(); Obj.Con.Dispose(); Obj.Con = null; } return(ListTmp); }