Ejemplo n.º 1
0
        public int CustomerInsertPaymentDetilsInfo_NewDesign([FromBody] PaymentInsertML Mobj)
        {
            List <PaymentInsertML> lstPayment = new List <PaymentInsertML>();

            lstPayment.Add(Mobj);
            Mobj.dtPaymentDetails = Commonclass.returnListDatatable(PersonaldetailsUDTables.createDataTablePayment_New(), lstPayment);
            return(this.IPayment.CustomerInsertPaymentDetilsInfo_NewDesign(Mobj));
        }
Ejemplo n.º 2
0
 public int CustomerInsertPaymentDetilsInfo_NewDesign(PaymentInsertML Mobj)
 {
     return(new PaymentDAL().CustomerInsertPaymentDetilsInfo_New(Mobj, "[dbo].[Usp_InsertPaymentDetailsInfo_NewDesign_NewDesign]"));
 }
Ejemplo n.º 3
0
        //New Payment Table Design  Test API

        public int CustomerInsertPaymentDetilsInfo_New(PaymentInsertML Mobj, string spName)
        {
            int     IntStatus          = 0;
            DataSet dsPaymentDetails   = new DataSet();
            int?    Istatus            = null;
            int?    inull              = null;
            List <Smtpemailsending> li = new List <Smtpemailsending>();
            SqlDataAdapter          daPaymentDetails = new SqlDataAdapter();
            SqlConnection           connection       = new SqlConnection();

            connection = SQLHelper.GetSQLConnection();
            connection.Open();
            try
            {
                SqlCommand cmd = new SqlCommand(spName, connection);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@dtPaymentDetails", Mobj.dtPaymentDetails);
                cmd.Parameters.AddWithValue("@PaysmsID", Mobj.PaysmsID);
                SqlParameter outputParamStatus = cmd.Parameters.Add("@Status", SqlDbType.Int);
                outputParamStatus.Direction = ParameterDirection.Output;
                SqlParameter outputParamErrorLog = cmd.Parameters.Add("@ErrorMsg", SqlDbType.VarChar, 1000);
                outputParamErrorLog.Direction  = ParameterDirection.Output;
                daPaymentDetails.SelectCommand = cmd;
                daPaymentDetails.Fill(dsPaymentDetails);

                if (dsPaymentDetails != null && dsPaymentDetails.Tables.Count > 0 && dsPaymentDetails != null)
                {
                    for (int i = 0; i < dsPaymentDetails.Tables[0].Rows.Count; i++)
                    {
                        Smtpemailsending smtp = new Smtpemailsending();
                        {
                            smtp.profile_name = dsPaymentDetails.Tables[0].Columns.Contains("profile_name") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["profile_name"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["profile_name"].ToString() : string.Empty;
                            smtp.recipients   = dsPaymentDetails.Tables[0].Columns.Contains("recipients") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["recipients"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["recipients"].ToString() : string.Empty;
                            smtp.body         = dsPaymentDetails.Tables[0].Columns.Contains("body") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["body"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["body"].ToString() : string.Empty;
                            smtp.subject      = dsPaymentDetails.Tables[0].Columns.Contains("subject") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["subject"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["subject"].ToString() : string.Empty;
                            smtp.body_format  = dsPaymentDetails.Tables[0].Columns.Contains("body_format") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["body_format"].ToString()) ? dsPaymentDetails.Tables[0].Rows[i]["body_format"].ToString() : string.Empty;
                            Istatus           = smtp.Status = dsPaymentDetails.Tables[0].Columns.Contains("Status") && !string.IsNullOrEmpty(dsPaymentDetails.Tables[0].Rows[i]["Status"].ToString()) ? Convert.ToInt32(dsPaymentDetails.Tables[0].Rows[i]["Status"]) : inull;
                        }
                        li.Add(smtp);
                    }
                    IntStatus = (Istatus != null && Istatus != 0) ? 1 : 0;
                    if (Mobj.PaysmsID == 1)
                    {
                        Commonclass.SendMailSmtpMethod(li, "info");
                        Commonclass.PaymentinsertSMS(dsPaymentDetails, Mobj);
                    }
                }
                else
                {
                    if (Convert.ToInt32(cmd.Parameters[0].Value) == 1)
                    {
                        IntStatus = 1;
                    }
                    else
                    {
                        IntStatus = 0;
                    }
                }
            }
            catch (Exception EX) { Commonclass.ApplicationErrorLog(spName, Convert.ToString(EX.Message), null, null, null); }
            finally
            {
                connection.Close();
            }
            if (dsPaymentDetails.Tables.Count == 0)
            {
                dsPaymentDetails = null;
            }
            return(IntStatus);
        }
Ejemplo n.º 4
0
        public static void PaymentinsertSMS(DataSet dsPaymentDetails, PaymentInsertML Mobj)
        {
            string page                = string.Empty;
            string ProfileID           = string.Empty;
            string AmountPaid          = string.Empty;
            string strVerificationText = string.Empty;

            if (dsPaymentDetails != null)
            {
                string     lblBalAmount = (Convert.ToDecimal(Mobj.dtPaymentDetails.Rows[0]["AgreedAmount"]) - Convert.ToDecimal(Mobj.dtPaymentDetails.Rows[0]["AmountPaid"])).ToString();
                string     lblPaymentID = dsPaymentDetails.Tables[0].Rows[0]["paymentid"].ToString();
                PaymentDAL payment      = new PaymentDAL();
                if (Mobj.PaysmsID == 1)
                {
                    ServiceSoapClient cc            = new ServiceSoapClient();
                    DataTable         dtProfileID   = new DataTable();
                    string            strgender     = null;
                    string            strbranchcode = null;
                    if (Mobj.dtPaymentDetails.Rows[0]["ProfileID"] != null)
                    {
                        string strProfileID = Mobj.dtPaymentDetails.Rows[0]["ProfileID"].ToString();
                        dtProfileID = payment.Bgepay_RegionProfileID(strProfileID);
                        if (dtProfileID.Rows.Count > 0)
                        {
                            if (dtProfileID.Rows[0]["GenderID"].ToString() == "1")
                            {
                                strgender = "Mr";
                            }
                            else
                            {
                                strgender = "Ms";
                            }
                            strbranchcode = dtProfileID.Rows[0]["BranchesName"].ToString();
                        }
                    }
                    if (Mobj.dtPaymentDetails.Rows.Count > 0)
                    {
                        ProfileID           = Mobj.dtPaymentDetails.Rows[0]["ProfileID"].ToString();
                        AmountPaid          = Mobj.dtPaymentDetails.Rows[0]["AmountPaid"].ToString();
                        strVerificationText = strgender + '.' + dsPaymentDetails.Tables[0].Rows[0]["Name"].ToString() + ", thank you for the payment of  Rs." + AmountPaid + "/ @" + strbranchcode + " and your profile id is : " + ProfileID + ".... Kaakateeya.com";
                    }
                    else
                    {
                        strVerificationText = strgender + '.' + dsPaymentDetails.Tables[0].Rows[0]["Name"].ToString() + " No Payment received for the" + ProfileID + ".";
                    }

                    try
                    {
                        if (Mobj.dtPaymentDetails.Rows[0]["ProfileID"] != null)
                        {
                            string strProfileID = Mobj.dtPaymentDetails.Rows[0]["ProfileID"].ToString();
                            dtProfileID = payment.Bgepay_RegionProfileID(strProfileID);

                            if (dtProfileID.Rows.Count > 0)
                            {
                                string strRegion = dtProfileID.Rows[0]["Region"].ToString();
                                if (strRegion == "409")
                                {
                                    string result1 = cc.SendTextSMS("ykrishna", "summary$1", "9841282222", strVerificationText, "smscntry");
                                    //string result1 = cc.SendTextSMS("ykrishna", "summary$1", "9492117548", strVerificationText, "smscntry");
                                }
                                else
                                {
                                    string result2 = cc.SendTextSMS("ykrishna", "summary$1", "9848355213", strVerificationText, "smscntry");
                                    // string result2 = cc.SendTextSMS("ykrishna", "summary$1", "8341287876", strVerificationText, "smscntry");
                                }
                            }
                        }
                        //dsPaymentDetails.Tables[0].Rows[0]["Number"] = "9492117548";
                        string result = cc.SendTextSMS("ykrishna", "summary$1", dsPaymentDetails.Tables[0].Rows[0]["Number"].ToString(), strVerificationText, "smscntry");
                    }
                    catch (Exception ee)
                    {
                    }
                }
            }
        }