public ENT.DMT_BeneficiaryRegisterAdminView GetBenificarybyId(Guid beneficaryid)
        {
            ENT.DMT_BeneficiaryRegisterAdminView Entity = new ENT.DMT_BeneficiaryRegisterAdminView();
            try
            {
                parFields.Clear();

                //Add Query in to string builder object
                QueryDisctionery.SelectPart = "select DMT_BeneficiaryRegister.*,DMT_CustomerRegister.dmt_requestno as dmt_remitterId ";
                QueryDisctionery.TablePart  = @"from DMT_BeneficiaryRegister 
                INNER JOIN DMT_CustomerRegister on DMT_BeneficiaryRegister.dmt_customerid = DMT_CustomerRegister.dmt_customerid";

                QueryDisctionery.ParameterPart = "where dmt_beneficiaryid='" + beneficaryid + "'";

                //Execute Query and get SQLDataReader
                using (SqlDataReader dr = objDBHelper.ExecuteReaderQuery(QueryDisctionery, parFields, objEntity))
                {
                    Entity = COM.DBHelper.CopyDataReaderToSingleEntity <ENT.DMT_BeneficiaryRegisterAdminView>(dr);
                    objDBHelper.Disposed();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                parFields.Clear();
            }
            return(Entity);
        }
        public JsonResult DeleteBeneficary(Guid benificaryid)
        {
            registerresponse rr = new registerresponse();

            try
            {
                using (BAL.DMT_BeneficiaryRegister objBAL = new BAL.DMT_BeneficiaryRegister())
                {
                    ENT.DMT_BeneficiaryRegisterAdminView BR = objBAL.GetBenificarybyId(benificaryid);

                    if (BR != null)
                    {
                        DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                        GENERALRESPONSE GR = new GENERALRESPONSE();

                        object postdata = new
                        {
                            CustomerMobile  = BR.dmt_beneficiarymobile,
                            BeneficiaryCode = BR.dmt_requestno,
                            RemitterId      = BR.dmt_remitterId
                        };

                        string response = dmt.DeleteBeneficary(postdata, "DMT_DeleteBeneficiary");

                        GR = JsonConvert.DeserializeObject <GENERALRESPONSE>(response);

                        if (GR.code == 0)
                        {
                            if (GR.message.ToString().ToUpper() == "OTC SEND SUCCESSFULLY")
                            {
                                rr.message    = GR.message.ToString().ToUpper();
                                rr.code       = 1;
                                rr.customerid = BR.dmt_beneficiaryid;
                            }
                            GlobalVarible.AddMessage("SUCCESS");
                        }
                        else
                        {
                            GlobalVarible.AddError(GR.message.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(new { MySession.Current.MessageResult, rr }, 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));
        }
Пример #4
0
 public ENT.DMT_BeneficiaryRegisterAdminView GetBenificarybyId(Guid beneficaryid)
 {
     ENT.DMT_BeneficiaryRegisterAdminView lstEntity = new ENT.DMT_BeneficiaryRegisterAdminView();
     lstEntity = clsDAL.GetBenificarybyId(beneficaryid);
     return(lstEntity);
 }
        public JsonResult TransferMoney(moneytransfermodel model)
        {
            GlobalVarible.Clear();
            try
            {
                // check for user password
                if (checkpassword(model.password))
                {
                    using (BAL.DMT_MoneyRemittance objTranfer = new BAL.DMT_MoneyRemittance())
                    {
                        // check balance in local.

                        MEMBERS.SQLReturnMessageNValue retVal = objTranfer.DMT_VALIDATE_Transaction(_LoginUserId.ToString(), model.transferamount.ToString());


                        if (retVal.Outval == 1)
                        {
                            DMT dmt = new DMT(APICONSTANT.USERNAME, APICONSTANT.PASSWORD, APICONSTANT.URL);

                            GENERALRESPONSE GR = new GENERALRESPONSE();

                            ENT.DMT_BeneficiaryRegisterAdminView BD = new ENT.DMT_BeneficiaryRegisterAdminView();

                            ENT.DMT_CustomerRegisterAdminView CD = new ENT.DMT_CustomerRegisterAdminView();

                            // get customer information by id
                            using (BAL.DMT_BeneficiaryRegister objBAL = new BAL.DMT_BeneficiaryRegister())
                            {
                                BD = objBAL.GetBenificarybyId(model.benificaryid);
                            }

                            using (BAL.DMT_CustomerRegister objBAL = new BAL.DMT_CustomerRegister())
                            {
                                CD = objBAL.GetCustomerById(model.customerid);
                            }

                            var postdata = new
                            {
                                BeneficiryCode   = BD.dmt_requestno.ToString(),
                                BeneficiryMobile = BD.dmt_beneficiarymobile.ToString(),
                                CustomerMobile   = CD.dmt_mobile.ToString(),
                                IFSC             = BD.dmt_ifsc.ToString(),
                                AccountNo        = BD.dmt_accountnumber.ToString(),
                                RountingType     = model.transfertype.ToString(),
                                BeneficiaryName  = BD.dmt_beneficiaryname.ToString(),
                                Remakrs          = model.remarks.ToString(),
                                Amount           = model.transferamount,
                                Mode             = "WEB",
                                RemitterId       = CD.dmt_requestno.ToString(),
                            };

                            string response = dmt.TransferAmount(postdata, "DMT_MoneyRemittance");

                            GR = JsonConvert.DeserializeObject <GENERALRESPONSE>(response);

                            if (GR.code == 0)
                            {
                                // amount credited successfully then calculate the commission and charge.

                                objTranfer.Entity.userid              = _LoginUserId;
                                objTranfer.Entity.mt_beneficiarycode  = BD.dmt_requestno;
                                objTranfer.Entity.mt_BeneficiryMobile = BD.dmt_beneficiarymobile;
                                objTranfer.Entity.mt_customermobile   = CD.dmt_mobile;
                                objTranfer.Entity.mt_ifsc             = BD.dmt_ifsc;
                                objTranfer.Entity.mt_accountnumber    = BD.dmt_accountnumber;
                                objTranfer.Entity.mt_routingtype      = model.transfertype;
                                objTranfer.Entity.mt_BeneficiaryName  = BD.dmt_beneficiaryname;
                                objTranfer.Entity.mt_remarks          = model.remarks;
                                objTranfer.Entity.mt_amount           = (decimal)model.transferamount;
                                objTranfer.Entity.mt_mode             = "WEB";
                                objTranfer.Entity.mt_Ipaddress        = GlobalVarible.GETIPADDRESS();
                                objTranfer.Entity.mt_RemitterId       = CD.dmt_requestno;
                                objTranfer.Entity.mt_RequestNo        = string.Empty;
                                objTranfer.Entity.mt_Response         = response;

                                retVal = objTranfer.DMT_REMITTANCE(objTranfer.Entity);

                                if (retVal.Outval == 1)
                                {
                                    GlobalVarible.AddMessage("Amount Transfered Successfully.");
                                }
                                else
                                {
                                    GlobalVarible.AddError(retVal.Outmsg);
                                }
                            }
                            else
                            {
                                GlobalVarible.AddError(GR.message.ToString());
                            }
                        }
                        else
                        {
                            GlobalVarible.AddError(retVal.Outmsg);
                        }
                    }
                }
                else
                {
                    GlobalVarible.AddError("Invalid User Password.");
                }
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
            }
            MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
            return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
        }