Example #1
0
        public void Load(DataTable dtItems, string id, ServiceCatalog p)
        {
            parent = p;

            //loadGroupData();
            //dgIcons.ItemsSource = dtGroups.DefaultView;
            serviceID = id;

            foreach (DataRow dr in dtItems.Rows)
            {
                if (dr["ServiceID"].ToString() == id)
                {
                    txtName.Text                  = dr["Name"].ToString();
                    txtDescription.Text           = dr["Description"].ToString();
                    txtLargeAreaDescription1.Text = dr["LargeAreaDescription"].ToString();
                }
            }
        }
        public void Load(DataTable dtGroups, DataTable dtIcons, string id, ServiceCatalog p)
        {
            //loadGroupData();
            catalogID           = id;
            dgIcons.ItemsSource = dtIcons.DefaultView;
            parent     = p;
            dtAllIcons = dtIcons;

            if (catalogID == "")
            {
                lblTitle.Text                = "Add Catalog";
                txtName.Text                 = "";
                txtButtonText.Text           = "";
                txtButtonTitle.Text          = "";
                txtPageDescription.Text      = "";
                txtLargeAreaDescription.Text = "";
                dgIcons.SelectedIndex        = -1;
            }

            foreach (DataRow dr in dtGroups.Rows)
            {
                if (dr["CatalogID"].ToString() == id)
                {
                    txtName.Text                 = dr["Name"].ToString();
                    txtButtonText.Text           = dr["ButtonText"].ToString();
                    txtButtonTitle.Text          = dr["ButtonTitle"].ToString();
                    txtPageDescription.Text      = dr["PageDescription"].ToString();
                    txtLargeAreaDescription.Text = dr["LargeAreaDescription"].ToString();

                    string icon = dr["ButtonIcon"].ToString();
                    int    i    = 0;
                    dgIcons.SelectedIndex = -1;
                    foreach (DataRow dri in dtIcons.Rows)
                    {
                        if (dri["Name"].ToString() == icon)
                        {
                            dgIcons.SelectedIndex = i;
                        }
                        i++;
                    }
                }
            }
        }
Example #3
0
        public void Load(DataTable dtTasks, RootObject sdCat, string id, ServiceCatalog p, string ServiceID)
        {
            txtMessage.Text = "";

            sdCategories = sdCat;
            taskID       = id;
            parent       = p;
            serviceID    = ServiceID;

            DataTable dtCategories = new DataTable();

            dtCategories.Columns.Add("Name");

            foreach (var cat in sdCategories.operation.Details)
            {
                dtCategories.Rows.Add(cat.NAME);
            }
            dgCat.ItemsSource = dtCategories.DefaultView;

            dgSubCat.ItemsSource = null;
            dgItem.ItemsSource   = null;
            dgSLA.ItemsSource    = parent.dtSLA.DefaultView;

            if (id != "")
            {
                lblTitle.Text = "Edit Task";
                foreach (DataRow dr in dtTasks.Rows)
                {
                    if (dr["TaskID"].ToString() == id)
                    {
                        txtName.Text    = dr["Name"].ToString();
                        rectBiz.Opacity = (dr["ForBusinessAssoc"].ToString() == "True") ? 1d : 0.2d;
                        rectOps.Opacity = (dr["ForOperationsAssoc"].ToString() == "True") ? 1d : 0.2d;
                        rectIT.Opacity  = (dr["ForITAssoc"].ToString() == "True") ? 1d : 0.2d;

                        string cat  = dr["ServiceDeskCategory"].ToString();
                        string sub  = dr["ServiceDeskSubCategory"].ToString();
                        string item = dr["ServiceDeskItem"].ToString();

                        txtDescription.Text = dr["Description"].ToString();

                        setDataGridByColumn(dgSLA, "ServiceLevelAgreementID", dr["ServiceLevelAgreementID"].ToString());

                        if (cat != "")
                        {
                            if (setDataGridToValue(dgCat, cat) == false)
                            {
                                txtMessage.Text = "Category \"" + cat + "\" is not in ServiceDesk";
                            }
                            else
                            {
                                fillSubcategories(cat);
                                if (sub != "")
                                {
                                    if (setDataGridToValue(dgSubCat, sub) == false)
                                    {
                                        txtMessage.Text = "Subcategory \"" + sub + "\" is not in ServiceDesk under category " + cat;
                                    }
                                    else
                                    {
                                        fillItmes(cat, sub);
                                        if (item != "")
                                        {
                                            if (setDataGridToValue(dgItem, item) == false)
                                            {
                                                txtMessage.Text = "Item \"" + item + "\" is not in ServiceDesk under category " + cat + " and subcategory " + sub;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            else
            {
                lblTitle.Text          = "Add Task";
                txtName.Text           = "";
                txtDescription.Text    = "";
                rectBiz.Opacity        = 1d;
                rectOps.Opacity        = 1d;
                rectIT.Opacity         = 1d;
                dgSLA.SelectedIndex    = -1;
                dgCat.SelectedIndex    = -1;
                dgSubCat.SelectedIndex = -1;
                dgItem.SelectedIndex   = -1;
            }


            //loadGroupData();
            //dgIcons.ItemsSource = dtGroups.DefaultView;

            //foreach (DataRow dr in dtGroups.Rows)
            //{
            //    if (dr["ID"].ToString() == id)
            //    {
            //        txtName.Text = dr["Name"].ToString();
            //        txtButtonText.Text = dr["ButtonText"].ToString();
            //        txtButtonTitle.Text = dr["ButtonTitle"].ToString();
            //    }
            //}
        }