Пример #1
0
        public JsonResult InsertAttendanceType(string attendanceType, string description, string acronym, string attendanceTypeId, string status, string indexId)
        {
            AttendanceTypeModel model       = new AttendanceTypeModel();
            AttendanceType      _attendType = new FingerprintsModel.AttendanceType();
            bool isResult = false;

            try
            {
                _attendType.Status           = Convert.ToBoolean(Convert.ToInt32(status));
                _attendType.IndexId          = (indexId == "" || indexId == "0") ? 0 : Convert.ToInt64(indexId);
                _attendType.Acronym          = (_attendType.Status) ? acronym.ToUpper() : null;
                _attendType.Description      = (_attendType.Status) ? description : null;
                _attendType.AttendanceTypeId = Convert.ToInt64(attendanceTypeId);
                _attendType.HomeBased        = Convert.ToBoolean(Convert.ToInt32(attendanceType));
                _attendType.UserId           = new Guid(Session["UserId"].ToString());
                _attendType.AgencyId         = (Session["AgencyId"] != null) ? new Guid(Session["AgencyId"].ToString()) : (Guid?)null;

                model = new TeacherData().InsertAttendanceType(out isResult, _attendType);
            }
            catch (Exception ex)
            {
                bool ids = Convert.ToBoolean(0);
                clsError.WriteException(ex);
            }
            return(Json(new { model, isResult }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult GetAvailableAttendanceType(string homeBased, string description, string acronym, string attendanceTypeId)
        {
            AttendanceType _attendType = new FingerprintsModel.AttendanceType();
            int            availCount  = 0;
            int            result      = 0;

            try
            {
                _attendType.HomeBased        = Convert.ToBoolean(Convert.ToInt32(homeBased));
                _attendType.Description      = description;
                _attendType.Acronym          = (string.IsNullOrEmpty(acronym)) ? "" : acronym.ToUpper();
                _attendType.AttendanceTypeId = Convert.ToInt32(attendanceTypeId);
                _attendType.AgencyId         = (Session["AgencyId"] != null) ? new Guid(Session["AgencyId"].ToString()) : (Guid?)null;
                _attendType.UserId           = new Guid(Session["UserId"].ToString());
                availCount = new TeacherData().GetAvailableAttendanceType(out result, _attendType);
            }
            catch (Exception ex)
            {
                clsError.WriteException(ex);
            }
            return(Json(new { availCount, result }, JsonRequestBehavior.AllowGet));
        }