public HttpResponseMessage GetAllAttendance(AttendancePopup Popup)
        {
            HttpResponseMessage message;

            try
            {
                // ManpowerAttendanceDAL dal = new ManpowerAttendanceDAL();
                DataSet         des = _obj.getAllAttendance(Popup);
                DynamicTableDTO dyTbl;
                if (des.Tables.Count < 1)
                {
                    dyTbl = null;
                }
                else
                {
                    dyTbl = new DynamicTableDTO(des.Tables[0]);
                }
                var dynObj = new { result = dyTbl };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "ManpowerAttendance", "CreateAttendance");
            }
            return(message);
        }
Beispiel #2
0
        public DataSet getAllAttendance(AttendancePopup Popup)
        {
            DataSet    result;
            SqlCommand SqlCmd = new SqlCommand("spAttendanceReportByCustomer");

            SqlCmd.CommandType = CommandType.StoredProcedure;
            SqlCmd.Parameters.AddWithValue("@CustomerId", (Popup.CustomerId == 0) ? null : Popup.CustomerId);
            SqlCmd.Parameters.AddWithValue("@BranchId", (Popup.BranchId == 0) ? null : Popup.BranchId);
            SqlCmd.Parameters.AddWithValue("@SiteId", (Popup.SiteId == 0) ? null : Popup.SiteId);
            SqlCmd.Parameters.AddWithValue("@ManpowerId", (Popup.ManpowerId == 0) ? null : Popup.ManpowerId);
            SqlCmd.Parameters.AddWithValue("@FromDate", Popup.FromDate);
            SqlCmd.Parameters.AddWithValue("@ToDate", Popup.ToDate);
            SqlCmd.Parameters.AddWithValue("@ActionBy", Popup.ActionBy);
            result = _unitOfWork.DbLayer.fillDataSet(SqlCmd);
            return(result);
        }
Beispiel #3
0
        private void OnCalendarDayClicked(object obj)
        {
            DayClickedEventArgs mouseArgs = obj as DayClickedEventArgs;

            if (mouseArgs == null)
            {
                return;
            }

            AttendancePopup popup = new AttendancePopup(mouseArgs.Date, this.Students);

            if (popup.ShowDialog().Value)
            {
                this.AttendanceRecords.Add(new AttendanceRecord(mouseArgs.Date, popup.SelectedStudent,
                                                                popup.EAttendanceMember, popup.DocumentTitle, popup.SubmitDocument, popup.Note));
                (mouseArgs.Calendar as MyCalendar).BuildCalendarOutCaller(this.AttendanceRecords);
            }
        }
Beispiel #4
0
        private void OnCalendarDayModify(object obj)
        {
            DayModifyEventArgs mouseArgs = obj as DayModifyEventArgs;

            if (mouseArgs == null)
            {
                return;
            }

            AttendancePopup popup = new AttendancePopup(mouseArgs.DataContext as AttendanceRecord, this.Students);

            if (popup.ShowDialog().Value)
            {
                AttendanceRecord attendanceRecord = mouseArgs.DataContext as AttendanceRecord;
                attendanceRecord.Date           = popup.datePicker.SelectedDate.Value;
                attendanceRecord.StudentRecord  = popup.SelectedStudent;
                attendanceRecord.EAttendance    = popup.EAttendanceMember;
                attendanceRecord.DocumentTitle  = popup.DocumentTitle;
                attendanceRecord.SubmitDocument = popup.SubmitDocument;

                (mouseArgs.Calendar as MyCalendar).BuildCalendarOutCaller(this.AttendanceRecords);
            }
        }