コード例 #1
0
 protected void gvDeposits_Sorting(object sender, GridViewSortEventArgs e)
 {
     try
     {
         string strExpression = e.SortExpression;
         string strDirection = ViewState["SortDirection"].ToString();
         objBal = new ClsBAL();
         DataSet ds = objBal.GetAgentDeposits(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString()));
         DataTable dt = ds.Tables[0];
         DataView dv = new DataView(dt);
         dv.Sort = strExpression + strDirection;
         gvDeposits.DataSource = dv;
         gvDeposits.DataBind();
         if (strDirection == " ASC") { ViewState["SortDirection"] = " DESC"; } else { ViewState["SortDirection"] = " ASC"; }
     }
     catch (Exception ex)
     {
         lblMsg.InnerHtml = ex.Message;
         throw;
     }
 }
コード例 #2
0
 void BindDeposits()
 {
     objBal = new ClsBAL();
     DataSet ds = objBal.GetAgentDeposits(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString()));
     Userid = ds.Tables[0].Rows[0]["UserId"].ToString();
     gvDeposits.DataSource = ds;
     gvDeposits.DataBind();
 }
コード例 #3
0
    protected void btnUpdateStatus_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in gvDeposits.Rows)
        {
            Label lblDepositedRequestId  =  (Label)row.FindControl("lblDepositRequestId");
            Label lblAgentId = (Label)row.FindControl("lblAgentId");
            Label lblAgentname = (Label)row.FindControl("lblAgentname");
            Label lblemailId = (Label)row.FindControl("lblemailId");

            Label lblAmount = (Label)row.FindControl("lblAmount");
            Label lblDepositType = (Label)row.FindControl("lblDepositType");
            Label lblTransactionNumber = (Label)row.FindControl("lblTransactionNumber");
            Label lblDetails = (Label)row.FindControl("lblDetails");
            Label lblDepositBank = (Label)row.FindControl("lblDepositBank");
            Label lblChequeDrawnBank = (Label)row.FindControl("lblChequeDrawnBank");
            Label lblChequeIssueDate = (Label)row.FindControl("lblChequeIssueDate");
            Label lblChequeNo = (Label)row.FindControl("lblChequeNo");
            Label lblStatus = (Label)row.FindControl("lblStatus");
                DropDownList ddlStatus = (DropDownList)row.FindControl("ddlStatus");
            ClsBAL obj = new ClsBAL();
            DateTime? dtime = null;
            if (lblStatus.Text == "Requested")
            {

                if (ddlStatus.SelectedValue == "Deposited")
                {
                    if (lblChequeIssueDate.Text != "")
                    {
                        dtime = Convert.ToDateTime(lblChequeIssueDate.Text);
                    }
                    lblMsg.InnerText = obj.UpdateDepositRequest(Convert.ToInt32(lblAgentId.Text), Convert.ToDouble(lblAmount.Text),
                                   lblTransactionNumber.Text, lblDepositType.Text, lblDepositBank.Text, lblChequeDrawnBank.Text, dtime,
                                 lblChequeNo.Text, Convert.ToInt32(Session["UserID"].ToString()), Convert.ToInt32(lblDepositedRequestId.Text), lblDetails.Text, ddlStatus.SelectedValue.ToString());

                    //System.Data.DataSet ds = objBal.GetAgentById(Convert.ToInt32(lblAgentId.Text));

                    //DeductAgentBalance(Convert.ToInt32(lblAgentId.Text), Convert.ToDouble(0.00),
                    //                   Convert.ToInt32(ds.Tables[0].Rows[0]["UserId"].ToString()), lblDepositType.Text, Convert.ToDouble(lblAmount.Text.ToString()),
                    //                   Convert.ToDouble(0.00), Convert.ToInt32(0.00));

                    objBal = new ClsBAL();
                    DataSet ds = objBal.GetAgentDeposits(Convert.ToInt32(lblAgentId.Text));
                    string Userid = ds.Tables[0].Rows[0]["UserId"].ToString();

                    DeductAgentBalance(Convert.ToInt32(lblAgentId.Text), Convert.ToDouble(0.00),
                             Convert.ToInt32(Userid), lblDepositType.Text, Convert.ToDouble(lblAmount.Text),
                             Convert.ToDouble(0.00), Convert.ToInt32(0.00));

                    if (lblMsg.InnerText.ToString() == "Amount has been deposited.")
                    {
                        lblMsg.InnerText = lblMsg.InnerText.ToString();
                        BindDepositRequests();

                        #region
                        string Body = "Hello <b>" + lblAgentname.Text + "</b>," +
                            "<br /><br />Let us welcome you  with lovejourney.in " +
                            "Following are your Added Balance details. <br/> <br/>" +
                            "Email ID :<b><b>" + lblemailId.Text.Trim() + "</b><br />" +
                            "Added Amount:<b><b>" + lblAmount.Text + "</b><br />" +

                            "<br /><br />We thank you for registering with  lovejourney.in and please " +
                            "do not hesitate<br /> to write to us at <a href='mailto:[email protected]'>Mail </a><b> " +
                            "should you have any questions. <br /><br />Best Regards, <br />Administrator<br /> <a href='http://lovejourney.in'> lovejourney.in</a>" +
                            "<br /><br />";
                        MailSender.SendEmail(lblemailId.Text.Trim(), "*****@*****.**", "*****@*****.**", "lovejourney-Deposit", Body);
                        #endregion

                    }
                }
                //lblStatus.Visible = false;
                //ddlStatus.Visible = true;
            }
            //else
            //{
            //    lblStatus.Visible = true;
            //    ddlStatus.Visible = false;
            //}
        }
    }