예제 #1
0
        public static bool Delete(PxObject obj, ref string message)
        {
            try
            {
                if (obj == null)
                {
                    return(true);
                }
                PxMetaModel.PcAxisMetabaseEntities context = new PxMetaModel.PcAxisMetabaseEntities();

                obj.DeleteEntities(context);
                context.SaveChanges();
            }
            catch (Exception ex)
            {
                //TODO chage the exception type to EF Exception and look for an inner exception.
                if (ex.InnerException == null)
                {
                    message = ex.Message;
                }
                else
                {
                    message = ex.InnerException.Message;
                }
                return(false);
            }
            return(true);
        }
예제 #2
0
 public void RemoveContentValueFootnote(PxObject context, PxFootnote footnote)
 {
     SelectedContent.ContentValueFootnotes.Remove((PxContentValueFootnote)footnote);
     if (!footnote.IsNew)
     {
         SelectedContent.RemovedContentValueFootnotes.Add((PxContentValueFootnote)footnote);
     }
 }
 public void RemoveTimeFootnote(PxObject context, PxFootnote footnote)
 {
     ((PxTime)lbTimePeriods.SelectedItem).TimeFootnotes.Remove((PxTimeFootnote)footnote);
     if (!footnote.IsNew)
     {
         ((PxTime)lbTimePeriods.SelectedItem).RemovedTimeFootnotes.Add((PxTimeFootnote)footnote);
     }
 }
 public void RemoveMainTableFootnote(PxObject context, PxFootnote footnote)
 {
     _table.Footnotes.Remove((PxMainTableFootnote)footnote);
     if (!footnote.IsNew)
     {
         _table.RemovedFootnotes.Add((PxMainTableFootnote)footnote);
         _table.MarkAsDirty();
     }
 }
예제 #5
0
 public void RemoveMainTableValueFootnote(PxObject context, PxFootnote footnote)
 {
     SelectedMainTable.MainTableValueFootnotes.Remove((PxMainTableValueFootnote)footnote);
     if (!footnote.IsNew)
     {
         SelectedMainTable.RemovedMainTableValueFootnotes.Add((PxMainTableValueFootnote)footnote);
         ((PxValueSet)lbValuesets.SelectedItem).MarkAsDirty();
     }
 }
 public void RemoveVariableFootnote(PxObject context, PxFootnote footnote)
 {
     ((PxVariable)lbVariables.SelectedItem).VariableFootnotes.Remove((PxVariableFootnote)footnote);
     if (!footnote.IsNew)
     {
         ((PxVariable)lbVariables.SelectedItem).RemovedVariableFootnotes.Add((PxVariableFootnote)footnote);
         ((PxVariable)lbVariables.SelectedItem).MarkAsDirty();
         _table.MarkAsDirty();
     }
 }
 public void RemoveContentFootnote(PxObject context, PxFootnote footnote)
 {
     ((PxContent)lbContents.SelectedItem).Footnotes.Remove((PxContentFootnote)footnote);
     if (!footnote.IsNew)
     {
         ((PxContent)lbContents.SelectedItem).RemovedFootnotes.Add((PxContentFootnote)footnote);
         ((PxContent)lbContents.SelectedItem).MarkAsDirty();
         _table.MarkAsDirty();
     }
 }
예제 #8
0
 public void RemoveValueFootnote(PxObject context, PxFootnote footnote)
 {
     SelectedValue.ValueFootnotes.Remove((PxValueFootnote)footnote);
     if (!footnote.IsNew)
     {
         SelectedValue.RemovedValueFootnotes.Add((PxValueFootnote)footnote);
         SelectedValue.MarkAsDirty();
         SelectedMainTable.MarkAsDirty();
     }
 }
        public PxTimeFootnote CreateTimeFootnote(PxObject context)
        {
            PxTimeFootnote tf = new PxTimeFootnote();

            tf.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            tf.FootnoteText        = "Shenim i ri";
            tf.FootnoteTextEnglish = "New Footnote";
            tf.MandOption          = "O";
            tf.ShowFootnote        = "B";
            tf.IsNew = true;
            ((PxTime)lbTimePeriods.SelectedItem).TimeFootnotes.Add(tf);
            return(tf);
        }
        public PxVariableFootnote CreateVariableFootnote(PxObject context)
        {
            PxVariableFootnote vf = new PxVariableFootnote();

            vf.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            vf.FootnoteText        = "Shenim i ri";
            vf.FootnoteTextEnglish = "New Footnote";
            vf.MandOption          = "O";
            vf.ShowFootnote        = "B";
            vf.IsNew = true;
            ((PxVariable)lbVariables.SelectedItem).VariableFootnotes.Add(vf);
            ((PxVariable)lbVariables.SelectedItem).MarkAsDirty();
            _table.MarkAsDirty();
            return(vf);
        }
        public PxFootnote CreateContentFootnote(PxObject context)
        {
            PxContentFootnote f = new PxContentFootnote();

            f.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            f.FootnoteText        = "Shenim i ri";
            f.FootnoteTextEnglish = "New Footnote";
            f.MandOption          = "O";
            f.ShowFootnote        = "B";
            f.IsNew = true;
            ((PxContent)lbContents.SelectedItem).Footnotes.Add(f);
            ((PxContent)lbContents.SelectedItem).MarkAsDirty();
            _table.MarkAsDirty();
            return(f);
        }
        public PxFootnote CreateMainTableFootnote(PxObject context)
        {
            PxMainTableFootnote f = new PxMainTableFootnote();

            f.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            f.FootnoteText        = "Shenim i ri";
            f.FootnoteTextEnglish = "New Footnote";
            f.MandOption          = "O";
            f.ShowFootnote        = "B";
            f.IsNew = true;

            _table.Footnotes.Add(f);
            _table.MarkAsDirty();
            return(f);
        }
예제 #13
0
        public PxMainTableValueFootnote CreateMainTableValueFootnote(PxObject context)
        {
            PxMainTableValueFootnote mtvf = new PxMainTableValueFootnote();

            mtvf.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            mtvf.FootnoteText        = "Shenim i ri";
            mtvf.FootnoteTextEnglish = "New Footnote";
            mtvf.MandOption          = "O";
            mtvf.ShowFootnote        = "B";
            mtvf.IsNew    = true;
            mtvf.Variable = SelectedVariable;
            mtvf.Value    = SelectedValue;
            SelectedMainTable.MainTableValueFootnotes.Add(mtvf);
            SelectedMainTable.MarkAsDirty();
            SelectedValue.MarkAsDirty();
            return(mtvf);
        }
예제 #14
0
        public PxContentValueFootnote CreateContentValueFootnote(PxObject context)
        {
            PxContentValueFootnote cvf = new PxContentValueFootnote();

            cvf.FootnoteNo = FootnoteNo;
            FootnoteNo++;
            cvf.FootnoteText        = "Shenim i ri";
            cvf.FootnoteTextEnglish = "New Footnote";
            cvf.MandOption          = "M";
            cvf.ShowFootnote        = "B";
            cvf.IsNew    = true;
            cvf.Variable = SelectedVariable;
            cvf.Value    = SelectedValue;
            SelectedContent.ContentValueFootnotes.Add(cvf);
            SelectedContent.MarkAsDirty();
            SelectedMainTable.MarkAsDirty();
            return(cvf);
        }
예제 #15
0
 public static bool Save(PxObject obj, ref string message)
 {
     try
     {
         PxMetaModel.PcAxisMetabaseEntities context = new PxMetaModel.PcAxisMetabaseEntities();
         obj.Save(context);
         context.SaveChanges();
         obj.MarkAsOld();
     }
     catch (Exception ex)
     {
         //TODO chage the exception type to EF Exception and look for an inner exception.
         if (string.IsNullOrEmpty(ex.InnerException.Message))
         {
             message = ex.Message;
         }
         else
         {
             message = ex.InnerException.Message;
         }
         return(false);
     }
     return(true);
 }