public IssueTypeClassification AddIssueTypeClassification(int issueClassificationId, int issueTypeId)
        {
            using (var cee = new CmsEntities())
            {
                var issueTypeClassification = new IssueTypeClassification();

                issueTypeClassification.IssueClassificationId = issueClassificationId;
                issueTypeClassification.IssueTypeId = issueTypeId;

                cee.IssueTypeClassifications.Add(issueTypeClassification);
                cee.SaveChanges();

                return issueTypeClassification;
            }
        }
        private void OkButtonHander(object parameter)
        {
            if (AreAllValid())
            {
                var issueTypeClassification = new IssueTypeClassification
                {
                    Id = mIssueTypeClassificationId,
                    IssueClassificationId = SelectedClassification.Id,
                    IssueClassification = SelectedClassification,
                    IssueTypeId = mIssueTypeId,
                    Ordinal = mOrdinal
                };

                if (!mInEditMode)
                {
                    CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                    cmsWebServiceClient.AddIssueTypeClassificationAsync(SelectedClassification.Id, mIssueTypeId);
                    cmsWebServiceClient.AddIssueTypeClassificationCompleted +=
                        (s, e) =>
                        {
                            issueTypeClassification.Id = e.Result.Id;
                            View.IssueTypeClassification = issueTypeClassification;
                            View.DialogResult = true;
                        };
                }
                else
                {

                    CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
                    cmsWebServiceClient.UpdateIssueTypeClassificationAsync(issueTypeClassification);
                    cmsWebServiceClient.UpdateIssueTypeClassificationCompleted +=
                        (s, e) =>
                        {
                            View.IssueTypeClassification = issueTypeClassification;
                            View.DialogResult = true;
                        };
                }
            }
        }
        public void UpdateIssueTypeClassification(IssueTypeClassification issueTypeClassification)
        {
            using (var cee = new CmsEntities())
            {
                IssueTypeClassification existingObject = (from x in cee.IssueTypeClassifications
                                                          where x.Id == issueTypeClassification.Id
                                                          select x).FirstOrDefault();

                if (existingObject != null)
                {
                    existingObject.IssueClassificationId = issueTypeClassification.IssueClassificationId;
                    existingObject.IssueTypeId = issueTypeClassification.IssueTypeId;
                    existingObject.Ordinal = issueTypeClassification.Ordinal;
                }
                cee.SaveChanges();
            }
        }