Beispiel #1
0
        internal static int AddFacility()
        {
            n = 0;
            try
            {
                daFacility = new  TblFacilityTableAdapter();
                dtFacility = new DsLiveOutlook.TblFacilityDataTable();

                drwFacility = dtFacility.NewTblFacilityRow();

                drwFacility.Fcode    = FacilityInfo.FCode.Trim().ToUpper();
                drwFacility.Facility = FacilityInfo.FName.Trim().ToUpper();

                dtFacility.AddTblFacilityRow(drwFacility);

                n = daFacility.Update(dtFacility);

                return(n);
            }
            catch (Exception ex)
            {
                Interactive.LInfoError(ex.Message, "Record was not saved !");
                return(n);
            }
        }
Beispiel #2
0
        internal static int UpdateFacility()
        {
            n = 0;
            try
            {
                daFacility = new TblFacilityTableAdapter();
                dtFacility = new DsLiveOutlook.TblFacilityDataTable();
                daFacility.FillByID(dtFacility, FacilityInfo.FCode);

                drwFacility = dtFacility[0];

                drwFacility.BeginEdit();


                drwFacility.Fcode    = FacilityInfo.NewFCode.Trim().ToUpper();
                drwFacility.Facility = FacilityInfo.FName.Trim().ToUpper();

                drwFacility.EndEdit();

                n = daFacility.Update(dtFacility);

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