Exemple #1
0
        public ActionResult Edit(RateErrorViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var item = dao.GetEntity("STAT_MO", model.STAT_MO, "HALL_NO", model.HALL_NO);

                    item.MODIFY_DTIME        = DateTime.Now;
                    item.MODIFY_ID           = UserState.UserID;
                    item.COR_MISTAKE_SVR_CNT = model.COR_MISTAKE_SVR_CNT;
                    item.COR_VALID_SVR_CNT   = model.COR_VALID_SVR_CNT;


                    CHK_HALL_STAT_M_DAL.UpdateObject(item);
                    var mo = Convert.ToInt32(item.STAT_MO.ToString().Substring(4, 2));
                    if (mo != DateTime.Now.Month)
                    {
                        Stored_DAL.UpdateDataByHall(item.STAT_MO, item.HALL_NO, UserState.UserID);
                    }
                    Alter("修改成功!", util.Enum.AlterTypeEnum.Success, false, true);
                    return(Redirect("/Home/Blank"));
                }

                ModelState.AddModelError("", "修改失败。");
                return(View(model));
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("修改出错!", ex);
                ModelState.AddModelError("", "修改失败!" + ex.Message);
                return(RedirectToAction("Error", "Home"));
            }
        }
Exemple #2
0
        public ActionResult Index(string statMo, string orgId, int pageIndex = 1, int pageSize = 20)
        {
            int stat;

            if (string.IsNullOrEmpty(statMo))
            {
                statMo = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
            }
            int.TryParse(statMo.Replace("-", ""), out stat);

            if (string.IsNullOrEmpty(orgId))
            {
                orgId = setOrgData();
            }
            else
            {
                setOrgData(orgId);
            }

            ViewBag.Stat   = stat;
            ViewBag.StatMo = statMo;

            var data = new CHK_HALL_STAT_M_DAL().GetRateErrorList(pageIndex, pageSize, orgId, stat);

            return(View(data));
        }
Exemple #3
0
        public ActionResult Edit(string id, string staffId)
        {
            ViewBag.HALL_NAM = Halldao.GetEntity("HALL_NO", staffId).HALL_NAM;
            ViewBag.STAT_MO  = id;
            try
            {
                var item = CHK_HALL_STAT_M_DAL.GetPersonnelAttendance(Convert.ToInt32(id), staffId);

                var model = new PersonnelAttendanceViewModel()
                {
                    COR_ABSENT_DAY_CNT = (int)item.COR_ABSENT_DAY_CNT,
                    COR_ATTEND_PER_CNT = (int)item.COR_ATTEND_PER_CNT,
                    COR_EAR_DAY_CNT    = (int)item.COR_EAR_DAY_CNT,
                    COR_LAT_DAY_CNT    = (int)item.COR_LAT_DAY_CNT,
                    COR_WORK_DAY_CNT   = (int)item.COR_WORK_DAY_CNT,
                    HALL_NO            = item.HALL_NO,
                    STAT_MO            = item.STAT_MO
                };

                return(View(model));
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("查看出错", ex);
                return(RedirectToAction("Error", "Home"));
            }
        }
Exemple #4
0
 public ActionResult Detail(string id, string staffId)
 {
     try
     {
         var model = CHK_HALL_STAT_M_DAL.GetRateError(Convert.ToInt32(id), staffId);
         ViewBag.HALL_NAM = Halldao.GetEntity("HALL_NO", staffId).HALL_NAM;
         ViewBag.STAT_MO  = id;
         return(View(model));
     }
     catch (Exception ex)
     {
         LogHelper.ErrorLog("查看出错", ex);
         return(RedirectToAction("Error", "Home"));
     }
 }
Exemple #5
0
        public ActionResult Edit(string id, string staffId)
        {
            ViewBag.HALL_NAM = Halldao.GetEntity("HALL_NO", staffId).HALL_NAM;
            ViewBag.STAT_MO  = id;
            try
            {
                var item = CHK_HALL_STAT_M_DAL.GetRateError(Convert.ToInt32(id), staffId);

                var model = new RateErrorViewModel()
                {
                    COR_MISTAKE_SVR_CNT = (int)item.COR_MISTAKE_SVR_CNT,
                    COR_VALID_SVR_CNT   = (int)item.COR_VALID_SVR_CNT,
                    HALL_NO             = item.HALL_NO,
                    STAT_MO             = item.STAT_MO
                };

                return(View(model));
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("查看出错", ex);
                return(RedirectToAction("Error", "Home"));
            }
        }
Exemple #6
0
        public ActionResult Index(int?years, int?month, int?endMonth, string orgId, int pageIndex = 1, int pageSize = 20)
        {
            //month
            var stat    = years.GetValueOrDefault();
            var endstat = stat;

            if (years == null)
            {
                years   = DateTime.Now.Year;
                stat    = years.GetValueOrDefault();
                endstat = years.GetValueOrDefault();
                if (month == null)
                {
                    month    = DateTime.Now.Month;
                    endMonth = DateTime.Now.Month;
                }
            }

            if (month != null)
            {
                var sm = month.ToString();
                if (month < 10)
                {
                    sm = "0" + month;
                }
                int.TryParse(stat.ToString() + sm, out stat);
                if (endMonth == null)
                {
                    endstat = stat;
                }
            }
            else
            {
                stat = int.Parse(stat.ToString() + "01");
                if (endMonth == null)
                {
                    endstat = int.Parse(endstat + "12");
                }
            }

            if (endMonth != null)
            {
                var sm = endMonth.ToString();
                if (endMonth < 10)
                {
                    sm = "0" + endMonth;
                }
                int.TryParse(endstat.ToString() + sm, out endstat);
            }
            //.Select(x => x.HALL_NO).ToArray();
            var halllist = new List <string>();

            if (string.IsNullOrEmpty(orgId))
            {
                ViewBag.orgid   = "";
                ViewBag.orgName = "";
            }
            else
            {
                halllist        = new SYS_HALL_DAL().GetOrgHallAndChild(orgId);
                ViewBag.orgId   = orgId;
                ViewBag.orgName = "";
                var orginfo = orgdao.GetEntity("ORG_ID", orgId);
                if (orginfo != null)
                {
                    ViewBag.orgName = orginfo.ORG_NAM;
                }
            }
            ViewBag.EndMonths = GetMonthSelectList(true, endMonth);
            ViewBag.Months    = GetMonthSelectList(true, month);
            ViewBag.Years     = GetYearsSelectList(years);

            ViewBag.Stat    = stat;
            ViewBag.Endstat = endstat;


            //GetListSubByP
            if (month == endMonth)
            {
                var list = CHK_HALL_STAT_M_DAL.GetListSub(stat, halllist.ToArray(), pageIndex, pageSize);
                return(View(list));
            }
            else
            {
                var list = CHK_HALL_STAT_M_DAL.GetListSubByP(stat, endstat, orgId);
                return(View(list));
            }
        }