Esempio n. 1
0
        private void imbSave_ServerClick(object sender, EventArgs e)
        {
            EMailRouterPop3BoxSettings       ib   = EMailRouterPop3BoxSettings.Load(BoxId);
            DefaultEMailIncidentMappingBlock dimb = ib.DefaultEMailIncidentMappingBlock;

            dimb.DescriptionId = Convert.ToInt32(ddDescription.SelectedValue, CultureInfo.InvariantCulture);

            dimb.DefaultCreator = int.Parse(ddCreator.SelectedValue);
            dimb.ProjectId      = ucProject.ObjectId;
            dimb.IncidentBoxId  = int.Parse(ddIssBox.SelectedValue);
            dimb.PriorityId     = int.Parse(ddPriority.SelectedValue);
            dimb.TypeId         = int.Parse(ddType.SelectedValue);

            dimb.OrgUid     = PrimaryKeyId.Empty;
            dimb.ContactUid = PrimaryKeyId.Empty;
            if (ClientControl.ObjectType == OrganizationEntity.GetAssignedMetaClassName())
            {
                dimb.OrgUid = ClientControl.ObjectId;
            }
            else if (ClientControl.ObjectType == ContactEntity.GetAssignedMetaClassName())
            {
                dimb.ContactUid = ClientControl.ObjectId;
            }

            dimb.SeverityId = int.Parse(ddSeverity.SelectedValue);
            ArrayList alGen = new ArrayList();

            foreach (ListItem liItem in lbGenCats.Items)
            {
                if (liItem.Selected)
                {
                    alGen.Add(int.Parse(liItem.Value));
                }
            }
            ArrayList alIss = new ArrayList();

            foreach (ListItem liItem in lbIssCats.Items)
            {
                if (liItem.Selected)
                {
                    alIss.Add(int.Parse(liItem.Value));
                }
            }
            dimb.GeneralCategories  = alGen;
            dimb.IncidentCategories = alIss;
            EMailRouterPop3BoxSettings.Save(ib);
            Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(),
                                                    "<script language=javascript>" +
                                                    "try {window.opener.location.href=window.opener.location.href;}" +
                                                    "catch (e){} window.close();</script>");
        }
Esempio n. 2
0
        private void BindValues()
        {
            EMailRouterPop3BoxSettings       ib   = EMailRouterPop3BoxSettings.Load(BoxId);
            DefaultEMailIncidentMappingBlock dimb = ib.DefaultEMailIncidentMappingBlock;

            Util.CommonHelper.SafeSelect(ddCreator, dimb.DefaultCreator.ToString());
            ucProject.ObjectTypeId = (int)ObjectTypes.Project;
            ucProject.ObjectId     = dimb.ProjectId;
            Util.CommonHelper.SafeSelect(ddIssBox, dimb.IncidentBoxId.ToString());
            Util.CommonHelper.SafeSelect(ddPriority, dimb.PriorityId.ToString());
            Util.CommonHelper.SafeSelect(ddType, dimb.TypeId.ToString());
            Util.CommonHelper.SafeSelect(ddSeverity, dimb.SeverityId.ToString());
            foreach (int catid in dimb.GeneralCategories)
            {
                Util.CommonHelper.SafeMultipleSelect(lbGenCats, catid.ToString());
            }
            foreach (int catid in dimb.IncidentCategories)
            {
                Util.CommonHelper.SafeMultipleSelect(lbIssCats, catid.ToString());
            }
            if (dimb.OrgUid != PrimaryKeyId.Empty)
            {
                ClientControl.ObjectType = OrganizationEntity.GetAssignedMetaClassName();
                ClientControl.ObjectId   = dimb.OrgUid;
            }
            else if (dimb.ContactUid != PrimaryKeyId.Empty)
            {
                ClientControl.ObjectType = ContactEntity.GetAssignedMetaClassName();
                ClientControl.ObjectId   = dimb.ContactUid;
            }

            if (dimb.DescriptionId == 0)
            {
                ddDescription.SelectedIndex = 1;
            }
            else
            {
                ddDescription.SelectedIndex = 0;
            }

            //trClient.Visible = PortalConfig.CommonIncidentAllowEditClientField;
            //trPriority.Visible = PortalConfig.CommonIncidentAllowEditPriorityField;
            //trType.Visible = PortalConfig.IncidentAllowEditTypeField;
            //trSeverity.Visible = PortalConfig.IncidentAllowEditSeverityField;
            //trCategories.Visible = PortalConfig.CommonIncidentAllowEditGeneralCategoriesField;
            //trIssCategories.Visible = PortalConfig.IncidentAllowEditIncidentCategoriesField;
        }