Пример #1
0
        protected void DrpApplications_SelectedIndexChanged(object sender, EventArgs e)
        {
            localhost1.WebService1 obj = new localhost1.WebService1();
            DropDownList           drp = sender as DropDownList;

            if (drp != null)
            {
                int id = Convert.ToInt32(drp.SelectedItem.Value);
                int GridViewItemIndex = ((GridViewRow)drp.NamingContainer).RowIndex;


                //DropDownList Drpapptype = (DropDownList)RptAddefforts.Items[RepeaterItemIndex].FindControl("DrpApplicationType");
                DropDownList Drpapptype = (DropDownList)GridView1.FindControl("DropDownList4");
                //DropDownList Drpvendor = (DropDownList)RptAddefforts.Items[RepeaterItemIndex].FindControl("DrpVendor");
                if (Drpapptype != null)
                {
                    DataTable dtapplications = obj.BindCascadingDropList("applications", id);


                    if (dtapplications != null && dtapplications.Rows.Count > 0)
                    {
                        Drpapptype.SelectedIndex = Drpapptype.Items.IndexOf(Drpapptype.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppCat_id"])));
                        // Drpvendor.SelectedIndex = Drpvendor.Items.IndexOf(Drpvendor.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppVendor_Id"])));


                        Drpapptype.Enabled = false;
                        // Drpvendor.Enabled = false;
                    }
                }
            }
        }
Пример #2
0
        protected void DrpTicketType_SelectedIndexChanged(object sender, EventArgs e)
        {
            localhost1.WebService1 obj = new localhost1.WebService1();
            DropDownList           drp = sender as DropDownList;

            if (drp != null)
            {
                int id = Convert.ToInt32(drp.SelectedItem.Value);
                int GridViewItemIndex = ((GridViewRow)drp.NamingContainer).RowIndex;


                // DropDownList Drpclass = (DropDownList)GridView1.Items[RepeaterItemIndex].FindControl("DrpClassification");

                DropDownList Drpclass = (DropDownList)GridView1.FindControl("DropDownList2");

                if (Drpclass != null)
                {
                    DataTable DtClassfication = obj.BindCascadingDropList("classification", id);


                    if (DtClassfication != null && DtClassfication.Rows.Count > 0)
                    {
                        Drpclass.Items.Clear();
                        Drpclass.DataSource     = DtClassfication;
                        Drpclass.DataTextField  = "TClassification_Name";
                        Drpclass.DataValueField = "TClassification_Id";
                        Drpclass.DataBind();
                    }
                }
            }
        }
Пример #3
0
        private void bindpastdropdowndata(DropDownList drplist, int id)
        {
            localhost1.WebService1 obj = new localhost1.WebService1();

            if (drplist != null)
            {
                DataTable DtClassfication = obj.BindCascadingDropList("classification", id);


                if (DtClassfication != null && DtClassfication.Rows.Count > 0)
                {
                    drplist.Items.Clear();
                    drplist.DataSource     = DtClassfication;
                    drplist.DataTextField  = "TClassification_Name";
                    drplist.DataValueField = "TClassification_Id";
                    drplist.DataBind();
                }
            }
        }
Пример #4
0
        protected void TxtTicketNumber_Changed(object sender, EventArgs e)
        {
            try
            {
                TextBox tbticketnumber = ((TextBox)(sender));
                // localhost.WebService2 objService = new localhost.WebService2();


                DataTable DtTicketInfo = SearchTicketbyTicketNumber(tbticketnumber.Text);

                if (DtTicketInfo != null && DtTicketInfo.Rows.Count > 0)
                {
                    RepeaterItem Rptdata            = ((RepeaterItem)(tbticketnumber.NamingContainer));
                    Label        LblTicketcreatedon = (Label)Rptdata.FindControl("LblTicketcreatedon");
                    Label        LblDescription     = (Label)Rptdata.FindControl("LblDescription");
                    Label        LblTID             = (Label)Rptdata.FindControl("LblTID");
                    DropDownList DrpTicketType      = (DropDownList)Rptdata.FindControl("DrpTicketType");

                    DropDownList DrpApplication = (DropDownList)Rptdata.FindControl("DrpApplications");

                    DropDownList DrpClassification = (DropDownList)Rptdata.FindControl("DrpClassification");



                    // DropDownList DrpAppVendor = (DropDownList)Rptdata.FindControl("");
                    LblTicketcreatedon.Text      = Convert.ToString(DtTicketInfo.Rows[0]["TikcetCreatedOn"]);
                    LblDescription.Text          = Convert.ToString(DtTicketInfo.Rows[0]["TicketDescription"]);
                    LblTID.Text                  = Convert.ToString(DtTicketInfo.Rows[0]["TID"]);
                    DrpTicketType.SelectedIndex  = DrpTicketType.Items.IndexOf(DrpTicketType.Items.FindByValue(Convert.ToString(DtTicketInfo.Rows[0]["TicketType"])));
                    DrpApplication.SelectedIndex = DrpApplication.Items.IndexOf(DrpApplication.Items.FindByValue(Convert.ToString(DtTicketInfo.Rows[0]["TicketApplication"])));

                    bindpastdropdowndata(DrpClassification, Convert.ToInt32(DrpTicketType.SelectedItem.Value));
                    DropDownList Drpapptype = (DropDownList)Rptdata.FindControl("DrpApplicationType");
                    //DropDownList Drpvendor = (DropDownList)Rptdata.FindControl("DrpVendor");
                    if (Drpapptype != null)
                    {
                        DataTable dtapplications = obj.BindCascadingDropList("applications", Convert.ToInt32(DrpApplication.SelectedItem.Value));


                        if (dtapplications != null && dtapplications.Rows.Count > 0)
                        {
                            Drpapptype.SelectedIndex = Drpapptype.Items.IndexOf(Drpapptype.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppCat_id"])));
                            // Drpvendor.SelectedIndex = Drpvendor.Items.IndexOf(Drpvendor.Items.FindByValue(Convert.ToString(dtapplications.Rows[0]["AppVendor_Id"])));


                            Drpapptype.Enabled = false;
                            // Drpvendor.Enabled = false;

                            dtapplications.Dispose();
                        }
                    }


                    DtTicketInfo.Dispose();
                }
            }
            catch (Exception M)
            {
                throw;
            }
        }