Пример #1
0
        internal static int UpdateClassification()
        {
            n = 0;
            try
            {
                daClassification = new TblClassificationTableAdapter();
                dtClassification = new DsLiveOutlook.TblClassificationDataTable();
                daClassification.FillByID(dtClassification, ClassificationInfo.ID, ClassificationInfo.AClass);

                drwClassification = dtClassification[0];

                drwClassification.BeginEdit();

                drwClassification.ID      = ClassificationInfo.NewID.Trim();
                drwClassification.Display = ClassificationInfo.Display.Trim();
                drwClassification.Value   = ClassificationInfo.Value;

                drwClassification.EndEdit();
                n = daClassification.Update(dtClassification);
                return(n);
            }
            catch (Exception ex)
            {
                Interactive.LInfoError(ex.Message, "Record was not saved !");
                return(n);
            }
        }
Пример #2
0
        internal static int AddClassification()
        {
            n = 0;
            try
            {
                daClassification = new TblClassificationTableAdapter();
                dtClassification = new DsLiveOutlook.TblClassificationDataTable();

                drwClassification = dtClassification.NewTblClassificationRow();

                drwClassification.ID      = ClassificationInfo.ID.Trim();
                drwClassification.Class   = ClassificationInfo.AClass.Trim();
                drwClassification.Display = ClassificationInfo.Display.Trim();
                drwClassification.Value   = ClassificationInfo.Value;

                dtClassification.AddTblClassificationRow(drwClassification);

                n = daClassification.Update(dtClassification);

                return(n);
            }
            catch (Exception ex)
            {
                Interactive.LInfoError(ex.Message, "Record was not saved !");
                return(n);
            }
        }