protected void btnFail_Click(object sender, EventArgs e)
        {
            long paytid = Convert.ToInt64(this.HiddenField1.Value);
            // add by akash starts
            string SRemark = Convert.ToString(txtStatusRemark.Text);

            if (SRemark == "" || SRemark == null)
            {
                ShowPopUpMsg("Please Fill Remark and try again.");
                return;
            }
            // add by akash end
            int retval = ssc.ChangeStatusForTopUp(Convert.ToInt32(Session["DistributorID"]), Convert.ToInt32(Session["LoginId"]), Convert.ToInt32(Session["ClientTypeID"]), paytid, 0, SRemark);

            if (retval > 0)
            {
                ShowPopUpMsg("Change Status Successfully[Fail].");
                txtStatusRemark.Text = "";
            }
            int     DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int     ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int     LoginID       = Convert.ToInt32(Session["LoginId"]);
            DataSet ds            = ssc.GetTopupPaymentDetailsService(DistributorID, LoginID, ClientTypeID, txtFromDate.Text, txtToDate.Text);

            if (ds != null)
            {
                RepeaterTransfer.DataSource = ds.Tables[0];
                RepeaterTransfer.DataBind();
            }
        }
Exemple #2
0
        protected void btnShow_Click(object sender, EventArgs e)
        {
            try
            {
                int DistributorID = Convert.ToInt32(Session["DistributorID"]);
                int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                int LoginID       = Convert.ToInt32(Session["LoginId"]);


                int     distributorID = Convert.ToInt32(Session["DistributorID"]);
                DataSet ds;
                if (ddlDistributor.SelectedValue == "0")
                {
                    // ds = ssc.GetReportAcivationFail(DistributorID, 1, LoginID, FromDate, ToDate, Convert.ToString(ddlRechargeVia.SelectedItem.Text));//ssc.GetSaleReportForActivationAndPortIn(DistributorID, 1, FromDate, ToDate);
                    ds = ssc.GetReportRechargeFilterwise(Convert.ToInt32(DistributorID), ClientTypeID, LoginID, txtMobileNo.Text.ToString(), txnID.Text.ToString(), Convert.ToString(ddlRechargeVia.SelectedItem.Text));
                }
                else
                {
                    //ds = ssc.GetReportAcivationFail(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate, Convert.ToString(ddlRechargeVia.SelectedItem.Text));//ssc.GetSaleReportForActivationAndPortIn(Convert.ToInt32(ddlDistributor.SelectedValue), 0, FromDate, ToDate);
                    ds = ssc.GetReportRechargeFilterwise(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, LoginID, txtMobileNo.Text.ToString(), txnID.Text.ToString(), Convert.ToString(ddlRechargeVia.SelectedItem.Text));
                }

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            catch (Exception EX)
            {
                throw EX;
            }
        }
Exemple #3
0
        protected void fillblankGridForMobileSIM()
        {
            //MobileSIMPurchase

            dtfillGridMobileSIMPurchase = new DataTable();

            dtfillGridMobileSIMPurchase.Columns.Add("MobileNo");
            dtfillGridMobileSIMPurchase.Columns.Add("MSISDN_SIM_ID");
            dtfillGridMobileSIMPurchase.Columns.Add("SIMNo");



            //DataRow dr = dtfillGridMobileSIMPurchase.NewRow();

            //dr = dtfillGridMobileSIMPurchase.NewRow();
            //for (int i = 0; i < dtfillGridMobileSIMPurchase.Columns.Count; i++)
            //{

            //    dr[i] = "";

            //}
            //dtfillGridMobileSIMPurchase.Rows.Add(dr);
            //dtfillGridMobileSIMPurchase.AcceptChanges();

            RepeaterTransfer.DataSource = dtfillGridMobileSIMPurchase;
            RepeaterTransfer.DataBind();
            //ViewState["objDTMobile"] = dtfillGridMobileSIMPurchase;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            txtFromDate.Attributes.Add("readonly", "true");
            txtToDate.Attributes.Add("readonly", "true");
            if (!Page.IsPostBack)
            {
                BindDDL();

                int LoginID       = Convert.ToInt32(Session["LoginId"]);
                int distributorID = Convert.ToInt32(Session["DistributorID"]);
                int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                //DateTime FromDate = DateTime.Now;
                //DateTime ToDate = DateTime.Now;

                DateTime today = DateTime.Today;
                int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

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

                txtFromDate.Text = Convert.ToString(FromDate.ToString("dd-MMM-yyyy"));
                txtToDate.Text   = Convert.ToString(ToDate.ToString("dd-MMM-yyyy"));

                DataSet ds = ssc.GetReportTopupLedger(distributorID, ClientTypeID, FromDate, ToDate);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
        }
Exemple #5
0
        protected void ddlNetwork_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DataTable dtSIMPurchase = new DataTable();

                if (ddlNetwork.SelectedIndex > 0)
                {
                    dtSIMPurchase = (DataTable)ViewState["SIMPurchase"];
                    DataView dv = dtSIMPurchase.DefaultView;
                    dv.RowFilter  = "VendorID = " + Convert.ToInt32(ddlNetwork.SelectedValue);
                    dtSIMPurchase = dv.ToTable();

                    RepeaterTransfer.DataSource = dtSIMPurchase;
                    RepeaterTransfer.DataBind();
                }
                else
                {
                    dtSIMPurchase = (DataTable)ViewState["SIMPurchase"];
                    RepeaterTransfer.DataSource = dtSIMPurchase;
                    RepeaterTransfer.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void btnGet_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);



            //DataSet ds = ssc.GetReportRechargeSIM(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);
            DataSet ds;

            if (ddlDistributor.SelectedValue == "0")
            {
                ds = ssc.GetDistributorNotes(DistributorID, ClientTypeID);    //ssc.GetSaleReportForActivationAndPortIn(DistributorID, 1, FromDate, ToDate);
            }
            else
            {
                ds = ssc.GetDistributorNotes(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID);    //ssc.GetSaleReportForActivationAndPortIn(Convert.ToInt32(ddlDistributor.SelectedValue), 0, FromDate, ToDate);
            }

            if (ds != null)
            {
                ViewState["SIMPurchase"]    = ds.Tables[0];
                RepeaterTransfer.DataSource = ds.Tables[0];
                RepeaterTransfer.DataBind();
            }
        }
        protected void btnGet_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            if (txtFromDate.Text.Trim() == "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetReportTopupLedger(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, FromDate, ToDate);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetReportTopupLedger(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, FromDate, ToDate);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
            {
                FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());

                DataSet ds;
                if (ddlDistributor.SelectedValue == "0")
                {
                    ds = ssc.GetReportTopupLedger(DistributorID, ClientTypeID, FromDate, ToDate);
                }
                else
                {
                    ds = ssc.GetReportTopupLedger(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, FromDate, ToDate);
                }

                //DataSet ds = ssc.GetReportInventoryStatus(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                txtFromDate.Attributes.Add("readonly", "true");
                txtToDate.Attributes.Add("readonly", "true");
                if (!Page.IsPostBack)
                {
                    ////////////////////////////
                    DataTable dt = ssc.GetVendor(Convert.ToInt32(Session["LoginId"]));
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            ddlNetwork.DataSource     = dt;
                            ddlNetwork.DataValueField = "VendorID";
                            ddlNetwork.DataTextField  = "VendorName";
                            ddlNetwork.DataBind();
                            ddlNetwork.SelectedIndex = 1;
                        }
                    }
                    ////////////////////////////
                    BindDDL();



                    int LoginID       = Convert.ToInt32(Session["LoginId"]);
                    int distributorID = Convert.ToInt32(Session["DistributorID"]);
                    int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                    //DateTime FromDate = DateTime.Now;
                    //DateTime ToDate = DateTime.Now;


                    DateTime today = DateTime.Today;
                    int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

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

                    txtFromDate.Text             = Convert.ToString(FromDate.ToString("dd-MMM-yyyy"));
                    txtToDate.Text               = Convert.ToString(ToDate.ToString("dd-MMM-yyyy"));
                    ddlDistributor.SelectedValue = Convert.ToString(distributorID);
                    ddlDistributor.Attributes.Add("disabled", "disabled");

                    DataSet ds = ssc.GetPurchaseReport(distributorID, ClientTypeID, LoginID, FromDate, ToDate, 0);

                    if (ds != null)
                    {
                        ViewState["SIMPurchase"]    = ds.Tables[0];
                        RepeaterTransfer.DataSource = ds.Tables[0];
                        RepeaterTransfer.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
        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)
            {
            }
        }
 protected void fillblankGridForMobileSIM()
 {
     dtfillGridMobileSIMPurchase = new DataTable();
     dtfillGridMobileSIMPurchase.Columns.Add("MobileNo");
     dtfillGridMobileSIMPurchase.Columns.Add("MSISDN_SIM_ID");
     dtfillGridMobileSIMPurchase.Columns.Add("SIMNo");
     RepeaterTransfer.DataSource = dtfillGridMobileSIMPurchase;
     RepeaterTransfer.DataBind();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                txtFromDate.Attributes.Add("readonly", "true");
                txtToDate.Attributes.Add("readonly", "true");
                if (!Page.IsPostBack)
                {
                    BindDDL();

                    DateTime today = DateTime.Today;
                    int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

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


                    //DateTime FromDate = DateTime.Now;
                    //DateTime ToDate = DateTime.Now;
                    txtFromDate.Text = Convert.ToString(FromDate.ToString("MM-dd-yyyy"));
                    txtToDate.Text   = Convert.ToString(ToDate.ToString("MM-dd-yyyy"));


                    int DistributorID = Convert.ToInt32(Session["DistributorID"]);
                    int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                    int LoginID       = Convert.ToInt32(Session["LoginId"]);


                    DataSet ds = ssc.GetTopupPaymentDetailsService(DistributorID, LoginID, ClientTypeID, txtFromDate.Text, txtToDate.Text);

                    if (ds != null)
                    {
                        ViewState["tblexcel"]       = ds.Tables[0];
                        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");
                            // Button ChangeStatus = (Button)RepeaterTransfer.Items[i].FindControl("ChangeStatus");
                            /////
                            if (lblTransactionStatus.Text == "Pending")
                            {
                                lnkChangeStatus.Visible = true;
                            }
                            else
                            {
                                lnkChangeStatus.Visible = false;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
        protected void btnGet_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            ddlDistributor.SelectedValue = Convert.ToString(DistributorID);
            ddlDistributor.Attributes.Add("disabled", "disabled");

            if (txtFromDate.Text.Trim() == "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetReportInventoryPurchase(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetReportInventoryPurchase(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
            {
                FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());

                DataSet ds = ssc.GetReportInventoryPurchase(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            ddlNetwork_SelectedIndexChanged(null, null);
        }
Exemple #13
0
        //protected void ddlAction_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        if (ddlAction.SelectedValue == "1")
        //        {
        //            rbSIM_NotMappped.Visible = true;
        //            rbSIM_MappedwithTariff.Visible = true;
        //            lblSIM_MappedwithTariff.Visible = true;
        //            lblSIM_NotMappped.Visible = true;
        //            lblTransferFromAndTo.Text = "Transfer To";
        //            btnTransfer.Text = "Transfer";
        //            btnReject.Visible = false;

        //            Distributor[] dis = null;
        //            dis = ssc.GetDistributorDDLService(0, Convert.ToInt32(Session["DistributorID"]));
        //            if (dis != null)
        //            {
        //                ddlTransferTo.DataSource = dis;
        //                ddlTransferTo.DataValueField = "distributorID";
        //                ddlTransferTo.DataTextField = "distributorName";
        //                ddlTransferTo.DataBind();
        //                ddlTransferTo.Items.Insert(0, new ListItem("---Select Client---", "0"));
        //            }
        //            fillData();
        //            lblBulkTransfer.Visible = true;
        //            chkBulkUpload.Visible = true;
        //            chkBulkUpload.Checked = false;
        //        }
        //        else
        //        {
        //            rbSIM_NotMappped.Visible = false;
        //            rbSIM_MappedwithTariff.Visible = false;
        //            lblSIM_MappedwithTariff.Visible = false;
        //            lblSIM_NotMappped.Visible = false;
        //            btnReject.Visible = true;


        //            Distributor[] dis = null;
        //            dis = ssc.GetDistributorDDLService(0, Convert.ToInt32(Session["DistributorID"]));
        //            if (dis != null)
        //            {
        //                ddlTransferTo.DataSource = dis;
        //                ddlTransferTo.DataValueField = "distributorID";
        //                ddlTransferTo.DataTextField = "distributorName";
        //                ddlTransferTo.DataBind();
        //                ddlTransferTo.Items.Insert(0, new ListItem("---Select Client---", "0"));
        //            }

        //            lblTransferFromAndTo.Text = "Accept From";
        //            btnTransfer.Text = "Accept";

        //            fillblankGridForSIM();
        //            fillblankGridForMobileSIM();

        //            lblBulkTransfer.Visible = false;
        //            chkBulkUpload.Visible = false;
        //            BulkUpload.Visible = false;
        //            chkBulkUpload.Checked = false;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //    }
        //}

        protected void ddlTransferTo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                //if (ddlAction.SelectedValue == "1")
                //{

                //}
                //else
                //{

                int     LoginClientID = Convert.ToInt32(Session["DistributorID"]);
                int     ClientID      = Convert.ToInt32(ddlTransferTo.SelectedValue);
                DataSet ds            = ssc.GetInventoryForAccept(ClientID, LoginClientID);

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            RepeaterTransfer.DataSource = ds.Tables[0];
                            RepeaterTransfer.DataBind();
                        }
                        else
                        {
                            fillblankGridForMobileSIM();
                        }
                        if (ds.Tables[1].Rows.Count > 0)
                        {
                            RepeaterTransferSIM.DataSource = ds.Tables[1];
                            RepeaterTransferSIM.DataBind();
                        }
                        else
                        {
                            fillblankGridForSIM();
                        }
                    }
                    else
                    {
                        fillblankGridForSIM();
                        fillblankGridForMobileSIM();
                    }
                }
                else
                {
                    fillblankGridForSIM();
                    fillblankGridForMobileSIM();
                }
                //}
            }
            catch (Exception ex)
            {
            }
        }
        protected void btnExportToExcel_Click(object sender, EventArgs e)
        {
            int LoginID       = Convert.ToInt32(Session["LoginId"]);
            int distributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);

            if (txtSimNumber.Text != "")
            {
                DataSet ds = ssc.GetReportSIMHistory(distributorID, ClientTypeID, LoginID, txtSimNumber.Text);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }

                //DataTable dtMain = new DataTable();
                if (ds != null)
                {
                    DataTable dt = ds.Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        DataView view = new DataView(dt);

                        DataTable dtExcel = view.ToTable("Selected", false, "SIMStatus", "MobileNumber", "SIMSerialNumber", "Plan", "CurrentDistributor", "TransferFrom", "TransferTo", "ActivationDate");//, "INTERNATIONAL_BUNDLE_CODE", "INTERNATIONAL_BUNDLE_AMOUNT"

                        if (dtExcel.Rows.Count > 0)
                        {
                            string filename = " SIMHistoryReport.xls";
                            System.IO.StringWriter       tw = new System.IO.StringWriter();
                            System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
                            GridView grdView = new GridView();
                            //dgGrid.HeaderStyle
                            grdView.DataSource = dtExcel;
                            grdView.DataBind();

                            ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                            //Get the HTML for the control.
                            grdView.RenderControl(hw);
                            //Write the HTML back to the browser.
                            //Response.ContentType = application/vnd.ms-excel;
                            Response.ContentType = "application/vnd.ms-excel";
                            Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
                            this.EnableViewState = false;
                            Response.Write(tw.ToString());
                            Response.End();

                            ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                        }
                    }
                }
            }
        }
        protected void btnGet_Click(object sender, EventArgs e)
        {
            int LoginID       = Convert.ToInt32(Session["LoginId"]);
            int distributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);

            if (txtSimNumber.Text != "")
            {
                DataSet ds = ssc.GetReportSIMHistory(distributorID, ClientTypeID, LoginID, txtSimNumber.Text);

                if (ds != null)
                {
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else
            {
                ShowPopUpMsg("Please Fill SIM/MOBILE number");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["LoginId"] != null)
                    {
                        BindDDL();
                        int LoginID       = Convert.ToInt32(Session["LoginId"]);
                        int distributorID = Convert.ToInt32(Session["DistributorID"]);
                        int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                        //DateTime FromDate = DateTime.Now;
                        //DateTime ToDate = DateTime.Now;


                        DateTime today = DateTime.Today;
                        int      numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);

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



                        DataSet ds = ssc.GetDistributorNotes(distributorID, ClientTypeID);

                        if (ds != null)
                        {
                            ViewState["SIMPurchase"]    = ds.Tables[0];
                            RepeaterTransfer.DataSource = ds.Tables[0];
                            RepeaterTransfer.DataBind();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemple #17
0
    private void LoadData(bool GenerateExcel)
    {
        //DEFAULT
        TextBoxTanggalAwal.Text  = ((DateTime)ViewState["TanggalAwal"]).ToString("d MMMM yyyy");
        TextBoxTanggalAkhir.Text = ((DateTime)ViewState["TanggalAkhir"]).ToString("d MMMM yyyy");

        using (DataClassesDatabaseDataContext db = new DataClassesDatabaseDataContext())
        {
            PenggunaLogin pengguna = (PenggunaLogin)Session["PenggunaLogin"];

            Laporan_Class Laporan_Class = new Laporan_Class(db, (PenggunaLogin)Session["PenggunaLogin"], (DateTime)ViewState["TanggalAwal"], (DateTime)ViewState["TanggalAkhir"], GenerateExcel);

            var Result = Laporan_Class.TransferProduk(TextBoxCariIDTransfer.Text, DropDownListCariTempatPengirimTransfer.SelectedValue.ToInt(), DropDownListCariPengirimTransfer.SelectedValue.ToInt(), DropDownListCariTempatPenerimaTransfer.SelectedValue.ToInt(), DropDownListCariPenerimaTransfer.SelectedValue.ToInt(), DropDownListCariStatusTransfer.SelectedValue.ToInt(), TextBoxCariKeteranganTransfer.Text);

            #region KONFIGURASI LAPORAN
            LabelPeriode.Text = Laporan_Class.Periode;

            LinkDownloadTransfer.Visible = GenerateExcel;

            if (LinkDownloadTransfer.Visible)
            {
                LinkDownloadTransfer.HRef = Laporan_Class.LinkDownload;
            }

            ButtonPrintTransfer.OnClientClick = "return popitup('ProdukPrint.aspx" + Laporan_Class.TempPencarian + "')";
            #endregion

            LabelTotalJumlahHeaderTransfer.Text = Result["Jumlah"];
            LabelTotalJumlahFooterTransfer.Text = LabelTotalJumlahHeaderTransfer.Text;

            LabelTotalGrandtotalHeaderTransfer.Text = Result["GrandTotalHargaJual"];
            LabelTotalGrandtotalFooterTransfer.Text = LabelTotalGrandtotalHeaderTransfer.Text;

            RepeaterTransfer.DataSource = Result["Data"];
            RepeaterTransfer.DataBind();
        }
    }
        protected void btnShow_Click(object sender, EventArgs e)
        {
            try
            {
                int DistributorID = Convert.ToInt32(Session["DistributorID"]);
                int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
                int LoginID       = Convert.ToInt32(Session["LoginId"]);


                int      distributorID = Convert.ToInt32(Session["DistributorID"]);
                DataSet  ds;
                DateTime FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                DateTime ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());


                if (ddlDistributor.SelectedValue == "0")
                {
                    ds = ssc.GetRequesrRechargeSIMReport(DistributorID, 1, LoginID, FromDate, ToDate, Convert.ToString(txtMobileNo.Text));//ssc.GetSaleReportForActivationAndPortIn(DistributorID, 1, FromDate, ToDate);
                }
                else
                {
                    ds = ssc.GetRequesrRechargeSIMReport(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate, Convert.ToString(txtMobileNo.Text));//ssc.GetSaleReportForActivationAndPortIn(Convert.ToInt32(ddlDistributor.SelectedValue), 0, FromDate, ToDate);
                }


                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            catch (Exception EX)
            {
                throw EX;
            }
        }
Exemple #19
0
        protected void btnGet_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            if (txtFromDate.Text.Trim() == "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;
                int distributorID = Convert.ToInt32(Session["DistributorID"]);
                //   DataSet ds1 = ssc.GetReportAcivationFail(distributorID, 1, LoginID, FromDate, ToDate);
                DataSet ds = ssc.GetReportAcivationFail(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetReportAcivationFail(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, LoginID, FromDate, ToDate);

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
            {
                FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());

                //DataSet ds = ssc.GetReportRechargeSIM(Convert.ToInt32(ddlDistributor.SelectedValue), 0, LoginID, FromDate, ToDate);
                DataSet ds;
                if (ddlDistributor.SelectedValue == "0")
                {
                    ds = ssc.GetReportAcivationFail(DistributorID, ClientTypeID, LoginID, FromDate, ToDate);//ssc.GetSaleReportForActivationAndPortIn(DistributorID, 1, FromDate, ToDate);
                }
                else
                {
                    ds = ssc.GetReportAcivationFail(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, LoginID, FromDate, ToDate);//ssc.GetSaleReportForActivationAndPortIn(Convert.ToInt32(ddlDistributor.SelectedValue), 0, FromDate, ToDate);
                }

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }

            ddlNetwork_SelectedIndexChanged(null, null);
        }
Exemple #20
0
        protected void btnExportToExcel_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
            ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());

            DataSet ds;

            if (ddlDistributor.SelectedValue == "0")
            {
                ds = ssc.GetReportInventoryStatus(DistributorID, ClientTypeID, LoginID, FromDate, ToDate);
            }
            else
            {
                ds = ssc.GetReportInventoryStatus(Convert.ToInt32(ddlDistributor.SelectedValue), ClientTypeID, LoginID, FromDate, ToDate);
            }

            //DataTable dtMain = new DataTable();
            if (ds != null)
            {
                DataTable dt = ds.Tables[0];

                if (ddlNetwork.SelectedIndex > 0)
                {
                    dt = (DataTable)ViewState["SIMPurchase"];
                    DataView dv = dt.DefaultView;
                    dv.RowFilter = "VendorID = " + Convert.ToInt32(ddlNetwork.SelectedValue);
                    dt           = dv.ToTable();
                }

                RepeaterTransfer.DataSource = dt;
                RepeaterTransfer.DataBind();

                if (dt.Rows.Count > 0)
                {
                    DataView view = new DataView(dt);

                    DataTable dtExcel = view.ToTable("Selected", false, "SIM_Status", "SIMSerialNumber", "MobileNumber", "Distributor", "InventoryStatus");//, "INTERNATIONAL_BUNDLE_CODE", "INTERNATIONAL_BUNDLE_AMOUNT"

                    if (dtExcel.Rows.Count > 0)
                    {
                        string filename = " InventoryStatusReport.xls";
                        System.IO.StringWriter       tw = new System.IO.StringWriter();
                        System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
                        GridView grdView = new GridView();
                        //dgGrid.HeaderStyle
                        grdView.DataSource = dtExcel;
                        grdView.DataBind();

                        ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                        //Get the HTML for the control.
                        grdView.RenderControl(hw);
                        //Write the HTML back to the browser.
                        //Response.ContentType = application/vnd.ms-excel;
                        Response.ContentType = "application/vnd.ms-excel";
                        Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
                        this.EnableViewState = false;
                        Response.Write(tw.ToString());
                        Response.End();

                        ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                    }
                }
            }
        }
Exemple #21
0
        protected void btnGet_Click(object sender, EventArgs e)
        {
            //string redirecturl = "";
            //redirecturl = 121212 + "," + 200 + "," + 300 + "," + "lYCA" + "," + 34343434 + "," + 343434;
            //Response.Redirect("~/RechargePrint.aspx?RechrgeSuccess=" + redirecturl);


            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            if (txtFromDate.Text.Trim() == "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetLoginHistory(FromDate, ToDate, Convert.ToInt32(ddlDistributor.SelectedValue));

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() == "")
            {
                FromDate = Convert.ToDateTime("1900-01-01");
                ToDate   = DateTime.Now;

                DataSet ds = ssc.GetLoginHistory(FromDate, ToDate, Convert.ToInt32(ddlDistributor.SelectedValue));

                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
            else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() != "")
            {
                FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
                ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());
                DataSet ds = new DataSet();
                if (ddlDistributor.SelectedValue == "0")
                {
                    ds = ssc.GetLoginHistory(FromDate, ToDate, DistributorID);
                }
                else
                {
                    ds = ssc.GetLoginHistory(FromDate, ToDate, Convert.ToInt32(ddlDistributor.SelectedValue));
                }
                if (ds != null)
                {
                    ViewState["SIMPurchase"]    = ds.Tables[0];
                    RepeaterTransfer.DataSource = ds.Tables[0];
                    RepeaterTransfer.DataBind();
                }
            }
        }
Exemple #22
0
        protected void btnExportToExcel_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);


            FromDate = Convert.ToDateTime(txtFromDate.Text.Trim());
            ToDate   = Convert.ToDateTime(txtToDate.Text.Trim());
            DataSet ds;

            if (ddlDistributor.SelectedValue == "0")
            {
                ds = ssc.GetLoginHistory(FromDate, ToDate, Convert.ToInt32(DistributorID));
            }
            else
            {
                ds = ssc.GetLoginHistory(FromDate, ToDate, Convert.ToInt32(ddlDistributor.SelectedValue));
            }

            if (ds != null)
            {
                DataTable dt = ds.Tables[0];
                RepeaterTransfer.DataSource = dt;
                RepeaterTransfer.DataBind();

                if (dt.Rows.Count > 0)
                {
                    DataView view = new DataView(dt);

                    DataTable dtExcel = view.ToTable("Selected", false, "Distributor", "UserName", "IpAddress1", "Browser", "Browser1", "Location", "LoginTime", "BrowserDetail");//, "INTERNATIONAL_BUNDLE_CODE", "INTERNATIONAL_BUNDLE_AMOUNT"

                    if (dtExcel.Rows.Count > 0)
                    {
                        string filename = "LoginHistoryReport.xls";
                        System.IO.StringWriter       tw = new System.IO.StringWriter();
                        System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
                        GridView grdView = new GridView();
                        //dgGrid.HeaderStyle
                        grdView.DataSource = dtExcel;
                        grdView.DataBind();

                        ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                        //Get the HTML for the control.
                        grdView.RenderControl(hw);
                        //Write the HTML back to the browser.
                        //Response.ContentType = application/vnd.ms-excel;
                        Response.ContentType = "application/vnd.ms-excel";
                        Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
                        this.EnableViewState = false;
                        Response.Write(tw.ToString());
                        Response.End();

                        ScriptManager.RegisterStartupScript(this, GetType(), "", "HideProgress();", true);
                    }
                }
            }
        }
        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)
            {
            }
        }
        protected void btnGet_Click(object sender, EventArgs e)
        {
            DateTime FromDate;
            DateTime ToDate;

            int DistributorID = Convert.ToInt32(Session["DistributorID"]);
            int ClientTypeID  = Convert.ToInt32(Session["ClientTypeID"]);
            int LoginID       = Convert.ToInt32(Session["LoginId"]);

            //if (txtFromDate.Text.Trim() == "" && txtToDate.Text.Trim() == "")
            //{
            //    FromDate = Convert.ToDateTime("1900-01-01");
            //    ToDate = DateTime.Now;

            //    DataSet ds = ssc.GetTopupPaymentDetailsService(Convert.ToInt32(ddlDistributor.SelectedValue), LoginID,0, FromDate, ToDate);

            //    if (ds != null)
            //    {
            //        RepeaterTransfer.DataSource = ds.Tables[0];
            //        RepeaterTransfer.DataBind();
            //    }

            //}
            //else if (txtFromDate.Text.Trim() != "" && txtToDate.Text.Trim() == "")
            //{
            //    FromDate = Convert.ToDateTime("1900-01-01");
            //    ToDate = DateTime.Now;

            //    DataSet ds = ssc.GetTopupPaymentDetailsService(Convert.ToInt32(ddlDistributor.SelectedValue), LoginID, 0, FromDate, ToDate);

            //    if (ds != null)
            //    {
            //        RepeaterTransfer.DataSource = ds.Tables[0];
            //        RepeaterTransfer.DataBind();
            //    }
            //}
            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"));
                DataSet ds = new DataSet();
                if (ddlDistributor.SelectedIndex == 0)
                {
                    ds = ssc.GetTopupPaymentDetailsService(Convert.ToInt32(DistributorID), LoginID, ClientTypeID, txtFromDate.Text.Trim(), txtToDate.Text.Trim());
                }
                else
                {
                    ds = ssc.GetTopupPaymentDetailsService(Convert.ToInt32(ddlDistributor.SelectedValue), LoginID, ClientTypeID, txtFromDate.Text.Trim(), txtToDate.Text.Trim());
                }
                //if (ds != null)
                //{
                ViewState["tblexcel"]       = ds.Tables[0];
                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;
                //    }
                //}
                //}
            }
        }