//private ArrayList GetDummyData1()
        //{
        //    DataTable DTTeam = objCls.GetTeam();


        //    //if (DTTeam.Rows.Count >0 )
        //    //{
        //    //arr1.Add(new ListItem(Convert.ToString(DTTeam.Rows[0]["TeamName"]), "1"));
        //    //arr1.Add(new ListItem("Team-B", "2"));
        //    //arr1.Add(new ListItem("Team-C", "3"));
        //    //arr1.Add(new ListItem("Team-D", "4"));
        //    //arr1.Add(new ListItem("Team-E", "5"));
        //    //arr1.Add(new ListItem("Team-F", "6"));
        //    //}

        //    foreach (DataRow row in DTTeam.Rows)
        //    {
        //        //arr1.Add(new ListItem(row["TeamName"].ToString(), row["TeamID"].ToString()));
        //        dd2.Items.Add(new ListItem(row["TeamName"].ToString(), row["TeamID"].ToString()));
        //        dd2.Items.Add(item1);
        //    }


        //    return arr1;
        //}

        private void FillDropDownList2(DropDownList dd2)
        {
            //DataTable DTTeam = objCls.GetTeam();
            DataTable DTTeam = objBSS.GetTeamList();

            foreach (DataRow row in DTTeam.Rows)
            {
                //arr1.Add(new ListItem(row["TeamName"].ToString(), row["TeamID"].ToString()));
                dd2.Items.Add(new ListItem(row["TeamName"].ToString(), row["TeamID"].ToString()));
            }
        }
Пример #2
0
        private void LoadMyCombos(string click)
        {
            try
            {
                objBL.loadAssignedDepartment(cmbAssignedDepartment, "Follow");
                objBL.LoadComplainStatus(cmbComplainStatus, "Follow");
                cmbComplainStatus.SelectedValue = "4";


                if (Convert.ToInt32(Session["DeptID"]) == 15 | Convert.ToInt32(Session["DeptID"]) == 1)
                {
                    cmbAssignedDepartment.Enabled = true;
                }



                if (Convert.ToInt32(Session["DepartmentID"]).Equals(1) || Convert.ToInt32(Session["DepartmentID"]).Equals(58) || Convert.ToInt32(Session["DepartmentID"]).Equals(59) || Convert.ToInt32(Session["DepartmentID"]).Equals(60))
                {
                    pnlEscalation.Visible = true;
                    DataTable DTTeam = objBSS.GetTeamList();
                    cmbTeam.DataSource = DTTeam;

                    cmbTeam.DataTextField  = "TeamName";
                    cmbTeam.DataValueField = "TeamID";
                    //cmbTeam.Items.Insert(0, new DropDownList("Please Select", "0"));
                    cmbTeam.DataBind();


                    //DataTable DTPriority = objCls.GetPriority();
                    DataTable DTPriority = objBSS.GetTeamPrioirty();
                    cmbPriority.DataSource     = DTPriority;
                    cmbPriority.DataTextField  = "OMPriorityName";
                    cmbPriority.DataValueField = "OMPriorityID";
                    //cmbPriority.Items.Insert(0, new RadComboBoxItem("Please Select", "0"));
                    cmbPriority.DataBind();
                }
                else
                {
                    cmbTeam.SelectedValue     = "0";
                    cmbPriority.SelectedValue = "0";
                    pnlEscalation.Visible     = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void SetInitialRow()
        {
            int    SignupID = 0;
            int    City     = 0;
            int    node     = 0;
            string team     = "";

            if (txtSignUpID.Text != "")
            {
                SignupID = Convert.ToInt32(txtSignUpID.Text);
            }
            if (cmbCity.SelectedValue != "0")
            {
                City = Convert.ToInt32(cmbCity.SelectedValue);
            }
            if (cmbNode.SelectedValue != "0")
            {
                node = Convert.ToInt32(cmbNode.SelectedValue);
            }
            System.DateTime sysdate = DateTime.MinValue;
            DataTable       dt_SearchComplainCirciuits = objBSS.SearchComplainCircuits("", SignupID, "", "", "", "", 4, City, 0, "", 0, 0, 0, 0, sysdate, sysdate, 0, Convert.ToInt32(Session["DepartmentID"]), node, 0, "OM", 0, 0, 0, 0, 0);
            DataTable       DTTeam = objBSS.GetTeamList();

            GVTeam.DataSource = dt_SearchComplainCirciuits;
            GVTeam.DataBind();
            //Store the DataTable in ViewState for future reference
            ViewState["CurrentTable"] = dt_SearchComplainCirciuits;

            //Bind the Gridview
            GVTeam.DataSource = dt_SearchComplainCirciuits;
            GVTeam.DataBind();

            dtForExcel = new DataTable();
            dtForExcel = dt_SearchComplainCirciuits;


            //After binding the gridview, we can then extract and fill the DropDownList with Data
            for (int i = 0; i < dt_SearchComplainCirciuits.Rows.Count; i++)
            {
                DropDownList ddl1 = (DropDownList)GVTeam.Rows[i].Cells[1].FindControl("DropDownList1");
                DropDownList ddl2 = (DropDownList)GVTeam.Rows[i].Cells[2].FindControl("DropDownList2");


                FillDropDownList(ddl2);
                FillDropDownList2(ddl1);

                if (dt_SearchComplainCirciuits.Rows[i]["TeamName"].ToString() != "N/A")
                {
                    foreach (DataRow row in DTTeam.Rows)
                    {
                        if (row["TeamName"].ToString() == dt_SearchComplainCirciuits.Rows[i]["TeamName"].ToString())
                        {
                            team = row["TeamID"].ToString();
                        }
                    }

                    ddl1.SelectedValue = team;
                    ddl2.SelectedValue = dt_SearchComplainCirciuits.Rows[i]["Priority"].ToString();
                }
            }
        }