protected void RepeaterTransfer_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            try
            {
                //int index = e.Item;
                DateTime FromDate;
                DateTime ToDate;
                int      Distributor  = 0;
                int      ClientTypeID = Convert.ToInt32(Session["ClientTypeID"]);
                if (e.CommandName == "ChangeStatus")
                {
                    long RechargeID = Convert.ToInt32(e.CommandArgument);

                    Label lblChargedAmount = (Label)RepeaterTransfer.FindControl("lblChargedAmount");

                    int retval = ssc.UpdateStatusRecharge(Convert.ToInt32(RechargeID), Convert.ToInt32(Session["LoginId"]));
                    if (retval > 0)
                    {
                        ShowPopUpMsg("Change Status Successfully.");

                        if (ddlDistributor.SelectedValue == "0")
                        {
                            Distributor = 1;
                        }
                        else
                        {
                            Distributor = Convert.ToInt32(ddlDistributor.SelectedValue);
                        }
                        if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
                        {
                            FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                            ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());
                        }
                        else
                        {
                            DateTime today = DateTime.Today;
                            int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

                            FromDate = new DateTime(today.Year, today.Month, 1);
                            ToDate   = new DateTime(today.Year, today.Month, numberOfDaysInMonth);
                        }
                        DataSet ds = ssc.GetRechargeFailReport(Distributor, ClientTypeID, Convert.ToInt32(Session["LoginId"]), FromDate, ToDate, Convert.ToString(ddlRechargeVia.SelectedItem.Text));
                        if (ds != null)
                        {
                            RepeaterTransfer.DataSource = ds.Tables[0];
                            RepeaterTransfer.DataBind();
                        }
                    }
                    else
                    {
                        ShowPopUpMsg("Error! Please Check.");
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
        protected void RepeaterTransfer_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            try
            {
                //int index = e.Item;
                DateTime FromDate;
                DateTime ToDate;
                int      Distributor  = 0;
                int      ClientTypeID = Convert.ToInt32(Session["ClientTypeID"]);
                if (e.CommandName == "ChangeStatus")
                {
                    long  PaymentID        = Convert.ToInt32(e.CommandArgument);
                    Label lblChargedAmount = (Label)RepeaterTransfer.FindControl("lblChargedAmount");

                    int retval = 0;
                    //ssc.ChangeStatusForTopUp(Convert.ToInt32(Session["DistributorID"]), Convert.ToInt32(Session["LoginId"]), Convert.ToInt32(Session["ClientTypeID"]), PaymentID);
                    if (retval > 0)
                    {
                        ShowPopUpMsg("Change Status Successfully.");

                        if (ddlDistributor.SelectedValue == "0")
                        {
                            Distributor = 1;
                        }
                        else
                        {
                            Distributor = Convert.ToInt32(ddlDistributor.SelectedValue);
                        }
                        if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
                        {
                            FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                            ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());

                            txtFromDate.Text = Convert.ToString(FromDate.ToString("MM-dd-yyyy"));
                            txtToDate.Text   = Convert.ToString(ToDate.ToString("MM-dd-yyyy"));
                        }
                        else
                        {
                            DateTime today = DateTime.Today;
                            int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

                            FromDate = new DateTime(today.Year, today.Month, 1);
                            ToDate   = new DateTime(today.Year, today.Month, numberOfDaysInMonth);

                            txtFromDate.Text = Convert.ToString(FromDate.ToString("MM-dd-yyyy"));
                            txtToDate.Text   = Convert.ToString(ToDate.ToString("MM-dd-yyyy"));
                        }
                        DataSet ds = ssc.GetTopupPaymentDetailsService(Distributor, Convert.ToInt32(Session["LoginId"]), ClientTypeID, txtFromDate.Text.Trim(), txtToDate.Text.Trim());

                        if (ds != null)
                        {
                            RepeaterTransfer.DataSource = ds.Tables[0];
                            RepeaterTransfer.DataBind();
                            //for (int i = 0; i < RepeaterTransfer.Items.Count; i++)
                            //{
                            //    Label lblTransactionStatus = (Label)RepeaterTransfer.Items[i].FindControl("lblTransactionStatus");
                            //    LinkButton lnkChangeStatus = (LinkButton)RepeaterTransfer.Items[i].FindControl("lnkChangeStatus");
                            //    if (lblTransactionStatus.Text == "Pending")
                            //    {
                            //        lnkChangeStatus.Visible = true;
                            //    }
                            //    else
                            //    {
                            //        lnkChangeStatus.Visible = false;
                            //    }
                            //}
                        }
                    }
                    else
                    {
                        ShowPopUpMsg("Error! Please Check.");
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }