Example #1
0
        public static bool UpdateLastAddedYearClassRoomSchoolYearID(Guid SchoolYearId, Guid OldCurrentSchoolYearID, System.Data.Common.DbTransaction tran, DayCareDataContext dbold)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clClassRoom, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result = false;

            //declare trans variable
            // System.Data.Common.DbTransaction trans = null;
            DayCareDataContext db = dbold;

            db.Transaction = tran;
            ProgClassRoom DBProgClassRoom = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clClassRoom, "Update", "Debug Update Method", DayCarePL.Common.GUID_DEFAULT);

                var ClassRoomSchoolYear = (from pcr in db.ProgClassRooms
                                           join sp in db.SchoolPrograms on pcr.SchoolProgramId equals sp.Id
                                           where sp.SchoolYearId.Equals(SchoolYearId)
                                           select new
                {
                    pcrId = pcr.Id
                }).ToList();

                var cl = ClassRoomSchoolYear;
                for (int cnt = 0; cnt < cl.Count(); cnt++)
                {
                    DBProgClassRoom = db.ProgClassRooms.FirstOrDefault(pc => pc.Id.Equals(cl[cnt].pcrId));
                    if (DBProgClassRoom != null)
                    {
                        DBProgClassRoom.ClassRoomSchoolYearId = db.ClassRoomSchoolYears.FirstOrDefault(u => u.ClassRoomId.Value.Equals(DBProgClassRoom.ClassRoomId) && u.SchoolYearId.Value.Equals(SchoolYearId)).Id;
                        db.SubmitChanges();
                        DBProgClassRoom = null;
                    }
                }
            }
            catch
            {
                return(false);
            }
            return(true);
        }
        public static bool Save(DayCarePL.EnrollmentStatusProperties objEnrollment)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clEnrollmentStatus, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result           = false;
            DayCareDataContext db = new DayCareDataContext();
            EnrollmentStatus   DBEnrollmentStatus = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clEnrollmentStatus, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objEnrollment.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBEnrollmentStatus    = new EnrollmentStatus();
                    DBEnrollmentStatus.Id = System.Guid.NewGuid();
                }
                else
                {
                    DBEnrollmentStatus = db.EnrollmentStatus.SingleOrDefault(E => E.Id.Equals(objEnrollment.Id));
                }
                DBEnrollmentStatus.LastModifiedById     = objEnrollment.LastModifiedById;
                DBEnrollmentStatus.LastModifiedDatetime = DateTime.Now;
                DBEnrollmentStatus.SchoolId             = objEnrollment.SchoolId;
                DBEnrollmentStatus.Status               = objEnrollment.Status;
                DBEnrollmentStatus.Active               = objEnrollment.Active;
                DBEnrollmentStatus.Comments             = objEnrollment.Comments;
                DBEnrollmentStatus.LastModifiedById     = objEnrollment.LastModifiedById;
                DBEnrollmentStatus.LastModifiedDatetime = DateTime.Now;
                if (objEnrollment.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.EnrollmentStatus.InsertOnSubmit(DBEnrollmentStatus);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clEnrollmentStatus, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
        public static bool Save(DayCarePL.ClassCategoryProperties objClassCategory)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clClassCategory, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result           = false;
            DayCareDataContext db = new DayCareDataContext();
            ClassCategory      DBClassCategory = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clClassCategory, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objClassCategory.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBClassCategory    = new ClassCategory();
                    DBClassCategory.Id = System.Guid.NewGuid();
                }
                else
                {
                    DBClassCategory = db.ClassCategories.SingleOrDefault(C => C.Id.Equals(objClassCategory.Id));
                }
                DBClassCategory.LastModifiedById     = objClassCategory.LastModifiedById;
                DBClassCategory.LastModifiedDatetime = DateTime.Now;
                DBClassCategory.SchoolId             = objClassCategory.SchoolId;
                DBClassCategory.Name                 = objClassCategory.Name;
                DBClassCategory.Active               = objClassCategory.Active;
                DBClassCategory.Comments             = objClassCategory.Comments;
                DBClassCategory.LastModifiedById     = objClassCategory.LastModifiedById;
                DBClassCategory.LastModifiedDatetime = DateTime.Now;
                if (objClassCategory.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.ClassCategories.InsertOnSubmit(DBClassCategory);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clClassCategory, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #4
0
        public static bool CheckDuplicateSchoolYear(string SchoolYear, Guid SchoolYearId, Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchoolYear, "CheckDuplicateSchoolYear", "Execute CheckDuplicateSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            bool result           = false;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchoolYear, "CheckDuplicateSchoolYear", "Debug CheckDuplicateSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
                int count;

                if (SchoolYearId.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    count = (from s in db.SchoolYears
                             where s.Year.Equals(SchoolYear) &&
                             s.SchoolId.Equals(SchoolId)
                             select s).Count();
                }
                else
                {
                    count = (from s in db.SchoolYears
                             where s.Year.Equals(SchoolYear) &&
                             s.SchoolId.Equals(SchoolId) && !s.Id.Equals(SchoolYearId)
                             select s).Count();
                }
                if (count > 0)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchoolYear, "CheckDuplicateSchoolYear", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #5
0
        public static bool Save(DayCarePL.UserGroupProperties objUserGroup)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clUserGroup, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result                    = false;
            DayCareDataContext db          = new DayCareDataContext();
            UserGroup          DBUserGroup = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clUserGroup, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objUserGroup.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBUserGroup    = new UserGroup();
                    DBUserGroup.Id = System.Guid.NewGuid();
                }
                else
                {
                    DBUserGroup = db.UserGroups.SingleOrDefault(U => U.Id.Equals(objUserGroup.Id));
                }
                DBUserGroup.LastModifiedById     = objUserGroup.LastModifiedById;
                DBUserGroup.LastModifiedDatetime = DateTime.Now;
                DBUserGroup.SchoolId             = objUserGroup.SchoolId;
                DBUserGroup.GroupTitle           = objUserGroup.GroupTitle;
                DBUserGroup.RoleId               = objUserGroup.RoleId;
                DBUserGroup.Comments             = objUserGroup.Comments;
                DBUserGroup.LastModifiedById     = objUserGroup.LastModifiedById;
                DBUserGroup.LastModifiedDatetime = DateTime.Now;
                if (objUserGroup.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.UserGroups.InsertOnSubmit(DBUserGroup);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clUserGroup, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #6
0
        public static bool CheckDuplicateRelationshipName(string RelationshipName, Guid RelationshipId, Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clRelationship, "CheckDuplicateRelationshipName", "Execute CheckDuplicateRelationshipName Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            bool result           = false;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clRelationship, "CheckDuplicateRelationshipName", "Debug CheckDuplicateRelationshipName Method", DayCarePL.Common.GUID_DEFAULT);
                int count;

                if (RelationshipId.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    count = (from r in db.Relationships
                             where r.Name.Equals(RelationshipName) &&
                             r.SchoolId.Equals(SchoolId)
                             select r).Count();
                }
                else
                {
                    count = (from r in db.Relationships
                             where r.Name.Equals(RelationshipName) &&
                             r.SchoolId.Equals(SchoolId) && !r.Id.Equals(RelationshipId)
                             select r).Count();
                }
                if (count > 0)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clRelationship, "CheckDuplicateRelationshipName", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #7
0
        public static decimal GetFees(Guid SchoolProgramId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clChildProgEnrollment, "GetFees", "Execute LoadChildProgEnrollment Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clChildProgEnrollment, "GetFees", "Debug GetFees Method", DayCarePL.Common.GUID_DEFAULT);
                //var data = (from c in db.SchoolPrograms
                //            where c.Id.Equals(SchoolProgramId)
                //            select c.Fees).SingleOrDefault();
                return(0);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChildProgEnrollment, "GetFees", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(0);
            }
        }
Example #8
0
        public static decimal GetLateFeeAmount(Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchool, "LoadSchoolInfo", "LoadSchoolInfo method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchool, "LoadSchoolInfo", "Debug LoadSchoolInfo called", DayCarePL.Common.GUID_DEFAULT);
                var LateFeeAmount = (from s in db.Schools
                                     where s.Id.Equals(SchoolId)
                                     select s.LateFeeAmount.HasValue == true ? s.LateFeeAmount.Value : 0).FirstOrDefault();
                return(LateFeeAmount);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchool, "LoadSchoolInfo", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(0);
            }
        }
Example #9
0
        public static bool Save(DayCarePL.HoursOfOperationProperties objHoursOfOperation)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clHoursOfOperation, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            HoursOfOperation   DBHourOfOeration = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clHoursOfOperation, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objHoursOfOperation.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBHourOfOeration    = new HoursOfOperation();
                    DBHourOfOeration.Id = Guid.NewGuid();
                }
                else
                {
                    DBHourOfOeration = db.HoursOfOperations.SingleOrDefault(id => id.Id.Equals(objHoursOfOperation.Id));
                }
                DBHourOfOeration.LastModifiedById     = objHoursOfOperation.LastModifiedById;
                DBHourOfOeration.LastModifiedDatetime = DateTime.Now;
                DBHourOfOeration.Day       = objHoursOfOperation.Day;
                DBHourOfOeration.DayIndex  = objHoursOfOperation.DayIndex;
                DBHourOfOeration.OpenTime  = objHoursOfOperation.OpenTime;
                DBHourOfOeration.CloseTime = objHoursOfOperation.CloseTime;
                DBHourOfOeration.Comments  = objHoursOfOperation.Comments;
                DBHourOfOeration.SchoolId  = objHoursOfOperation.SchoolId;

                if (objHoursOfOperation.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.HoursOfOperations.InsertOnSubmit(DBHourOfOeration);
                }
                db.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clHoursOfOperation, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(false);
            }
        }
Example #10
0
        public static bool Save(DayCarePL.AdditionalNotesProperties objNotes)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clAbsentReason, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result           = false;
            DayCareDataContext db = new DayCareDataContext();
            AdditionalNote     DBAdditionalNote = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clAbsentReason, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objNotes.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBAdditionalNote                 = new AdditionalNote();
                    DBAdditionalNote.Id              = System.Guid.NewGuid();
                    DBAdditionalNote.CreatedById     = objNotes.CreatedById;
                    DBAdditionalNote.CreatedDateTime = DateTime.Now;
                }
                else
                {
                    DBAdditionalNote = db.AdditionalNotes.SingleOrDefault(A => A.Id.Equals(objNotes.Id));
                }
                DBAdditionalNote.ChildSchoolYearId    = objNotes.ChildSchoolYearId;
                DBAdditionalNote.CommentDate          = objNotes.CommentDate;
                DBAdditionalNote.Comments             = objNotes.Comments;
                DBAdditionalNote.LastModifiedById     = objNotes.LastModifiedById;
                DBAdditionalNote.LastMidifiedDateTime = DateTime.Now;
                if (objNotes.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.AdditionalNotes.InsertOnSubmit(DBAdditionalNote);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clAbsentReason, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #11
0
        public static List <DayCarePL.SchoolYearProperties> LoadSchoolYear(Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", "Execute LoadSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", "Debug LoadSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);

                var SchoolYearData = (from sy in db.SchoolYears
                                      join s in db.Schools on sy.SchoolId equals s.Id into schoolname
                                      from scnm in schoolname.DefaultIfEmpty()
                                      where sy.SchoolId.Equals(SchoolId)
                                      orderby sy.Year descending
                                      select new DayCarePL.SchoolYearProperties()
                {
                    Id = sy.Id,
                    SchoolId = sy.SchoolId,
                    SchoolName = scnm.Name,
                    Year = sy.Year,
                    StartDate = sy.StartDate,
                    EndDate = sy.EndDate,
                    CurrentId = sy.CurrentId,
                    Comments = sy.Comments,
                    CreatedById = sy.CreatedById,
                    CreatedDateTime = sy.CreatedDateTime,
                    LastModifiedById = sy.LastModifiedById,
                    LastModifiedDatetime = sy.LastModifiedDatetime
                }).ToList();



                return(SchoolYearData);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #12
0
        public static bool Save(DayCarePL.ChargeCodeProperties objChargesCode)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clChargeCode, "Save", "Save method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db           = new DayCareDataContext();
            ChargeCode         DBChargeCode = null;
            bool result = false;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clChargeCode, "Save", "Debug Save called", DayCarePL.Common.GUID_DEFAULT);
                if (objChargesCode.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBChargeCode    = new ChargeCode();
                    DBChargeCode.Id = Guid.NewGuid();
                    DBChargeCode.CreatedDateTime = DateTime.Now;
                    DBChargeCode.CreatedById     = objChargesCode.CreatedById;
                }
                else
                {
                    DBChargeCode = db.ChargeCodes.SingleOrDefault(cc => cc.Id.Equals(objChargesCode.Id));
                }
                DBChargeCode.LastModifiedDatetime = DateTime.Now;
                DBChargeCode.LastModifiedById     = objChargesCode.LastModifiedById;
                DBChargeCode.Name       = objChargesCode.Name;
                DBChargeCode.Category   = objChargesCode.Category;
                DBChargeCode.DebitCrdit = objChargesCode.DebitCrdit;
                if (objChargesCode.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.ChargeCodes.InsertOnSubmit(DBChargeCode);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChargeCode, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #13
0
        public static bool Save(DayCarePL.RelationshipProperties objRelationship)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clRelationship, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();

            DayCareDataContext db             = new DayCareDataContext();
            Relationship       DBRelationship = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clRelationship, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);

                if (objRelationship.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBRelationship    = new Relationship();
                    DBRelationship.Id = System.Guid.NewGuid();
                }
                else
                {
                    DBRelationship = db.Relationships.SingleOrDefault(u => u.Id.Equals(objRelationship.Id));
                }
                DBRelationship.Name                 = objRelationship.Name;
                DBRelationship.SchoolId             = objRelationship.SchoolId;
                DBRelationship.Active               = objRelationship.Active;
                DBRelationship.Comments             = objRelationship.Comments;
                DBRelationship.LastModifiedById     = objRelationship.LastModifiedById;
                DBRelationship.LastModifiedDatetime = DateTime.Now;

                if (objRelationship.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.Relationships.InsertOnSubmit(DBRelationship);
                }
                db.SubmitChanges();
                return(true);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clRelationship, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(false);
            }
        }
Example #14
0
        public static System.Nullable <DateTime> GetLastTransactionDate(Guid?SchoolYearId, Guid?ChildFamilyId, Guid?ChildDataId, Guid?SchoolProgramId)
        {
            //DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clLedger, "GetLastTransactionDate", "GetLastTransactionDate method called", DayCarePL.Common.GUID_DEFAULT);
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                // DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clLedger, "GetLastTransactionDate", "Debug GetLastTransactionDate called", DayCarePL.Common.GUID_DEFAULT);
                DateTime date = (from l in db.Ledgers
                                 where l.SchoolYearId.Equals(SchoolYearId) && l.ChildFamilyId.Equals(ChildFamilyId) &&
                                 l.ChildDataId.Equals(ChildDataId) && l.SchoolProgramId.Equals(SchoolProgramId)
                                 orderby l.TransactionDate descending
                                 select l.TransactionDate).FirstOrDefault();
                return(date);
            }
            catch (Exception ex)
            {
                // DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clLedger, "GetLastTransactionDate", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #15
0
        public static bool Save(DayCarePL.FeesPeriodProperties objFeesPeriod)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clFeesPeriod, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result                     = false;
            DayCareDataContext db           = new DayCareDataContext();
            FeesPeriod         DBFeesPeriod = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clFeesPeriod, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objFeesPeriod.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBFeesPeriod    = new FeesPeriod();
                    DBFeesPeriod.Id = System.Guid.NewGuid();
                    DBFeesPeriod.CreatedDateTime = DateTime.Now;
                    DBFeesPeriod.CreatedById     = objFeesPeriod.CreatedById;
                }
                else
                {
                    DBFeesPeriod = db.FeesPeriods.SingleOrDefault(F => F.Id.Equals(objFeesPeriod.Id));
                }
                DBFeesPeriod.LastModifiedById     = objFeesPeriod.LastModifiedById;
                DBFeesPeriod.LastModifiedDatetime = DateTime.Now;
                DBFeesPeriod.Name   = objFeesPeriod.Name;
                DBFeesPeriod.Active = objFeesPeriod.Active;
                if (objFeesPeriod.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.FeesPeriods.InsertOnSubmit(DBFeesPeriod);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clFeesPeriod, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
        public static DataSet LoadAttendanceHistory1(string SearchText, string SearchStr, Guid SchoolYear)
        {
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            DataSet            ds = new DataSet();

            try
            {
                SortedList sl = new SortedList();
                sl.Add("@SearchText", SearchText);
                sl.Add("@SearchStr", SearchStr);
                sl.Add("@SchoolYearId", SchoolYear);
                ds = clConnection.GetDataSet("spRptStaffAttendanceHistory", sl);
                if (ds != null && ds.Tables.Count > 0)
                {
                }
            }
            catch (Exception ex)
            {
            }
            return(ds);
        }
Example #17
0
        public static bool ISStaffinCurrentYear(Guid StaffId, Guid SchoolId, Guid SchoolYearId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clStaff, "LoadStaffDetailsByUserNameAndPassword", "Execute LoadStaffDetailsByUserNameAndPassword Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            bool result;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clStaff, "ISStaffinCurrentYear", "ISStaffinCurrentYear function debug", DayCarePL.Common.GUID_DEFAULT);

                //string CurrentSchoolYearId = (from csy in db.SchoolYears
                //                              where csy.SchoolId.Equals(SchoolId)
                //                              && csy.CurrentId.Equals(true)
                //                              select csy.Id == null ? "" : csy.Id.ToString()).FirstOrDefault();
                string StaffSchoolYearId = "";
                //if (CurrentSchoolYearId.Length > 0)
                //{
                StaffSchoolYearId = (from ssy in db.StaffSchoolYears
                                     where ssy.SchoolYearId.ToString().Equals(SchoolYearId) &&
                                     ssy.StaffId.Equals(StaffId)
                                     select ssy.Id.ToString()).FirstOrDefault();
                //}

                if (StaffSchoolYearId != null && StaffSchoolYearId.Length > 1)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }
Example #18
0
        public static Guid GetSchoolIdbySchoolYearId(Guid SchoolYearId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchool, "GetSchoolIdbySchoolYearId", "GetSchoolIdbySchoolYearId method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchool, "GetSchoolIdbySchoolYearId", "Debug GetSchoolIdbySchoolYearId called", DayCarePL.Common.GUID_DEFAULT);
                Guid objSchool;

                objSchool = (from s in db.SchoolYears
                             where s.Id.Equals(SchoolYearId)
                             select s.SchoolId).FirstOrDefault();
                return(objSchool);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchool, "GetSchoolIdbySchoolYearId", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(new Guid());
            }
        }
        public static bool CheckDuplicateEffectiveWeekDay(Guid SchoolProgramFeesDetailId, Guid FeesPeriodId, Guid SchoolProgramId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchoolProgram, "CheckDuplicateEffectiveWeekDay", "Execute CheckDuplicateEffectiveWeekDay Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            bool result           = false;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchoolProgram, "CheckDuplicateEffectiveWeekDay", "Debug CheckDuplicateEffectiveWeekDay Method", DayCarePL.Common.GUID_DEFAULT);
                int count = 0;
                if (SchoolProgramFeesDetailId.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    count = (from s in db.SchoolProgramFeesDetails
                             where s.FeesPeriodId.Equals(FeesPeriodId) && s.SchoolProgramId.Equals(SchoolProgramId) && !s.Id.Equals(SchoolProgramFeesDetailId)
                             select s).Count();
                }
                else
                {
                    count = (from s in db.SchoolProgramFeesDetails
                             where s.FeesPeriodId.Equals(FeesPeriodId) && s.SchoolProgramId.Equals(SchoolProgramId) && !s.Id.Equals(SchoolProgramFeesDetailId)
                             select s).Count();
                }
                if (count > 0)
                {
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clRelationship, "CheckDuplicateRelationshipName", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
Example #20
0
        public static bool ExportStafftoStaffSchoolYear(Guid StaffId, Guid SchoolId, Guid SchoolYearId, bool Active, System.Data.Common.DbTransaction tran, DayCareDataContext dbold)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clStaffSchoolYear, "ExportStafftoStaffSchoolYear", "Execute ExportStafftoStaffSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();

            DayCareDataContext db = dbold;

            db.Transaction = tran;
            StaffSchoolYear DBStaffSchoolYear = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clStaffSchoolYear, "ExportStafftoStaffSchoolYear", "Debug ExportStafftoStaffSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
                //Guid SchoolYearId = (from sy in db.SchoolYears
                //                     where sy.CurrentId.Equals(true) && sy.SchoolId.Equals(SchoolId)
                //                     select sy.Id).SingleOrDefault();

                int staffcount = (from ssy in db.StaffSchoolYears
                                  where ssy.SchoolYearId.Equals(SchoolYearId) && ssy.StaffId.Equals(StaffId)
                                  select ssy.Id).Count();

                if (staffcount == 0)
                {
                    DBStaffSchoolYear              = new StaffSchoolYear();
                    DBStaffSchoolYear.Id           = Guid.NewGuid();
                    DBStaffSchoolYear.StaffId      = StaffId;
                    DBStaffSchoolYear.SchoolYearId = SchoolYearId;
                    DBStaffSchoolYear.active       = Active;
                    db.StaffSchoolYears.InsertOnSubmit(DBStaffSchoolYear);
                    db.SubmitChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clStaffSchoolYear, "ExportStafftoStaffSchoolYear", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(false);
            }
        }
        public static bool Save(DayCarePL.StaffAttendenceHistoryProperties objStaffAttendance)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clAbsentReason, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result = false;
            DayCareDataContext     db = new DayCareDataContext();
            StaffAttendenceHistory DBStaffAttendance = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clAbsentReason, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objStaffAttendance.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBStaffAttendance    = new StaffAttendenceHistory();
                    DBStaffAttendance.Id = System.Guid.NewGuid();
                    DBStaffAttendance.CreatedDateTime = DateTime.Now;
                }
                else
                {
                    DBStaffAttendance = db.StaffAttendenceHistories.SingleOrDefault(A => A.Id.Equals(objStaffAttendance.Id));
                }
                DBStaffAttendance.StaffSchoolYearId       = objStaffAttendance.StaffSchoolYearId;
                DBStaffAttendance.CheckInCheckOutDateTime = objStaffAttendance.CheckInCheckOutDateTime;
                DBStaffAttendance.CheckInCheckOut         = objStaffAttendance.CheckInCheckOut;
                if (objStaffAttendance.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.StaffAttendenceHistories.InsertOnSubmit(DBStaffAttendance);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clAbsentReason, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
        public static List <DayCarePL.SchoolProgramFeesDetailProperties> LoadSchoolProgramFeesDetail(Guid SchoolProgramId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clChildProgEnrollment, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            List <DayCarePL.SchoolProgramFeesDetailProperties> lstSchoolProgramFeesDetail = new List <DayCarePL.SchoolProgramFeesDetailProperties>();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clChildProgEnrollment, "LoadChildFamily", "Debug LoadChildFamily Method", DayCarePL.Common.GUID_DEFAULT);
                DayCarePL.SchoolProgramFeesDetailProperties objSchoolProgramFeesDetail = null;
                var data = db.spGetSchoolProgramFeesDetail(SchoolProgramId);
                foreach (var d in data)
                {
                    objSchoolProgramFeesDetail = new DayCarePL.SchoolProgramFeesDetailProperties();
                    objSchoolProgramFeesDetail.SchoolProgram   = d.ProgramTitle;
                    objSchoolProgramFeesDetail.FeesPeriod      = d.Name;
                    objSchoolProgramFeesDetail.SchoolProgramId = d.SchoolProgramId;
                    objSchoolProgramFeesDetail.FeesPeriodId    = d.FeesPeriodId;
                    objSchoolProgramFeesDetail.Id   = d.Id;
                    objSchoolProgramFeesDetail.Fees = d.Fees;
                    // objSchoolProgramFeesDetail.LateFeesCharge = d.LateFeesCharge;
                    objSchoolProgramFeesDetail.EffectiveWeekDay  = Convert.ToInt32(d.EffectiveWeekDay == null ? null : d.EffectiveWeekDay);
                    objSchoolProgramFeesDetail.EffectiveMonthDay = Convert.ToInt32(d.EffectiveMonthDay == null ? null : d.EffectiveMonthDay);
                    if (d.EffectiveYearDate != null)
                    {
                        objSchoolProgramFeesDetail.EffectiveYearDate = d.EffectiveYearDate.Value;
                    }
                    lstSchoolProgramFeesDetail.Add(objSchoolProgramFeesDetail);
                }
                return(lstSchoolProgramFeesDetail);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChildProgEnrollment, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #23
0
        public static bool Save(DayCarePL.FontProperties objFont)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clFont, "Save", "Execute Save Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            bool result           = false;
            DayCareDataContext db = new DayCareDataContext();
            Font DBFont           = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clFont, "Save", "Debug Save Method", DayCarePL.Common.GUID_DEFAULT);
                if (objFont.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    DBFont    = new Font();
                    DBFont.Id = System.Guid.NewGuid();
                }
                else
                {
                    DBFont = db.Fonts.SingleOrDefault(F => F.Id.Equals(objFont.Id));
                }
                DBFont.Name   = objFont.Name;
                DBFont.Color  = objFont.Color;
                DBFont.Size   = objFont.Size;
                DBFont.Active = objFont.Active;
                if (objFont.Id.ToString().Equals(DayCarePL.Common.GUID_DEFAULT))
                {
                    db.Fonts.InsertOnSubmit(DBFont);
                }
                db.SubmitChanges();
                result = true;
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clFont, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                result = false;
            }
            return(result);
        }
        public static DayCarePL.LedgerProperties GetLastUpdateLedgerDate()
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clLedgerOfFamily, "LoadChildFamilyWiseTranDateAmount", "Execute LoadChildFamilyWiseTranDateAmount Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clLedgerOfFamily, "LoadChildFamilyWiseTranDateAmount", "Debug LoadChildFamilyWiseTranDateAmount Method", DayCarePL.Common.GUID_DEFAULT);
                DayCarePL.LedgerProperties data = (from l in db.Ledgers
                                                   orderby l.LastModifiedDatetime descending
                                                   select new DayCarePL.LedgerProperties()
                {
                    LastModifiedDatetime = l.LastModifiedDatetime.Value
                }).FirstOrDefault();
                return(data);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clLedgerOfFamily, "LoadChildFamilyWiseTranDateAmount", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #25
0
        public static Guid GetOldCurrentSchoolYearId(Guid SchoolId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchoolYear, "GetOldCurrentSchoolYearId", "Execute GetOldCurrentSchoolYearId Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchoolYear, "GetOldCurrentSchoolYearId", "Debug GetOldCurrentSchoolYearId Method", DayCarePL.Common.GUID_DEFAULT);
                var SchoolYearData = (from sy in db.SchoolYears
                                      where sy.SchoolId.Equals(SchoolId) && sy.CurrentId.Equals(true)
                                      select new
                {
                    OldCurrentSchoolYearId = sy.OldCurrentSchoolYearId
                }).Single();
                return(SchoolYearData.OldCurrentSchoolYearId.Value);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchoolYear, "GetCurrentSchoolYear", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(new Guid());
            }
        }
Example #26
0
        //public static bool SaveFeesPeriodWithOtherSchoolYeartoSchoolProgramFeesDetail(Guid OldCurrentSchoolYearId, Guid CurrentSchoolYearId, Guid SchoolId, System.Data.Common.DbTransaction tran, DayCareDataContext dbold)
        //{
        //    DayCareDataContext db = dbold;
        //    db.Transaction = tran;
        //    SchoolProgram DBSchoolProgram = null;
        //    SchoolProgramFeesDetail DBSchoolProgramFeesDetail = null;
        //    try
        //    {
        //        Guid currentschoolyearid = (from sy in db.SchoolYears
        //                                    where sy.CurrentId.Equals(true) && sy.SchoolId.Equals(SchoolId)
        //                                    select sy.Id).SingleOrDefault();

        //        List<Guid> lstProgram = (from sp in db.SchoolPrograms
        //                                 where sp.SchoolYearId.Equals(OldCurrentSchoolYearId) && sp.Active.Equals(true)
        //                                 //&& !(from sp1 in db.SchoolPrograms
        //                                 //     where sp1.SchoolYearId.Equals(currentschoolyearid)
        //                                 //     select sp1.Id).Contains(sp.Id)
        //                                 select sp.Id).ToList();

        //        foreach (Guid ProgramId in lstProgram)
        //        {
        //            //try
        //            //{
        //            SchoolProgram DBSchoolProgramOld = db.SchoolPrograms.FirstOrDefault(i => i.Id.Equals(ProgramId));
        //            if (DBSchoolProgramOld != null)
        //            {
        //                DBSchoolProgram = new SchoolProgram();
        //                DBSchoolProgram = DBSchoolProgramOld;
        //                DBSchoolProgram.Id = Guid.NewGuid();
        //                DBSchoolProgram.SchoolYearId = CurrentSchoolYearId;
        //                DBSchoolProgram.CreatedDateTime = DateTime.Now;
        //                DBSchoolProgram.LastModifiedDatetime = DateTime.Now;
        //                db.SchoolPrograms.InsertOnSubmit(DBSchoolProgram);
        //                db.SubmitChanges();

        //                var lstDBSchoolProgramFeesDetailOld = db.SchoolProgramFeesDetails.Where(i => i.SchoolProgramId.Equals(ProgramId));
        //                if (lstDBSchoolProgramFeesDetailOld != null)
        //                {
        //                    foreach (SchoolProgramFeesDetail objSchoolProgramFeesDetails in lstDBSchoolProgramFeesDetailOld)
        //                    {
        //                        DBSchoolProgramFeesDetail = new SchoolProgramFeesDetail();
        //                        DBSchoolProgramFeesDetail = objSchoolProgramFeesDetails;
        //                        DBSchoolProgramFeesDetail.SchoolProgramId = DBSchoolProgram.Id;
        //                        DBSchoolProgramFeesDetail.CreatedDateTime = DateTime.Now;
        //                        DBSchoolProgramFeesDetail.LastModifiedDatetime = DateTime.Now;
        //                        db.SchoolProgramFeesDetails.InsertOnSubmit(DBSchoolProgramFeesDetail);
        //                        db.SubmitChanges();
        //                    }
        //                }
        //            }
        //            //}
        //            //catch
        //            //{ }
        //        }
        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        return false;
        //    }
        //}
        #endregion

        #region "Get Schoolyear Detail via Id, Dt: 14-Sept-2012, DB: A"
        public static DayCarePL.SchoolYearProperties LoadSchoolYearDtail(Guid SchoolId, Guid SchoolyearId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", "Execute LoadSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", "Debug LoadSchoolYear Method", DayCarePL.Common.GUID_DEFAULT);

                var SchoolYearData = (from sy in db.SchoolYears
                                      where sy.Id.Equals(SchoolyearId) && sy.SchoolId.Equals(SchoolId)
                                      select new DayCarePL.SchoolYearProperties()
                {
                    Id = sy.Id,
                    SchoolId = sy.SchoolId,
                    Year = sy.Year,
                    StartDate = sy.StartDate,
                    EndDate = sy.EndDate,
                    CurrentId = sy.CurrentId,
                    Comments = sy.Comments,
                    CreatedById = sy.CreatedById,
                    CreatedDateTime = sy.CreatedDateTime,
                    LastModifiedById = sy.LastModifiedById,
                    LastModifiedDatetime = sy.LastModifiedDatetime
                }).FirstOrDefault();



                return(SchoolYearData);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchoolYear, "LoadSchoolYear", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
        public static List <DayCarePL.StaffAttendenceHistoryProperties> LoadStaffAttendanceHistoryList(Guid StaffSchoolYearId, Guid SchoolYearId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.StaffList, "LoadStaffAttendanceHistoryList", "LoadStaffAttendanceHistoryList method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            List <DayCarePL.StaffAttendenceHistoryProperties> lstStaffAttendanceList = new List <DayCarePL.StaffAttendenceHistoryProperties>();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clFamilyPayment, "LoadStaffAttendanceHistoryList", "Debug LoadStaffAttendanceHistoryList called", DayCarePL.Common.GUID_DEFAULT);
                DayCarePL.StaffAttendenceHistoryProperties objStaffAttendanceList = null;
                var data = db.spStaffAttendanceHistoryList(StaffSchoolYearId, SchoolYearId);
                foreach (var s in data)
                {
                    objStaffAttendanceList    = new DayCarePL.StaffAttendenceHistoryProperties();
                    objStaffAttendanceList.Id = s.id;
                    objStaffAttendanceList.CheckInCheckOutDateTime = s.checkincheckoutdatetime;
                    if (s.CheckIn != null)
                    {
                        objStaffAttendanceList.CheckInTime = Convert.ToDateTime(s.CheckIn);
                    }
                    if (s.CheckOut != null)
                    {
                        objStaffAttendanceList.CheckOutTime = Convert.ToDateTime(s.CheckOut);
                    }
                    objStaffAttendanceList.StaffName         = s.Name;
                    objStaffAttendanceList.StaffSchoolYearId = s.StaffSchoolyearId;
                    lstStaffAttendanceList.Add(objStaffAttendanceList);
                }
                return(lstStaffAttendanceList);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChildProgEnrollment, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #28
0
        public static List <DayCarePL.ChildAttendenceHistoryProperties> LoadChildAttendanceHistoryList(Guid ChildSchoolYearId)
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clChildList, "LoadChildAttendanceHistoryList", "LoadChildAttendanceHistoryList method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();
            List <DayCarePL.ChildAttendenceHistoryProperties> lstChildAttendance = new List <DayCarePL.ChildAttendenceHistoryProperties>();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clFamilyPayment, "LoadChildAttendanceHistoryList", "Debug LoadChildAttendanceHistoryList called", DayCarePL.Common.GUID_DEFAULT);
                DayCarePL.ChildAttendenceHistoryProperties objChildAttendanceHistory = null;
                var data = db.spChildAttendanceHistoryList(ChildSchoolYearId);
                foreach (var c in data)
                {
                    objChildAttendanceHistory    = new DayCarePL.ChildAttendenceHistoryProperties();
                    objChildAttendanceHistory.Id = c.id;
                    objChildAttendanceHistory.CheckInCheckOutDateTime = Convert.ToDateTime(c.Date);
                    if (c.CheckIn != null)
                    {
                        objChildAttendanceHistory.CheckInTime = Convert.ToDateTime(c.CheckIn);
                    }
                    if (c.CheckOut != null)
                    {
                        objChildAttendanceHistory.CheckOutTime = Convert.ToDateTime(c.CheckOut);
                    }
                    objChildAttendanceHistory.ChildName = c.Name;
                    lstChildAttendance.Add(objChildAttendanceHistory);
                }
                return(lstChildAttendance);
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clChildProgEnrollment, "Save", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
Example #29
0
        public static List <DayCarePL.SchoolProperties> LoadAllSchool()
        {
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clSchool, "LoadAllSchool", "LoadAllSchool method called", DayCarePL.Common.GUID_DEFAULT);
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clSchool, "LoadAllSchool", "Debug LoadAllSchool called", DayCarePL.Common.GUID_DEFAULT);
                return((from s in db.Schools
                        orderby s.Name ascending
                        where s.active.Equals(true)
                        select new DayCarePL.SchoolProperties
                {
                    Id = s.Id,
                    Name = s.Name
                }).ToList());
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clSchool, "LoadAllSchool", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
                return(null);
            }
        }
        public static List <DayCarePL.AttendanceHistoryProperties> LoadAttendanceHistory(string ReportFor, string SearchText)
        {
            clConnection.DoConnection();
            List <DayCarePL.AttendanceHistoryProperties> lstAttendanceHistory = new List <DayCarePL.AttendanceHistoryProperties>();

            DayCarePL.AttendanceHistoryProperties objAttendanceHistory = null;
            DayCareDataContext db = new DayCareDataContext();

            try
            {
                SortedList sl = new SortedList();
                sl.Add("@ReportFor", ReportFor);
                sl.Add("@SearchText", SearchText);
                DataSet ds = clConnection.GetDataSet("spAttendanceReport", sl);
                if (ds != null && ds.Tables.Count > 0)
                {
                    for (int iRow = 0; iRow < ds.Tables[0].Rows.Count; iRow++)
                    {
                        objAttendanceHistory      = new DayCarePL.AttendanceHistoryProperties();
                        objAttendanceHistory.Name = Convert.ToString(ds.Tables[0].Rows[iRow]["Name"]);
                        objAttendanceHistory.CheckInCheckOutDateTime = Convert.ToDateTime(ds.Tables[0].Rows[iRow]["checkincheckoutdatetime"]);
                        objAttendanceHistory.CheckIn      = Convert.ToBoolean(ds.Tables[0].Rows[iRow]["CheckIn"]);
                        objAttendanceHistory.CheckOut     = Convert.ToBoolean(ds.Tables[0].Rows[iRow]["CheckOut"]);
                        objAttendanceHistory.Id           = new Guid(ds.Tables[0].Rows[iRow]["Id"].ToString());
                        objAttendanceHistory.SchoolYearId = new Guid(ds.Tables[0].Rows[iRow]["schoolyearid"].ToString());
                        lstAttendanceHistory.Add(objAttendanceHistory);
                        objAttendanceHistory = null;
                    }
                }
            }
            catch (Exception ex)
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clStaffAttendenceHistory, "LoadAttendanceHistory", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
            }
            return(lstAttendanceHistory);
        }