Ejemplo n.º 1
0
        protected void fillblankGridForSIM()
        {
            //SIMPurchase

            dtfillGridSIMPurchase = new DataTable();

            dtfillGridSIMPurchase.Columns.Add("SIMNo");
            dtfillGridSIMPurchase.Columns.Add("SIMID");



            //DataRow drSIM = dtfillGridSIMPurchase.NewRow();

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

            //    drSIM[i] = "";


            //}
            //dtfillGridSIMPurchase.Rows.Add(drSIM);
            //dtfillGridSIMPurchase.AcceptChanges();

            RepeaterTransferSIM.DataSource = dtfillGridSIMPurchase;
            RepeaterTransferSIM.DataBind();
        }
Ejemplo n.º 2
0
        //protected void rbSIM_MappedwithTariff_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ddlAction.SelectedValue == "1")
        //    {
        //        int ClientID = Convert.ToInt32(Session["DistributorID"]);
        //        string Action = "MappedTariff";
        //        DataSet ds = ssc.GetInventory(ClientID, Action);
        //        ViewState["SIMPurchase"] = ds.Tables[1];
        //        if (ds != null)
        //        {
        //            if (ds.Tables.Count > 0)
        //            {
        //                if (ds.Tables[0].Rows.Count > 0)
        //                {
        //                    RepeaterTransfer.DataSource = ds.Tables[0];
        //                    RepeaterTransfer.DataBind();
        //                    lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
        //                }
        //                else
        //                {
        //                    //RepeaterTransfer.DataSource = ds.Tables[0];
        //                    //RepeaterTransfer.DataBind();
        //                    fillblankGridForMobileSIM();
        //                }
        //                if (ds.Tables[1].Rows.Count > 0)
        //                {
        //                    RepeaterTransferSIM.DataSource = ds.Tables[1];
        //                    RepeaterTransferSIM.DataBind();
        //                    lblCount.Text = Convert.ToString(ds.Tables[1].Rows.Count);

        //                }
        //                else
        //                {
        //                    //RepeaterTransferSIM.DataSource = ds.Tables[1];
        //                    //RepeaterTransferSIM.DataBind();
        //                    fillblankGridForSIM();
        //                }
        //            }
        //            else
        //            {
        //                fillblankGridForSIM();
        //                fillblankGridForMobileSIM();
        //            }
        //        }
        //        else
        //        {
        //            fillblankGridForSIM();
        //            fillblankGridForMobileSIM();
        //        }
        //    }
        //    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();
        //                    lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
        //                }
        //                else
        //                {
        //                    fillblankGridForMobileSIM();
        //                }
        //                if (ds.Tables[1].Rows.Count > 0)
        //                {
        //                    RepeaterTransferSIM.DataSource = ds.Tables[1];
        //                    RepeaterTransferSIM.DataBind();
        //                    lblCount.Text = Convert.ToString(ds.Tables[1].Rows.Count);
        //                }
        //                else
        //                {
        //                    fillblankGridForSIM();
        //                }
        //            }
        //            else
        //            {
        //                fillblankGridForSIM();
        //                fillblankGridForMobileSIM();
        //            }
        //        }
        //        else
        //        {
        //            fillblankGridForSIM();
        //            fillblankGridForMobileSIM();
        //        }
        //    }
        //    ddlNetwork_SelectedIndexChanged(null, null);

        //}

        //protected void rbSIM_NotMappped_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ddlAction.SelectedValue == "1")
        //    {
        //        int ClientID = Convert.ToInt32(Session["DistributorID"]);
        //        string Action = "NotMappedTariff";
        //        DataSet ds = ssc.GetInventory(ClientID, Action);

        //        ViewState["SIMPurchase"] = ds.Tables[1];

        //        if (ds != null)
        //        {
        //            if (ds.Tables.Count > 0)
        //            {
        //                if (ds.Tables[0].Rows.Count > 0)
        //                {
        //                    RepeaterTransfer.DataSource = ds.Tables[0];
        //                    RepeaterTransfer.DataBind();
        //                    lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
        //                }
        //                else
        //                {
        //                    //RepeaterTransfer.DataSource = ds.Tables[0];
        //                    //RepeaterTransfer.DataBind();
        //                    fillblankGridForMobileSIM();
        //                }
        //                if (ds.Tables[1].Rows.Count > 0)
        //                {
        //                    RepeaterTransferSIM.DataSource = ds.Tables[1];
        //                    RepeaterTransferSIM.DataBind();
        //                    lblCount.Text = Convert.ToString(ds.Tables[1].Rows.Count);
        //                }
        //                else
        //                {
        //                    //RepeaterTransferSIM.DataSource = ds.Tables[1];
        //                    //RepeaterTransferSIM.DataBind();
        //                    fillblankGridForSIM();
        //                }
        //            }
        //            else
        //            {
        //                fillblankGridForSIM();
        //                fillblankGridForMobileSIM();
        //            }
        //        }
        //        else
        //        {
        //            fillblankGridForSIM();
        //            fillblankGridForMobileSIM();
        //        }
        //    }
        //    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();
        //                    lblCount.Text = Convert.ToString(ds.Tables[1].Rows.Count);
        //                }
        //                else
        //                {
        //                    fillblankGridForSIM();
        //                }
        //            }
        //            else
        //            {
        //                fillblankGridForSIM();
        //                fillblankGridForMobileSIM();
        //            }
        //        }
        //        else
        //        {
        //            fillblankGridForSIM();
        //            fillblankGridForMobileSIM();
        //        }
        //    }

        //    ddlNetwork_SelectedIndexChanged(null, null);

        //}

        protected void btnUploadFile_Click(object sender, EventArgs e)
        {
            ViewState["objDTSIM"] = null;


            FileUpload fuBulk = null;

            fuBulk = fuBulkUpload;
            UploadFile(fuBulk);

            int       ClientID = Convert.ToInt32(Session["DistributorID"]);
            DataTable dt       = (DataTable)ViewState["objDTSIM"];
            DataSet   ds       = ssc.GetInventoryBulkTransfer(ClientID, dt);

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

                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                    {
                        CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                        chk.Checked = true;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void ddlNetwork_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlNetwork.SelectedValue == "13")
                {
                    txtFromSim.Attributes.Remove("disabled");
                    txtTosim.Attributes.Remove("disabled");
                    txtFromSim.Style.Clear();
                    txtTosim.Style.Clear();
                    TxtSimNumb.Text      = "8919601";
                    TxtSimNumb.MaxLength = 19;
                }
                else if (ddlNetwork.SelectedValue == "15")
                {
                    txtFromSim.Attributes.Add("disabled", "disabled");
                    txtTosim.Attributes.Add("disabled", "disabled");
                    txtFromSim.Style.Add("background-color", "#d4d4d4");
                    txtTosim.Style.Add("background-color", "#d4d4d4");
                    txtFromSim.Style.Add("color", "white");
                    txtTosim.Style.Add("color", "white");
                    TxtSimNumb.Text      = "";
                    TxtSimNumb.MaxLength = 20;
                }

                RepeaterTransferSIM.DataSource = null;
                RepeaterTransferSIM.DataBind();
                lblCount.Text = "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
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)
            {
            }
        }
Ejemplo n.º 5
0
        protected void fillblankGridForSIM()
        {
            //SIMPurchase

            dtfillGridSIMPurchase = new DataTable();

            dtfillGridSIMPurchase.Columns.Add("SIMNo");
            dtfillGridSIMPurchase.Columns.Add("SIMID");
            RepeaterTransferSIM.DataSource = dtfillGridSIMPurchase;
            RepeaterTransferSIM.DataBind();
        }
Ejemplo n.º 6
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            int ClientID = Convert.ToInt32(Session["DistributorID"]);

            if ((TxtSimNumb.Text == "" || TxtSimNumb.Text == "8919601") && (txtFromSim.Text == "" || txtFromSim.Text == "8919601") && (txtTosim.Text == "" || txtTosim.Text == "8919601"))
            {
                RepeaterTransferSIM.DataSource = null;
                RepeaterTransferSIM.DataBind();
                lblCount.Text = "0";
                ShowPopUpMsg("This N0 sim available against these SIM Number");
            }

            else if ((TxtSimNumb.Text == "" || TxtSimNumb.Text == "8919601") && txtFromSim.Text != "" && txtTosim.Text != "")
            {
                DataSet   ds1 = ssc.GetInventory1(ClientID, "ALL", "", txtFromSim.Text, txtTosim.Text);
                DataTable dt1 = ds1.Tables[0];
                if (dt1.Rows.Count > 0)
                {
                    RepeaterTransferSIM.DataSource = dt1;
                    RepeaterTransferSIM.DataBind();
                    lblCount.Text = Convert.ToString(dt1.Rows.Count);
                    for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                    {
                        CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                        chk.Checked = true;
                    }
                }
            }
            else if (TxtSimNumb.Text != "" && (txtFromSim.Text == "" || txtFromSim.Text == "8919601") && (txtTosim.Text == "" || txtTosim.Text == "8919601"))
            {
                DataSet   ds = ssc.GetInventory1(ClientID, "ALL", TxtSimNumb.Text, "", "");
                DataTable dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    RepeaterTransferSIM.DataSource = dt;
                    RepeaterTransferSIM.DataBind();
                    lblCount.Text = Convert.ToString(dt.Rows.Count);
                    for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                    {
                        CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                        chk.Checked = true;
                    }
                }
            }
        }
Ejemplo n.º 7
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            int NetworkID = Convert.ToInt16(ddlNetwork.SelectedValue);

            if (rbSIM_NotMappped.Checked == true || rbSIM_MappedwithTariff.Checked == true)
            {
                DataSet ds       = new DataSet();
                string  Action   = "";
                int     ClientID = Convert.ToInt32(Session["DistributorID"]);
                if (rbSIM_NotMappped.Checked == true)
                {
                    Action = "NotMappedTariff";
                }

                else
                {
                    Action = "MappedTariff";
                }
                //ankit For Lyca AND H2O
                if (ddlNetwork.SelectedValue == "13")
                {
                    /////
                    if ((TxtSimNumb.Text == "" || TxtSimNumb.Text == "8919601") && (txtFromSim.Text == "" || txtFromSim.Text == "8919601") && (txtTosim.Text == "" || txtTosim.Text == "8919601"))
                    {
                        fillblankGridForSIM();
                        fillblankGridForMobileSIM();
                        lblCount.Text = "";
                        return;
                    }
                    /////
                    if (TxtSimNumb.Text != "" && (txtFromSim.Text == "" || txtFromSim.Text == "8919601") && (txtTosim.Text == "" || txtTosim.Text == "8919601"))
                    {
                        ds = ssc.FetchInventory(ClientID, Action, Convert.ToString(TxtSimNumb.Text), "", "", NetworkID);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            RepeaterTransferSIM.DataSource = ds.Tables[0];
                            RepeaterTransferSIM.DataBind();
                            lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
                            for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                            {
                                CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                                chk.Checked = true;
                            }
                        }

                        else
                        {
                            ShowPopUpMsg("This sim is not available in our inventory");
                        }
                    }

                    else if ((TxtSimNumb.Text == "" || TxtSimNumb.Text == "8919601") && txtFromSim.Text != "" && txtTosim.Text != "")
                    {
                        ds = ssc.FetchInventory(ClientID, Action, "", Convert.ToString(txtFromSim.Text), Convert.ToString(txtTosim.Text), NetworkID);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            RepeaterTransferSIM.DataSource = ds.Tables[0];
                            RepeaterTransferSIM.DataBind();
                            lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
                            for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                            {
                                CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                                chk.Checked = true;
                            }
                        }

                        else
                        {
                            ShowPopUpMsg("This sim is not available in our inventory");
                        }
                    }
                }

                else if (ddlNetwork.SelectedValue == "15")
                {
                    txtFromSim.Attributes.Add("disabled", "disabled");
                    txtTosim.Attributes.Add("disabled", "disabled");
                    string SimNumber = "";

                    if (TxtSimNumb.Text != "")
                    {
                        SimNumber = TxtSimNumb.Text.Trim();
                    }

                    ds = ssc.FetchInventory(ClientID, Action, "", "", SimNumber, NetworkID);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        RepeaterTransferSIM.DataSource = ds.Tables[0];
                        RepeaterTransferSIM.DataBind();
                        lblCount.Text = Convert.ToString(ds.Tables[0].Rows.Count);
                        for (int i = 0; i < RepeaterTransferSIM.Items.Count; i++)
                        {
                            CheckBox chk = (CheckBox)RepeaterTransferSIM.Items[i].FindControl("CheckBox2");
                            chk.Checked = true;
                        }
                    }

                    else
                    {
                        ShowPopUpMsg("This SIM is not available in our H2O inventory");
                    }
                }
            }
            else
            {
                ShowPopUpMsg("Please Select Transfer Blank SIM/ Transfer Preloaded SIM");
            }
        }