public Response<RespTutorAccountDetails> GetTutorBankDetails(ReqTutorAccountDetails objReq) { Response<RespTutorAccountDetails> response = new Response<RespTutorAccountDetails>(); List<RespTutorAccountDetails> objResp = new List<RespTutorAccountDetails>(); try { objDbMethodV2 = new wizz.Dal.DbMethodsV2(); RespTutorAccountDetails tryObj = new RespTutorAccountDetails(); tryObj = objDbMethodV2.GetTutorBankDetail(objReq); if (tryObj.accountNumber == null) { } else { objResp.Add(tryObj); } if (objResp.Count > 0) { response.Create(true, "done", Messages.AppVersion, objResp); } else { // objResp = new List<RespTutorAccountDetails>(); response.Create(false, "No data found", Messages.AppVersion, objResp); } } catch (Exception ex) { object session = new JavaScriptSerializer().Serialize(objReq); LogManager.Error("Error occured while Processing Webservice request :{0}", ex, session, ex.Message); response.Create(false, Messages.FormatMessage(Messages.ErrorOccure), Messages.AppVersion, objResp); } finally { } return response; return response; }
internal RespTutorAccountDetails GetTutorBankDetail(ReqTutorAccountDetails objReq) { RespTutorAccountDetails objResp = new RespTutorAccountDetails(); if (string.IsNullOrEmpty(objReq.userId)) { objReq.userId = "0"; } using (var db = new WizzDataContext()) { objResp = (from d in db.tblTutorBankDetails where d.fkUserId == Convert.ToInt64(objReq.userId) select new RespTutorAccountDetails { micrCode = d.micrCode == null ? "" : d.micrCode, accountHolderName = d.accountHolderName.ToString(), accountId = d.accountNumber.ToString(), accountNumber = d.accountNumber.ToString(), branchAddress = d.branchAddress.ToString(), bankName = d.bankName.ToString(), ifscCode = d.ifscCode.ToString() }).FirstOrDefault(); if (objResp == null) { objResp = new RespTutorAccountDetails(); } return objResp; } }