Ejemplo n.º 1
0
 public void Tranfer()
 {
     try
     {
         USERPROFILEMASTER lm = USERPROFILEMASTER.GetByRegistration_ID(int.Parse(Session["loginid"].ToString()));
         if (lm.Registration_ID > 0)
         {
             USERPROFILEMASTER lmm            = new USERPROFILEMASTER();
             decimal           PreviousAmount = lm.UserWallet;
             decimal           Amount         = decimal.Parse(txtamount.Text.Trim());
             decimal           TotalAmount    = PreviousAmount + Amount;
             lmm.WalletRecharge(lm.Registration_ID, TotalAmount);
             {
                 ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Wallet recharge successful..!!!')</script>", false);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Some technical issues. Please contact our support team...!!!')</script>", false);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('" + ex.Message + "')</script>", false);
     }
 }
Ejemplo n.º 2
0
        public void Tranfer()
        {
            try
            {
                decimal           totalamt = 0;
                int               UserId   = ddlUser.SelectedIndex;
                USERPROFILEMASTER User     = USERPROFILEMASTER.GetByRegistration_ID(UserId);
                if (User.Registration_ID > 0)
                {
                    foreach (GridViewRow gv in gdvNotice.Rows)
                    {
                        totalamt += decimal.Parse(gv.Cells[4].Text.ToString());
                    }
                    decimal UserAmount     = User.UserWallet;
                    decimal TransferAmount = totalamt;
                    if (UserAmount <= TransferAmount)
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Insufulset amount in User account.!!!')</script>", false);
                        return;
                    }

                    PickupMaster lm = PickupMaster.GetByPickupID(int.Parse(Session["PickupID"].ToString()));
                    if (lm.PickupID > 0)
                    {
                        PickupMaster lmm            = new PickupMaster();
                        decimal      PreviousAmount = lm.PickUpWallet;
                        decimal      Amount         = totalamt;
                        decimal      TotalAmount    = PreviousAmount + Amount;
                        lmm.PaymentByWallet(lm.PickupID, TotalAmount);
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Payment successful..!!!')</script>", false);
                        }
                    }
                    decimal MyAmount      = User.UserWallet;
                    decimal TranferAmount = totalamt;
                    decimal FinalAmount   = MyAmount - TranferAmount;
                    User.WalletRecharge(User.Registration_ID, FinalAmount);
                    MakePayment();
                }

                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Old Password is not Correct...!!!')</script>", false);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('" + ex.Message + "')</script>", false);
            }
        }
Ejemplo n.º 3
0
        public void Tranfer()
        {
            try
            {
                USERPROFILEMASTER User = USERPROFILEMASTER.GetByRegistration_ID(int.Parse(Session["loginid"].ToString()));
                if (User.Registration_ID > 0)
                {
                    decimal UserAmount     = User.UserWallet;
                    decimal TransferAmount = decimal.Parse(txtamount.Text.Trim());
                    if (UserAmount <= TransferAmount)
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Insufulset amount in your accoun.!!!')</script>", false);
                        return;
                    }

                    USERPROFILEMASTER lm = USERPROFILEMASTER.GetByRegistration_ID(int.Parse(ddlUser.SelectedValue));
                    if (lm.Registration_ID > 0)
                    {
                        USERPROFILEMASTER lmm            = new USERPROFILEMASTER();
                        decimal           PreviousAmount = lm.UserWallet;
                        decimal           Amount         = decimal.Parse(txtamount.Text.Trim());
                        decimal           TotalAmount    = PreviousAmount + Amount;
                        lmm.WalletRecharge(lm.Registration_ID, TotalAmount);
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Wallet recharge successful..!!!')</script>", false);
                        }
                    }
                    decimal MyAmount      = User.UserWallet;
                    decimal TranferAmount = decimal.Parse(txtamount.Text.Trim());
                    decimal FinalAmount   = MyAmount - TranferAmount;
                    User.WalletRecharge(User.Registration_ID, FinalAmount);
                }

                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Old Password is not Correct...!!!')</script>", false);
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('" + ex.Message + "')</script>", false);
            }
        }
        protected void lnkWallet2_Click(object sender, EventArgs e)
        {
            int UserID             = int.Parse(Session["loginid"].ToString());
            USERPROFILEMASTER User = USERPROFILEMASTER.GetByRegistration_ID(UserID);

            if (User.Registration_ID > 0)
            {
                decimal UserAmount     = User.UserWallet;
                decimal TransferAmount = 5000;// totalAmount;
                if (UserAmount <= TransferAmount)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Insufulset amount in User account.!!!')</script>", false);
                    return;
                }
                #region
                SqlConnection  cn    = new SqlConnection(constr);
                SqlCommand     cmd   = new SqlCommand("usp_SaveUserOrder", cn);
                SqlDataAdapter adptr = new SqlDataAdapter(cmd);
                DataSet        ds    = new DataSet();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@User_id", UserID);
                cn.Open();
                adptr.Fill(ds);
                cn.Close();
                orderNo     = ds.Tables[0].Rows[0]["OrderNo"].ToString();
                totalAmount = Convert.ToDecimal(ds.Tables[0].Rows[0]["TotalAmount"]);
                #endregion
                USERPROFILEMASTER lm = USERPROFILEMASTER.GetByUser_Name("OMHRD");
                if (lm.Registration_ID > 0)
                {
                    USERPROFILEMASTER lmm            = new USERPROFILEMASTER();
                    decimal           PreviousAmount = lm.UserWallet;
                    decimal           Amount         = totalAmount;
                    decimal           TotalAmount    = PreviousAmount + Amount;
                    lmm.WalletRecharge(lm.Registration_ID, TotalAmount);
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Payment successful..!!!')</script>", false);
                    }
                }
                decimal MyAmount      = User.UserWallet;
                decimal TranferAmount = totalAmount;
                decimal FinalAmount   = MyAmount - TranferAmount;
                User.WalletRecharge(User.Registration_ID, FinalAmount);
                #region SaveUserOrderPayment
                using (SqlConnection conn = new SqlConnection(constr))
                {
                    SqlDataAdapter da = new SqlDataAdapter();
                    da.InsertCommand = new SqlCommand("Insert Into UserOrderPaymenttbl (Orderid, TrackingId, BankRefNo, OrderStatus,FailureMessage,PaymentMod,CardName,StatusCode,StatusMessage,ResponseCode,PaymentDate,Amount,UserId) Values (@Orderid, @TrackingId, @BankRefNo, @OrderStatus,@FailureMessage,@PaymentMod,@CardName,@StatusCode,@StatusMessage,@ResponseCode,@PaymentDate,@Amount,@UserId)", conn);
                    da.InsertCommand.Parameters.Add("@Orderid", SqlDbType.Int).Value      = 0;
                    da.InsertCommand.Parameters.Add("@TrackingId", SqlDbType.Text).Value  = "";
                    da.InsertCommand.Parameters.Add("@BankRefNo", SqlDbType.Text).Value   = "";
                    da.InsertCommand.Parameters.Add("@OrderStatus", SqlDbType.Text).Value = "Success";

                    da.InsertCommand.Parameters.Add("@FailureMessage", SqlDbType.Text).Value = "";
                    da.InsertCommand.Parameters.Add("@PaymentMod", SqlDbType.Text).Value     = "Wallet";
                    da.InsertCommand.Parameters.Add("@CardName", SqlDbType.Text).Value       = "";
                    da.InsertCommand.Parameters.Add("@StatusCode", SqlDbType.Int).Value      = 0;

                    da.InsertCommand.Parameters.Add("@StatusMessage", SqlDbType.Text).Value   = "";
                    da.InsertCommand.Parameters.Add("@ResponseCode", SqlDbType.Int).Value     = 0;
                    da.InsertCommand.Parameters.Add("@PaymentDate", SqlDbType.DateTime).Value = System.DateTime.Now;
                    da.InsertCommand.Parameters.Add("@Amount", SqlDbType.Decimal).Value       = totalAmount;
                    da.InsertCommand.Parameters.Add("@UserId", SqlDbType.Int).Value           = UserID;
                    conn.Open();
                    da.InsertCommand.ExecuteNonQuery();
                    conn.Close();
                }
                #endregion
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Some technical error...!!!')</script>", false);
            }
        }