public HttpResponseMessage GetServices() { GlobalVarible.Clear(); List <ENT.ServiceMasterView> lstEntity = new List <ENT.ServiceMasterView>(); try { using (BAL.ServiceMaster objBal = new BAL.ServiceMaster()) { lstEntity = objBal.GetServices("30B24352-9F4B-485A-AB18-528E74F6F260"); } foreach (ENT.ServiceMasterView s in lstEntity) { s.serviceimage = "http://dmt.appsmith.co.in/Uploads/Services/postpaid.png"; } GlobalVarible.AddMessage("Services get successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public JsonResult GetTransferCharge(moneytransfermodel model) { GlobalVarible.Clear(); var loginuser = User.Identity.GetUserId(); string transferCharge = "-1"; try { using (BAL.DMT_MoneyRemittance objTranfer = new BAL.DMT_MoneyRemittance()) { MEMBERS.SQLReturnMessageNValue retVal = objTranfer.DMT_GetCharge(model.transferamount.ToString(), _LoginUserId, (int)User.GetUserlevel()); if (retVal.Outval == 1) { transferCharge = retVal.Outmsg; GlobalVarible.AddMessage("Transfer Charge Get Successfully."); } else { GlobalVarible.AddError(retVal.Outmsg); } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } return(Json(new { MySession.Current.MessageResult, transferCharge }, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage GetDownlineUsers() { GlobalVarible.Clear(); List <ENT.UserProfileApiView> downlinelist = new List <ENT.UserProfileApiView>(); try { if (User.IsInRole("masterdistributor")) { downlinelist = new BAL.UserProfile().GetMasterDownline(_LOGINUSERID); } else if (User.IsInRole("distributor")) { downlinelist = new BAL.UserProfile().GetDistributorDownline(_LOGINUSERID); } GlobalVarible.AddMessage("Downline users get successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, downlinelist })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage RegisterToken(ENT.UserDeviceToken modal) { GlobalVarible.Clear(); try { using (BAL.UserDeviceToken objBal = new BAL.UserDeviceToken()) { modal.udt_userid = _LOGINUSERID; modal.CreatedBy = _LOGINUSERID; modal.CreatedDateTime = DateTime.Now; if (objBal.Insert(modal)) { GlobalVarible.AddMessage("Token Registered Successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } else { GlobalVarible.AddError("Unable to Add Token.Please Try Again"); ERRORREPORTING.Report(new Exception("Unable to Add Token.Please Try Again"), _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(modal)); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(modal)); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public JsonResult UpdateStatus(string transid, int status, string accountid) { GlobalVarible.Clear(); try { COM.MEMBERS.SQLReturnMessageNValue mUpdate = new BAL.Recharge().UpdateRecharge( accountid, !string.IsNullOrEmpty(transid) ? transid : "N/A", status, "Manually by : " + User.Identity.GetUserName()); if (mUpdate.Outval > 0) { GlobalVarible.AddMessage(mUpdate.Outmsg); } else { GlobalVarible.AddError(mUpdate.Outmsg); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, Request.Url.ToString(), _LoginUserId, _ERRORKEY, (transid + "|" + status + "|" + accountid)); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdateStatus(string id) { GlobalVarible.Clear(); try { if (id != null) { Model = new Web.Framework.Entity.SMSMaster(); Model.smsid = new Guid(id); Model = (ENT.SMSMaster)objBAL.GetByPrimaryKey(Model); if (Model.Status == COM.MyEnumration.MyStatus.Active) { if (!objBAL.UpdateStatus(Model.smsid, COM.MyEnumration.MyStatus.DeActive)) { throw new Exception("Internal Server Error in status update."); } } if (Model.Status == COM.MyEnumration.MyStatus.DeActive) { if (!objBAL.UpdateStatus(Model.smsid, COM.MyEnumration.MyStatus.Active)) { throw new Exception("Internal Server Error in status update."); } } GlobalVarible.AddMessage("Status Update Successfully."); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult GetIsEnabled() { GlobalVarible.Clear(); ENT.IsEnabledApiCall model = new ENT.IsEnabledApiCall(); using (BAL.IsEnabledApiCall obj = new BAL.IsEnabledApiCall()) { model = (ENT.IsEnabledApiCall)obj.GetIsEnabled(Guid.Parse(User.Identity.GetUserId())); } return(Json(model, JsonRequestBehavior.AllowGet)); }
public JsonResult ApproveRequest(string id) { GlobalVarible.Clear(); try { if (id != null) { ENT.DMT_Documents Entity = new ENT.DMT_Documents(); using (BAL.DMT_Documents objBAL = new BAL.DMT_Documents()) { objBAL.Entity.dd_id = Guid.Parse(id); Entity = (ENT.DMT_Documents)objBAL.GetByPrimaryKey(objBAL.Entity); objBAL.Entity.dd_status = (int)COM.MyEnumration.DMTDOCUMENTSTATUS.APPROVED; objBAL.Entity.UpdatedBy = _LoginUserId; objBAL.Entity.UpdatedDateTime = DateTime.Now; if (objBAL.UpdateApprove(objBAL.Entity)) { using (BAL.DMT_Approval dMT_Approval = new BAL.DMT_Approval()) { dMT_Approval.Entity.approval_userid = Entity.dd_userid; dMT_Approval.Entity.approval_status = (int)COM.MyEnumration.DMTAPPROVALSTATUS.APPROVED; dMT_Approval.Entity.CreatedBy = _LoginUserId; dMT_Approval.Entity.CreatedDateTime = DateTime.Now; if (dMT_Approval.Insert(dMT_Approval.Entity)) { GlobalVarible.AddMessage("Request Approved Successfully."); } } GlobalVarible.AddMessage("Request Approved Successfully."); } else { GlobalVarible.AddMessage("Unable to Approve Request."); } } } else { GlobalVarible.AddMessage("Unable Approve Request."); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveAll(String[] hfoperatorcode, String[] md, String[] sd, String[] r, String[] charge, Guid rechargeslabid2) { GlobalVarible.Clear(); try { if (hfoperatorcode == null || md == null || sd == null || r == null || charge == null) { GlobalVarible.AddError("please add pricing details!"); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); } if (hfoperatorcode.Length > 0) { bool outval = new BAL.SlabCommission().DeleteByID(rechargeslabid2); List <ENT.SlabCommission> priceList = new List <ENT.SlabCommission>(); for (int sc = 0; sc < hfoperatorcode.Length; sc++) { if ((md[sc].ToString() != "0") || (sd[sc].ToString() != "0") || (r[sc].ToString() != "0") || (charge[sc].ToString() != "0")) { ENT.SlabCommission pdmodel = new Web.Framework.Entity.SlabCommission(); pdmodel.rechargeslabid = Guid.NewGuid(); pdmodel.CreatedDateTime = DateTime.Now; pdmodel.CreatedBy = Guid.Parse(User.Identity.GetUserId()); pdmodel.slabid = rechargeslabid2; pdmodel.operatorcode = int.Parse(hfoperatorcode[sc]); pdmodel.md = decimal.Parse(md[sc]); pdmodel.sd = decimal.Parse(sd[sc]); pdmodel.r = decimal.Parse(r[sc]); pdmodel.charge = decimal.Parse(charge[sc]); priceList.Add(pdmodel); } } using (BAL.SlabCommission objPrice = new BAL.SlabCommission()) { int Val = objPrice.BulkInsert(priceList); if (Val > 0) { GlobalVarible.AddMessage("Record Save Successfully."); } } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult DeleteBeneficiaryConfirm(customerverificationmodel model) { GlobalVarible.Clear(); try { DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL); OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE(); // get customer information by id using (BAL.DMT_BeneficiaryRegister objBAL = new BAL.DMT_BeneficiaryRegister()) { ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(model.dmt_customerid); //ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(Guid.Parse("1E2C4B19-1229-4ECE-9C04-464AA8907ADC")); var postdata = new { BeneficiaryCode = BR.dmt_requestno, RemitterId = BR.dmt_remitterId, OTP = model.verificationotp, CustomerMobile = BR.dmt_requestno }; string response = dmt.ValidateCustomerOTP(postdata, "DMT_DeleteBeneficiaryConfirm"); OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response); if (OV.code == 0) { objBAL.Entity.dmt_beneficiaryid = model.dmt_customerid; objBAL.Delete(objBAL.Entity); GlobalVarible.AddMessage("Beneficiary Deleted Successfully."); } else { GlobalVarible.AddError(OV.message.ToString()); } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage VerifyCustomer(customerverificationmodel model) { GlobalVarible.Clear(); try { DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL); OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE(); // get customer information by id using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister()) { objBAL.Entity.dmt_customerid = model.dmt_customerid; ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity); var postdata = new { RemitterId = customerRegister.dmt_requestno, OTP = model.verificationotp, CustomerMobile = customerRegister.dmt_mobile }; string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation"); OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response); if (OV.code == 0) { objBAL.Entity.dmt_status = 1; objBAL.UpdateStatus(objBAL.Entity); GlobalVarible.AddMessage("Customer Verified Successfully."); } else { GlobalVarible.AddError(OV.message.ToString()); } } return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage LedgerReport(GetLedgerReportModal modal) { GlobalVarible.Clear(); List <ENT.LedgerReportApiView> lstEntity = new List <ENT.LedgerReportApiView>(); try { //Find paging info var start = modal.PageStart; var length = modal.PageSize; int pageSize = length != 0 ? length : 0; int skip = start != 0 ? start : 1; skip = (skip / pageSize) + 1; COM.TTPagination.isPageing = true; COM.TTPagination.PageSize = pageSize; COM.TTPagination.PageNo = Convert.ToInt64(skip); using (BAL.LedgerReport objBal = new BAL.LedgerReport()) { if (modal.ddrange == 1) { //if (string.IsNullOrEmpty(modal.fromdate) || string.IsNullOrEmpty(modal.todate)) //{ // GlobalVarible.AddError("For custome date you must have to select form and to date."); // return ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }); //} lstEntity = objBal.GetAllSearchApi(modal.ddrange, modal.fromdate.GetDate(), modal.todate.GetDate(), modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID); } else { lstEntity = objBal.GetAllSearchApi(modal.ddrange, DateTime.Now, DateTime.Now, modal.ddData, modal.search, User.GetUserlevel(), _LOGINUSERID); } } GlobalVarible.AddMessage("Recharge report get successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity, COM.TTPagination.RecordCount })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public JsonResult VerifyCustomer(customerverificationmodel model) { GlobalVarible.Clear(); try { DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL); OTPVALIDATIONRESPONSE OV = new OTPVALIDATIONRESPONSE(); // get customer information by id using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister()) { objBAL.Entity.dmt_customerid = model.dmt_customerid; ENT.DMT_CustomerRegister customerRegister = (ENT.DMT_CustomerRegister)objBAL.GetByPrimaryKey(objBAL.Entity); var postdata = new { RemitterId = customerRegister.dmt_requestno, OTP = model.verificationotp, CustomerMobile = customerRegister.dmt_mobile }; string response = dmt.ValidateCustomerOTP(postdata, "DMT_OTP_Customer_Confirmation"); OV = JsonConvert.DeserializeObject <OTPVALIDATIONRESPONSE>(response); if (OV.code == 0) { objBAL.Entity.dmt_status = 1; objBAL.UpdateStatus(objBAL.Entity); GlobalVarible.AddMessage("Customer Verified Successfully."); } else { GlobalVarible.AddError(OV.message.ToString()); } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage SendNotification() { GlobalVarible.Clear(); using (BAL.UserDeviceToken objUDT = new BAL.UserDeviceToken()) { ENT.UserDeviceToken usertoken = objUDT.GetUserDeviceToken(Guid.Parse("5a5537fc-0411-45c1-8960-b24bbf1ea375")); if (usertoken != null) { string message = "Your account is credited with with 100. : " + DateTime.Now.Ticks.ToString(); FCMNOTIFICATION.SendPushNotification(usertoken.udt_devicetoken, message, Guid.Parse("5a5537fc-0411-45c1-8960-b24bbf1ea375"), 1); } } return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); }
public JsonResult SaveCommision(String[] hffrom, String[] hfto, String[] hfmd, String[] hfsd, String[] hfrd, String[] hftype, Guid up_dmtslabid) { GlobalVarible.Clear(); try { if (hffrom == null || hfto == null || hfmd == null || hfsd == null || hfrd == null || hftype == null) { GlobalVarible.AddError("please add pricing details for all level !"); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); } if (hffrom.Length > 0) { List <ENT.DMT_SlabCommission> priceList = new List <ENT.DMT_SlabCommission>(); for (int sc = 0; sc < hffrom.Length; sc++) { ENT.DMT_SlabCommission pdmodel = new Web.Framework.Entity.DMT_SlabCommission(); pdmodel.dmtslabcommid = Guid.NewGuid(); pdmodel.CreatedDateTime = DateTime.Now; pdmodel.CreatedBy = Guid.Parse(User.Identity.GetUserId()); pdmodel.dmtslabid = up_dmtslabid; pdmodel.dmtfromval = decimal.Parse(hffrom[sc]); pdmodel.dmttoval = decimal.Parse(hfto[sc]); pdmodel.dmtmd = decimal.Parse(hfmd[sc]); pdmodel.dmtsd = decimal.Parse(hfsd[sc]); pdmodel.dmtrd = decimal.Parse(hfrd[sc]); pdmodel.dmttype = int.Parse(hftype[sc]); priceList.Add(pdmodel); } using (BAL.DMT_SlabCommission objPrice = new BAL.DMT_SlabCommission()) { int Val = objPrice.BulkInsert(priceList); if (Val > 0) { GlobalVarible.AddMessage("Dmt Commission Saved Successfully."); } } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage PendingApprovalRequest(GetPendingWalletRequestModel modal) { GlobalVarible.Clear(); List <ENT.WalletRequestApiView> lstEntity = new List <ENT.WalletRequestApiView>(); try { //Find paging info var start = modal.PageStart; var length = modal.PageSize; int pageSize = length != 0 ? length : 0; int skip = start != 0 ? start : 1; skip = (skip / pageSize) + 1; COM.TTPagination.isPageing = true; COM.TTPagination.PageSize = pageSize; COM.TTPagination.PageNo = Convert.ToInt64(skip); using (BAL.WalletRequest objBal = new BAL.WalletRequest()) { // lstEntity = new BAL.WalletRequest().GetAllSearch(ddrange, fromdate.GetDate(), todate.GetDate(), ddData, User.GetUserlevel(), Guid.Parse(User.Identity.GetUserId())); if (modal.ddrange == 1) { lstEntity = objBal.GetAllSearchApi(modal.ddrange, modal.fromdate.GetDate(), modal.todate.GetDate(), modal.ddData, User.GetUserlevel(), _LOGINUSERID); } else { lstEntity = objBal.GetAllSearchApi(modal.ddrange, DateTime.Now, DateTime.Now, modal.ddData, User.GetUserlevel(), _LOGINUSERID); } } GlobalVarible.AddMessage("Approval Pending get successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity, COM.TTPagination.RecordCount })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public JsonResult DeleteEntry(string id) { GlobalVarible.Clear(); if (id != null) { Model = new Web.Framework.Entity.Routing(); Model.routeid = new Guid(id); if (objBAL.Delete(Model)) { GlobalVarible.AddMessage("Record Delete Successfully."); } else { GlobalVarible.AddError("Internal Server Error Please Try Again"); } } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult GetCircles(string id) { List <ENT.CircleMaster> lstEntity = new List <ENT.CircleMaster>(); GlobalVarible.Clear(); try { using (BAL.CircleMaster objBal = new BAL.CircleMaster()) { lstEntity = objBal.GetAllActive("IN"); } GlobalVarible.AddMessage("Circles get successfully."); return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet)); } }
public JsonResult GetOperators(string id) { List <ENT.OperatorSetup> lstEntity = new List <ENT.OperatorSetup>(); GlobalVarible.Clear(); try { using (BAL.OperatorSetup objBal = new BAL.OperatorSetup()) { lstEntity = objBal.GetOperatorByService(id, "30B24352-9F4B-485A-AB18-528E74F6F260"); } GlobalVarible.AddMessage("Services get successfully."); return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet)); } }
public HttpResponseMessage GetOperators(GetOperatorModel model) { GlobalVarible.Clear(); List <ENT.OperatorView> lstEntity = new List <ENT.OperatorView>(); try { using (BAL.OperatorSetup objBal = new BAL.OperatorSetup()) { lstEntity = objBal.GetOperators("IN", model.serviceid); } foreach (ENT.OperatorView o in lstEntity) { if (o.servicename == "DTH") { o.auth_maxlength = 16; o.auth_maxlength2 = 0; } else if (o.servicename == "PostPaid" || o.servicename == "Prepaid") { o.auth_maxlength = 10; o.auth_maxlength2 = 0; } else { o.auth_maxlength = 30; o.auth_maxlength2 = 50; } } GlobalVarible.AddMessage("Operators get successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage GetLatesBalance() { GlobalVarible.Clear(); try { using (BAL.UserProfile objBal = new BAL.UserProfile()) { ENT.UserProfile up = objBal.GetBalance(_LOGINUSERID); GlobalVarible.AddMessage("User Balance Get Successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, up.up_balance })); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public JsonResult Approved(MDL.ApprovedRequest model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry2(model); if (strvalidationResult.Count() == 0) { if (checkpassword(model.LoginPwd)) { Guid wrid = new Guid(model.wr_id.Replace("/", "")); Guid userid = Guid.Parse(User.Identity.GetUserId()); string[,] param = { { "WR_ID", wrid.ToString() }, { "UPPERID", userid.ToString() } }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("WALLET_APPROVED", param, true); if (M.ValueFromSQL == 1) { GlobalVarible.AddMessage(M.MessageFromSQL); } else { throw new Exception(string.Join("<br />", M.MessageFromSQL)); } } else { throw new Exception(string.Join("<br />", "Invalid Password !")); } } else { throw new Exception(string.Join("<br />", strvalidationResult)); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveEntry(MDL.WalletRequest model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry(model); if (strvalidationResult.Count() == 0) { model.userid = Guid.Parse(User.Identity.GetUserId()); if (String.IsNullOrEmpty(model.wr_remakrs)) { model.wr_remakrs = string.Empty; } string[,] param = { { "USERID", model.userid.ToString() }, { "AMOUNT", model.wr_amount }, { "TRANSMODE", model.wr_mode.ToString() }, { "ACCOUNTNO", model.wr_accountno }, { "BANKNAME", model.wr_bankname }, { "REFID", model.wr_refrenceid },{ "REMARKS", model.wr_remakrs }, { "USERLEVEL", ((int)User.GetUserlevel()).ToString() } }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("WALLET_REQUEST", param, true); if (M.ValueFromSQL == 1) { GlobalVarible.AddMessage(M.MessageFromSQL); } else { throw new Exception(string.Join("<br />", M.MessageFromSQL)); } } else { throw new Exception(string.Join("<br />", strvalidationResult)); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveEntry(MDL.FundTransfer model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry(model); if (strvalidationResult.Count() == 0) { if (checkpassword(model.up_password)) { model.up_upperid = Guid.Parse(User.Identity.GetUserId()); string[,] param = { { "PARENTID", model.up_upperid.ToString() }, { "USERID", model.up_userid.ToString() }, { "BALTOADD", model.up_fundbalance }, { "TRANSMODE", model.up_mode }, { "REMARKS", model.up_remakrs }, }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("ADD_FUND_TO_ACCOUNT", param, true); if (M.ValueFromSQL == 1) { GlobalVarible.AddMessage(M.MessageFromSQL); } else { throw new Exception(string.Join("<br />", M.MessageFromSQL)); } } else { throw new Exception(string.Join("<br />", "Invalid Password !")); } } else { throw new Exception(string.Join("<br />", strvalidationResult)); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public HttpResponseMessage doWalletRequest(MDL.WalletRequest model) { GlobalVarible.Clear(); List <string> strvalidationResult = new List <string>(); try { COM.DBHelper sqlhelper = new COM.DBHelper(); strvalidationResult = ValidateWalletRequest(model); if (strvalidationResult.Count() == 0) { model.userid = Guid.Parse(User.Identity.GetUserId()); string[,] param = { { "USERID", model.userid.ToString() }, { "AMOUNT", model.wr_amount }, { "TRANSMODE", model.wr_mode.ToString() }, { "ACCOUNTNO", model.wr_accountno }, { "BANKNAME", model.wr_bankname }, { "REFID", model.wr_refrenceid },{ "REMARKS", model.wr_remakrs }, { "USERLEVEL", ((int)User.GetUserlevel()).ToString() } }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("WALLET_REQUEST", param, true); if (M.ValueFromSQL == 1) { GlobalVarible.AddMessage(M.MessageFromSQL); } else { throw new Exception(string.Join("<br />", M.MessageFromSQL)); } } else { throw new Exception(string.Join("<br />", strvalidationResult)); } return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, new JavaScriptSerializer().Serialize(model)); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage GetLatestVersion() { GlobalVarible.Clear(); try { using (BAL.ApplicationVersion objBal = new BAL.ApplicationVersion()) { ENT.ApplicationVersionView av = objBal.GetLatestVersion(); GlobalVarible.AddMessage("Application Version Get Successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, av })); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage GetDmtCustomers() { GlobalVarible.Clear(); List <ENT.DMT_CustomerRegisterApiView> lstEntity = new List <ENT.DMT_CustomerRegisterApiView>(); try { using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister()) { lstEntity = objBAL.GetAllApiCustomer(_LOGINUSERID); } GlobalVarible.AddMessage("User Customers Get Successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity })); } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }
public HttpResponseMessage RegisterCustomer(ENT.DMT_CustomerRegister model) { GlobalVarible.Clear(); registerresponse rr = new registerresponse(); try { List <string> result = new List <string>(); result = ValidateRequest(model); if (result.Count <= 0) { model.CreatedBy = _LOGINUSERID; model.dmt_userid = _LOGINUSERID; model.CreatedDateTime = DateTime.Now; model.dmt_customerid = Guid.NewGuid(); using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister()) { if (objBAL.Insert(model)) { // api call for register customer in api DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL); GENERALRESPONSE RR = new GENERALRESPONSE(); CUSTOMERREGISTRATIONRESPONSE CR = new CUSTOMERREGISTRATIONRESPONSE(); // prepare post data object to check if customer is available or not object postdata = new { CustomerMobile = model.dmt_mobile }; string response = dmt.CheckUser(postdata, "DMT_CustomerValidate"); CR = JsonConvert.DeserializeObject <CUSTOMERREGISTRATIONRESPONSE>(response); if (CR.Code == "224") { postdata = new { FirstName = model.dmt_firstname, LastName = model.dmt_lastname, MobileNo = model.dmt_mobile, DateOfBirth = model.dmt_dateofbirth, Address = model.dmt_address, Pincode = model.dmt_pincode, }; response = dmt.RegisterCustomer(postdata, "DMT_CustomerRegistration"); RR = new GENERALRESPONSE(); RR = JsonConvert.DeserializeObject <GENERALRESPONSE>(response); if (RR.code == 0) { Message message = JsonConvert.DeserializeObject <Message>(RR.message.ToString()); // update remitter id of registered customer. model.dmt_requestno = message.data.remitter.id; objBAL.UpdateRemitter(model); rr.code = 1; rr.message = "Customer Added Successfully.Please verify Customer Now."; rr.customerid = model.dmt_customerid; GlobalVarible.AddMessage("SUCCESS"); } else { GlobalVarible.AddError(RR.message.ToString()); // unable to register user so deleteing from our local database. objBAL.Delete(model); } } else if (CR.Code == "1") { string message = CR.Message.ToString(); GlobalVarible.AddError(message); // unable to register user so deleteing from our local database. objBAL.Delete(model); } else { Message message = JsonConvert.DeserializeObject <Message>(CR.Message.ToString()); if (!String.IsNullOrEmpty(message.data.remitter.mobile)) { // update remitter id of registered customer. model.dmt_requestno = message.data.remitter.id; model.dmt_status = 1; objBAL.UpdateStatusWithRemitter(model); // add all beneficary which already registered. if (message.data.beneficiary.Count > 0) { List <ENT.DMT_BeneficiaryRegister> lstEntity = new List <ENT.DMT_BeneficiaryRegister>(); foreach (BENEFICIARY B in message.data.beneficiary) { lstEntity.Add(new ENT.DMT_BeneficiaryRegister { dmt_beneficiaryid = Guid.NewGuid(), userid = _LOGINUSERID, dmt_beneficiaryname = B.name, dmt_beneficiarymobile = B.mobile, dmt_customerid = model.dmt_customerid, dmt_bankname = B.bank, dmt_ifsc = B.ifsc, dmt_accountnumber = B.account, dmt_address = string.Empty, dmt_addharcard = string.Empty, dmt_status = 1, dmt_requestno = B.id, dmt_response = string.Empty, dmt_pincode = string.Empty }); } using (BAL.DMT_BeneficiaryRegister objBenificary = new BAL.DMT_BeneficiaryRegister()) { objBenificary.BulkInsert(lstEntity); } } rr.code = 2; rr.message = "Customer Added Successfully."; rr.customerid = model.dmt_customerid; GlobalVarible.AddMessage("SUCCESS"); } else { rr.code = 1; rr.message = "Customer Added Successfully.Please verify Customer Now."; rr.customerid = model.dmt_customerid; GlobalVarible.AddMessage("SUCCESS"); } } return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, rr })); } else { GlobalVarible.AddError("Some error occured while saving the customer."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, rr })); } } } else { GlobalVarible.AddErrors(result); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, rr })); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, rr })); } }
public JsonResult doRecharge(ENT.Recharge recharge) { GlobalVarible.Clear(); try { recharge.reqvia = "WEB"; recharge.countrycode = "IN"; recharge.accountref = DateTime.Now.Ticks.ToString(); recharge.userid = _LoginUserId; recharge.ipaddress = Request.UserHostAddress.ToString(); // this will be provided after recharge recharge.requestid = string.Empty; COM.MEMBERS.SQLReturnMessageNValue response = new COM.MEMBERS.SQLReturnMessageNValue(); using (BAL.Recharge objBal = new BAL.Recharge()) { response = objBal.DoRecharge(recharge, _LoginUserId, recharge.ipaddress); } string LocalID = string.Empty; if (response.Outval == 1) { // manage route here to call real api for process recharge. string[] REQ = response.Outmsg.Split(';'); // add log or response here. new BAL.Log().Insert(new ENT.Log() { logdata = REQ[1], CreatedDateTime = DateTime.Now, type = COM.MyEnumration.LOGTYPE.DATA, title = "PORTAL-REQUEST" }); #region WEBSMITHAPI if (REQ[0].Split(':')[2].StartsWith("W")) { LocalID = REQ[0].Split(':')[2].StartsWith("W") ? REQ[0].Split(':')[2].Remove(0, 1) : REQ[0].Split(':')[2]; ProcessRecharge(recharge.numbertorecharge, recharge.operatorcode, (int)recharge.amount, LocalID, recharge.reqtype); } else if (REQ[0].Split(':')[2].StartsWith("X")) { LocalID = REQ[0].Split(':')[2].StartsWith("X") ? REQ[0].Split(':')[2].Remove(0, 2) : REQ[0].Split(':')[2]; ProcessINOUT(REQ[1], LocalID); } #endregion GlobalVarible.AddMessage(REQ[0].Split(',')[0]); } else { GlobalVarible.AddError(response.Outmsg); } return(Json(MySession.Current.MessageResult)); } catch (Exception ex) { ERRORREPORTING.Report(ex, Request.Url.ToString(), _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(recharge)); GlobalVarible.AddError(ex.Message); return(Json(MySession.Current.MessageResult)); } }
public HttpResponseMessage CreateUser(RegisterViewModel model) { GlobalVarible.Clear(); try { var user = new ApplicationUser { UserName = model.Mobile, Email = model.Email, EmailConfirmed = true, PhoneNumber = model.Mobile }; var result = UserManager.Create(user, model.Password); if (result.Succeeded) { if ((int)User.GetUserlevel() == 1) { this.UserManager.AddToRole(user.Id, "distributor"); } else if ((int)User.GetUserlevel() == 2) { this.UserManager.AddToRole(user.Id, "retailer"); } using (BAL.UserProfile objBAL = new BAL.UserProfile()) { ENT.UserProfile userProfile = objBAL.GetSlabName(_LOGINUSERID); objBAL.Entity.up_userid = new Guid(user.Id); objBAL.Entity.up_username = model.UserName; objBAL.Entity.up_mobile = model.Mobile; objBAL.Entity.up_email = model.Email; objBAL.Entity.up_address = model.Address; objBAL.Entity.up_upperid = _LOGINUSERID; if ((int)User.GetUserlevel() == 1) { objBAL.Entity.up_userlevel = COM.MyEnumration.Userlevel.SD; } else if ((int)User.GetUserlevel() == 2) { objBAL.Entity.up_userlevel = COM.MyEnumration.Userlevel.R; } objBAL.Entity.Status = COM.MyEnumration.MyStatus.Active; objBAL.Entity.up_balance = 0; objBAL.Entity.slabid = userProfile.slabid; objBAL.Entity.up_imei = string.Empty; objBAL.Entity.CreatedBy = _LOGINUSERID; objBAL.Entity.CreatedDateTime = DateTime.Now; if (objBAL.Insert(objBAL.Entity)) { GlobalVarible.AddMessage("User created successfully."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } else { GlobalVarible.AddError("Unable to save user detail.Please check data and try again."); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } } } else { GlobalVarible.AddErrors(result.Errors.ToList <string>()); ERRORREPORTING.Report(new Exception(string.Join(",", result.Errors.ToList <string>())), _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty); return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult })); } }