internal DataSet BindAll(FixedDepositModel objFDModel)
        {
            try
            {
                ClsCon.cmd             = new SqlCommand();
                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.CommandText = "SPFixedDeposit";
                ClsCon.cmd.Parameters.AddWithValue("@Ind", objFDModel.Ind);
                ClsCon.cmd.Parameters.AddWithValue("@OrgID", objFDModel.OrgID);
                ClsCon.cmd.Parameters.AddWithValue("@BrID", objFDModel.BrID);
                //ClsCon.cmd.Parameters.AddWithValue("@YrCD", objFDModel.YrCD);
                ClsCon.cmd.Parameters.AddWithValue("@VchType", objFDModel.VchType);

                con = ClsCon.SqlConn();
                ClsCon.cmd.Connection = con;
                dsFD      = new DataSet();
                ClsCon.da = new SqlDataAdapter(ClsCon.cmd);
                ClsCon.da.Fill(dsFD);
                dsFD.DataSetName = "success";
            }
            catch (Exception)
            {
                dsFD             = new DataSet();
                dsFD.DataSetName = "error";
                return(dsFD);
            }
            finally
            {
                con.Close();
                con.Dispose();
                ClsCon.da.Dispose();
                ClsCon.cmd.Dispose();
            }
            return(dsFD);
        }
        internal DataTable SaveFixedDeposit(FixedDepositModel objFDModel)
        {
            try
            {
                ClsCon.cmd             = new SqlCommand();
                ClsCon.cmd.CommandType = CommandType.StoredProcedure;
                ClsCon.cmd.CommandText = "SPFixedDeposit";
                ClsCon.cmd.Parameters.AddWithValue("@Ind", objFDModel.Ind);
                ClsCon.cmd.Parameters.AddWithValue("@OrgID", objFDModel.OrgID);
                ClsCon.cmd.Parameters.AddWithValue("@BrID", objFDModel.BrID);
                //ClsCon.cmd.Parameters.AddWithValue("@YrCD", objFDModel.YrCD);
                ClsCon.cmd.Parameters.AddWithValue("@DespositDate", objFDModel.DespositDate);
                ClsCon.cmd.Parameters.AddWithValue("@BankCode", objFDModel.BankCode);
                ClsCon.cmd.Parameters.AddWithValue("@FDNumber", objFDModel.FDNumber);
                ClsCon.cmd.Parameters.AddWithValue("@MaturityDate", objFDModel.MaturityDate);
                ClsCon.cmd.Parameters.AddWithValue("@DepositAmount", objFDModel.DepositAmount);
                ClsCon.cmd.Parameters.AddWithValue("@MaturityAmonut", objFDModel.MaturityAmount);
                ClsCon.cmd.Parameters.AddWithValue("@ROI", objFDModel.ROI);
                ClsCon.cmd.Parameters.AddWithValue("@SchemeType", objFDModel.SchemeType);
                ClsCon.cmd.Parameters.AddWithValue("@LienAmount", objFDModel.LienAmount);
                ClsCon.cmd.Parameters.AddWithValue("@LienDate", objFDModel.LienDate);

                ClsCon.cmd.Parameters.AddWithValue("@DepositYear", objFDModel.DepositYear);
                ClsCon.cmd.Parameters.AddWithValue("@DepositMonth", objFDModel.DepositMonth);
                ClsCon.cmd.Parameters.AddWithValue("@DepositDay", objFDModel.DepositDay);



                ClsCon.cmd.Parameters.AddWithValue("@FDRAccNumber", objFDModel.FDRAccNumber);
                ClsCon.cmd.Parameters.AddWithValue("@PeriodValue", objFDModel.PeriodValue);
                ClsCon.cmd.Parameters.AddWithValue("@PeriodType", objFDModel.PeriodType);
                ClsCon.cmd.Parameters.AddWithValue("@Narration", objFDModel.Narration);
                ClsCon.cmd.Parameters.AddWithValue("@IsODLien", objFDModel.IsODLien);
                ClsCon.cmd.Parameters.AddWithValue("@User", objFDModel.User);
                ClsCon.cmd.Parameters.AddWithValue("@IP", objFDModel.IP);

                con = ClsCon.SqlConn();
                ClsCon.cmd.Connection = con;
                dtFD      = new DataTable();
                ClsCon.da = new SqlDataAdapter(ClsCon.cmd);
                ClsCon.da.Fill(dtFD);
                dtFD.TableName = "success";
            }
            catch (Exception)
            {
                dtFD           = new DataTable();
                dtFD.TableName = "error";
                return(dtFD);
            }
            finally
            {
                con.Close();
                con.Dispose();
                ClsCon.da.Dispose();
                ClsCon.cmd.Dispose();
            }
            return(dtFD);
        }
Пример #3
0
        public DataTable SaveFixedDeposit(FixedDepositModel objFDModel)
        {
            DataTable dtFD = objFDDA.SaveFixedDeposit(objFDModel);

            return(dtFD);
        }
Пример #4
0
        public DataSet BindAll(FixedDepositModel objFDModel)
        {
            DataSet dsFD = objFDDA.BindAll(objFDModel);

            return(dsFD);
        }
Пример #5
0
        private async Task NewMethod()
        {
            var pd = await ProgressDialog.Show("Sending Request. Please Wait...");

            try
            {
                var accSplitted = Utilities.SplitBeneficiaryDetailsByTab(InvestAccount.Trim());

                string investAccount = accSplitted[0];

                string currencyCode = "NGN";
                string capitalAcct  = investAccount;
                string InvestAcct   = investAccount.Trim();
                string InterestAcct = investAccount;

                string t  = FixedDepositDataModel.Tenure;
                var    t2 = t.Split(' ');

                var    day    = t2[1];
                var    day2   = t2[2];
                var    dd     = day2.Substring(0, 1);
                string tenure = $"{day}{dd}";

                var deposit = new FixedDepositModel()
                {
                    ReferenceID   = Utilities.GenerateReferenceId(),
                    amount        = Convert.ToDecimal(FixedDepositDataModel.InvestAmount),
                    RequestType   = 926.ToString(),
                    changeperiod  = tenure,
                    payinacct     = capitalAcct ?? "",
                    payoutacct3   = InvestAcct ?? capitalAcct,
                    payoutacct2   = InterestAcct ?? capitalAcct,
                    payoutacct1   = InvestAcct ?? capitalAcct,
                    customerid    = GlobalStaticFields.Customer.CustomerId,
                    currency      = currencyCode,
                    rate          = FixedDepositDataModel.Rate,
                    effectivedate = DateTime.Now.ToString("yyyy-MM-dd")
                };
                var request = await apirequest.PostIBS <FixedDepositModel>(deposit, "", URLConstants.SwitchApiLiveBaseUrl, "IBSIntegrator/IBSBridge", "FixedDepositPage"); // modify this line

                var    response      = "";
                string arrangementId = "";
                if (request.IsSuccessStatusCode)
                {
                    response = await request.Content.ReadAsStringAsync();

                    if (!string.IsNullOrEmpty(response) && !response.Contains("Unable to connect to the remote server") && !response.Contains("Connection refused"))
                    {
                        arrangementId = GetXMlString(response);
                        var invest = new SaveInvestment()
                        {
                            amount     = FixedDepositDataModel.InvestAmount,
                            customerid = GlobalStaticFields.Customer.CustomerId,
                            Ref        = arrangementId
                        };
                        if (arrangementId == "x011")
                        {
                            await pd.Dismiss();

                            MessageDialog.Show("OOPS", "Sorry, we are unable to process your request at the moment. Kindly try again later", DialogType.Error, "DISMISS", null);
                            return;
                        }
                        var resp = await apirequest.Post <SaveInvestment>(invest, "", URLConstants.SwitchApiLiveBaseUrl, "Switch/SaveInvest", "FixedDepositPage");

                        if (resp.IsSuccessStatusCode)
                        {
                            await pd.Dismiss();

                            var res = await resp.Content.ReadAsStringAsync();

                            if (!string.IsNullOrEmpty(res))
                            {
                                MessageDialog.Show("SUCCESS", $"Your Fixed Deposit placement worth of {FixedDepositDataModel.InvestAmount} was successful.", PopUps.DialogType.Success, "OK", null); // may need further check
                                await Navigation.PushAsync(new AllInvestments.AllInvestments());
                            }
                        }
                    }
                    else
                    {
                        await pd.Dismiss();

                        MessageDialog.Show("Internal Error", "Sorry, we are unable to process your request at the moment. Please try again later...", PopUps.DialogType.Error, "OK", null);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                await pd.Dismiss();

                await BusinessLogic.Log(ex.ToString(), "exception response buying fixed deposit for user " + GlobalStaticFields.Customer.Email, "/api/IBSIntegrator/IBSBridge", "", ex.ToString(), "Fixed DepositPage");

                MessageDialog.Show("OOPS", "Sorry, We are unable to process your request at the moment. Please try again later", DialogType.Error, "DISMISS", null);
            }
            await pd.Dismiss();
        }