// GET: StaffApplicationManage/Details/5

        /*?代表:可为空*/
        public ActionResult Details(int?id, int?flag)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StaffApplications staffApplications = db.StaffApplications.Find(id);

            if (staffApplications == null)
            {
                return(HttpNotFound());
            }
            else if (flag == 1)
            {
                staffApplications.AuditStatus = "审核通过";

                var items = (from p in db.Staffs where p.StaffNumber == staffApplications.StaffNumber select p).FirstOrDefault();
                items.JobState    = "离职";
                items.LeaveType   = staffApplications.LeaveType;
                items.LeaveDate   = staffApplications.HopeLeaveDate;
                items.LeaveReason = staffApplications.LeaveReason;
            }
            else if (flag == 0)
            {
                staffApplications.AuditStatus = "审核不通过";
            }
            db.SaveChanges();
            return(View(staffApplications));
        }
Ejemplo n.º 2
0
        public JsonResult SendBillTypeNumber(string BillTypeNumber)
        {
            StaffApplications staffApplication = new StaffApplications();
            var item = (from p in db.BillProperties where BillTypeNumber == p.Type select p).FirstOrDefault();

            staffApplication.BillTypeName = item.TypeName;
            return(Json(staffApplication));
        }
Ejemplo n.º 3
0
        public ActionResult DeleteConfirmed(int id)
        {
            StaffApplications staffApplications = db.StaffApplications.Find(id);

            db.StaffApplications.Remove(staffApplications);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
 public ActionResult Edit(StaffApplications staffApplications)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staffApplications).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(staffApplications));
 }
 public ActionResult Edit([Bind(Include = "Id,BillTypeNumber,BillTypeName,BillNumber,StaffNumber,StaffName,ApplyDate,HopeLeaveDate,LeaveType,LeaveReason,Remark,AuditStatus")] StaffApplications staffApplications)
 {
     if (ModelState.IsValid)
     {
         db.Entry(staffApplications).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(staffApplications));
 }
Ejemplo n.º 6
0
        public JsonResult SendData(string StaffNumber)
        {
            StaffApplications staffApplication = new StaffApplications();
            var itemStaff = (from p in db.Staffs
                             where StaffNumber == p.StaffNumber
                             select p.Name).FirstOrDefault();

            //赋值
            staffApplication.StaffName = itemStaff;
            //staffChange.EffectiveDate = null;
            staffApplication.HopeLeaveDate = null;
            staffApplication.ApplyDate     = null;
            return(Json(staffApplication));
        }
Ejemplo n.º 7
0
        // GET: StaffApplication/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StaffApplications staffApplications = db.StaffApplications.Find(id);

            if (staffApplications == null)
            {
                return(HttpNotFound());
            }
            return(View(staffApplications));
        }
Ejemplo n.º 8
0
        public ActionResult Create([Bind(Include = "Id,BillTypeNumber,BillTypeName,BillNumber,StaffNumber,StaffName,ApplyDate,HopeLeaveDate,LeaveType,LeaveReason,Remark,AuditStatus")] StaffApplications staffApplications)
        {
            if (ModelState.IsValid)
            {
                staffApplications.AuditStatus = "未提交";

                db.StaffApplications.Add(staffApplications);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }


            return(View(staffApplications));
        }
Ejemplo n.º 9
0
        // GET: StaffApplication/Details/5
        public ActionResult Details(int?id, int?flag)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StaffApplications staffApplications = db.StaffApplications.Find(id);

            if (staffApplications == null)
            {
                return(HttpNotFound());
            }
            else if (flag == 1)
            {
                staffApplications.AuditStatus = "未审核";
                staffApplications.ApplyDate   = DateTime.Today;
            }
            db.SaveChanges();
            return(View(staffApplications));
        }