Beispiel #1
0
        public static void SubjectsUpdate(int SubjectID, string Name, string Description, string PhotoPath, string PhotoCaption, int ModifiedBy)
        {
            string oldFile = "";

            try
            {
                BINROTA.DAL.Subjects objSub = new BINROTA.DAL.Subjects();
                objSub.Load(SubjectID);
                oldFile             = objSub.PhotoPath;
                objSub.Name         = Name;
                objSub.Description  = Description;
                objSub.PhotoPath    = PhotoPath;
                objSub.PhotoCaption = PhotoCaption;
                objSub.ModifiedBy   = ModifiedBy;
                objSub.Save();
                if (System.IO.File.Exists(oldFile))
                {
                    System.IO.File.Delete(oldFile);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        public static void SubjectsCountryUpdate(int SubjectID, string Name, string Description, string PhotoPath, string PhotoCaption, int ModifiedBy, string Location, string Capital, string Area, string Neighbourhood, string Population, string Currency, string AreaCode, string TimeZoneCountry, string Language, string Religion, int NewParentSubjectID)
        {
            string oldFile = "";

            BINROTA.DAL.Subjects objSub = new BINROTA.DAL.Subjects();
            objSub.Load(SubjectID);
            try
            {
                if (objSub.PhotoPath != null)
                {
                    oldFile = objSub.PhotoPath;
                }
                else
                {
                    oldFile = "";
                }
            }
            catch (Exception)
            {
                oldFile = "";
            }

            BINROTA.DAL.Subjects.SubjectsCountryUpdate(SubjectID, Name, Description, PhotoPath, PhotoCaption, ModifiedBy, Location, Capital, Area, Neighbourhood, Population, Currency, AreaCode, TimeZoneCountry, Language, Religion, NewParentSubjectID);
            if (System.IO.File.Exists(oldFile))
            {
                System.IO.File.Delete(oldFile);
            }
        }
Beispiel #3
0
 public static void SubjectsUpdate(int SubjectID, string Name, string Description, string PhotoCaption, int ModifiedBy)
 {
     try
     {
         BINROTA.DAL.Subjects objSub = new BINROTA.DAL.Subjects();
         objSub.Load(SubjectID);
         objSub.Name         = Name;
         objSub.Description  = Description;
         objSub.PhotoCaption = PhotoCaption;
         objSub.ModifiedBy   = ModifiedBy;
         objSub.Save();
     }
     catch (Exception)
     {
         throw;
     }
 }