예제 #1
0
        public ActionResult ReviewTimeSheet()
        {

            try
            {
                TimeSheet timeSheet = new TimeSheet();
                timeSheet.EmpList = getReviewEmpList();

                return View(timeSheet);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
예제 #2
0
        public JsonResult ReviewTimeSheet(string empId)
        {

            try
            {
                List<TimeReview> lists = new List<TimeReview>();
                TimeSheet timeSheet = new TimeSheet();
                int id = Convert.ToInt32(HttpContext.User.Identity.Name);
                DateTime mon;
                System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
                DayOfWeek fdow = ci.DateTimeFormat.FirstDayOfWeek;
                DayOfWeek today = DateTime.Now.DayOfWeek;
                DateTime sow = DateTime.Now.AddDays(-(today - fdow)).Date;
                mon = sow;
                timeSheet.Mon = mon.ToString("dd/MM/yyyy");

                DateTime RStarts = new DateTime();
                DateTime EndDate = new DateTime();
                RStarts = mon.AddDays(1);
                EndDate = RStarts.AddDays(6);
                cEmpPersonalDetails empIdlogin = cEmpPersonalDetails.Get_ID(Convert.ToInt32(empId));
                int userId = empIdlogin.objEmpLogin.iObjectID;
                List<cEmpLogin> empLogin = cEmpLogin.Find(" objEmpLogin = "******" and iID = " + Convert.ToInt32(empId));


                if (empLogin.Count > 0)
                {
                    foreach (var item in empLogin)
                    {
                        List<cTimesheet> objTimes1 = cTimesheet.Find(" objEmpLogin = "******" iID = " + items.iID + " and dtStartDate = " + RStarts + " and dtEndDate = " + EndDate);

                                if (objTime.Count > 0)
                                {


                                    foreach (var itemTS in objTime)
                                    {
                                        List<cTimeSheetActivity> objActivity = cTimeSheetActivity.Find(" objTimesheet = " + itemTS.iID);

                                        if (objActivity.Count > 0)
                                        {
                                            foreach (var itemTSA in objActivity)
                                            {
                                                List<cTimeSheetActivityDes> objDes = cTimeSheetActivityDes.Find(" objTimeSheetActivity = " + itemTSA.iID);
                                                if (objDes.Count > 0)
                                                {
                                                    foreach (var itemDes in objDes)
                                                    {
                                                        string workHours = ReviewTimeCount(RStarts, Convert.ToInt32(empId));
                                                        long mm = 0;
                                                        long hh = 0;
                                                        hh = hh + Convert.ToInt64(workHours) / 60;
                                                        mm = mm + Convert.ToInt64(workHours) % 60;
                                                        workHours = hh + " : " + mm;
                                                        tm.Total = workHours;
                                                        tm.date = RStarts.ToString("dd/MM/yyyy");
                                                        DateTime dts = RStarts;
                                                        tm.sunday = dts.AddDays(6).ToString("dd/MM/yyyy");
                                                        if(objTime[0].bIsActive)
                                                        {
                                                            tm.status = "Submitted";
                                                        }
                                                        else
                                                        {
                                                            tm.status = "Saved";
                                                        }
                                                    }
                                                }
                                            }

                                        }//TimeSheetLoop
                                    }
                                }//TimeSheet
                                lists.Add(tm);
                                RStarts = RStarts.AddDays(-7);
                                EndDate = EndDate.AddDays(-7);
                            }
                        }
                    }

                }

                return Json(lists);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
예제 #3
0
        public ActionResult MyTimeSheet()
        {
            try
            {
                DateTime mon;
                System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
                DayOfWeek fdow = ci.DateTimeFormat.FirstDayOfWeek;
                DayOfWeek today = DateTime.Now.DayOfWeek;
                DateTime sow = dtCurrent.AddDays(-(today - fdow)).Date;
                mon = sow.AddDays(1);

                TimeSheet timeSheet = new TimeSheet();
                timeSheet.StartDate = mon;
                timeSheet.EndDate = mon.AddDays(6);
                string workHours = TimeCount(mon);
                long mm = 0;
                long hh = 0;
                hh = hh + Convert.ToInt64(workHours) / 60;
                mm = mm + Convert.ToInt64(workHours) % 60;
                workHours = hh + " : " + mm;

                timeSheet.TotalTime = workHours;
                timeSheet.ProjectList = getProjectList();
                timeSheet.ActivityList = getActivityList();

                return View(timeSheet);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }