示例#1
0
        public static DayCarePL.Result Save(Guid ChildSchoolYearId, bool CheckInCheckOut, string CheckInCheckOutDateTime)
        {
            clConnection.DoConnection();
            DayCareDataContext db = new DayCareDataContext();

            DayCarePL.Result       objResult = new DayCarePL.Result();
            ChildAttendenceHistory DBChildAttendaceHistory = null;

            try
            {
                DBChildAttendaceHistory    = new ChildAttendenceHistory();
                DBChildAttendaceHistory.Id = System.Guid.NewGuid();
                DBChildAttendaceHistory.ChildSchoolYearId       = ChildSchoolYearId;
                DBChildAttendaceHistory.CheckInCheckOut         = CheckInCheckOut;
                DBChildAttendaceHistory.CheckInCheckOutDateTime = Convert.ToDateTime(CheckInCheckOutDateTime);
                db.ChildAttendenceHistories.InsertOnSubmit(DBChildAttendaceHistory);
                db.SubmitChanges();
                objResult.result = "true";
            }
            catch (Exception ex)
            {
                objResult.result = ex.Message.ToString();
            }
            return(objResult);
        }
        public static DayCarePL.Result SaveCheckInCheckOutTime(Guid StaffSchoolYearId, bool CheckInCheckOut, string CheckInCheckOutDateTime)
        {
            clConnection.DoConnection();
            DayCarePL.Result objResult = new DayCarePL.Result();
            objResult.result = "true";
            DayCarePL.Logger.Write(DayCarePL.LogType.INFO, DayCarePL.ModuleToLog.clStaffAttendenceHistory, "SaveCheckInCheckOutTime", "Execute SaveCheckInCheckOutTime Method", DayCarePL.Common.GUID_DEFAULT);
            DayCareDataContext     db = new DayCareDataContext();
            StaffAttendenceHistory DBStaffAttendenceHistory = null;

            try
            {
                DayCarePL.Logger.Write(DayCarePL.LogType.DEBUG, DayCarePL.ModuleToLog.clStaffAttendenceHistory, "SaveCheckInCheckOutTime", "", StaffSchoolYearId.ToString());
                DBStaffAttendenceHistory    = new StaffAttendenceHistory();
                DBStaffAttendenceHistory.Id = Guid.NewGuid();
                DBStaffAttendenceHistory.StaffSchoolYearId       = StaffSchoolYearId;
                DBStaffAttendenceHistory.CheckInCheckOut         = CheckInCheckOut;
                DBStaffAttendenceHistory.CheckInCheckOutDateTime = Convert.ToDateTime(CheckInCheckOutDateTime);
                DBStaffAttendenceHistory.CreatedDateTime         = DateTime.Now;
                db.StaffAttendenceHistories.InsertOnSubmit(DBStaffAttendenceHistory);
                db.SubmitChanges();
                objResult.result = "true";
            }
            catch (Exception ex)
            {
                objResult.result = "false";
                DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.clStaffAttendenceHistory, "SaveCheckInCheckOutTime", ex.Message.ToString(), StaffSchoolYearId.ToString());
            }
            return(objResult);
        }