Пример #1
0
        public JsonResult Add(DeXuatModel m)
        {
            ResponseBase res = new ResponseBase();

            try
            {
                var    ses = (UserSave)Session[Constant.USER_SESSION];
                DeXuat dt  = new DeXuat
                {
                    IDDoanVien  = m.IDDoanVien,
                    NoiDung     = m.NoiDung,
                    NgayThang   = DateTime.Parse(m.NgayThang),
                    Loai        = 1,
                    TrangThai   = 2,
                    NguoiDeXuat = ses.HoTen
                };
                db.DeXuats.InsertOnSubmit(dt);
                db.SubmitChanges();
                res.Status  = StatusID.Success;
                res.Message = "Đã thêm";
            }
            catch (Exception e)
            {
                res.Status  = StatusID.InternalServer;
                res.Message = e.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult DeXuatDV(DeXuatModel m)
        {
            ResponseBase res = new ResponseBase();

            try
            {
                var    ses = (DoanVienSave)Session[Constant.CUS_SESSION];
                DeXuat dt  = new DeXuat
                {
                    IDDoanVien  = m.IDDoanVien,
                    NoiDung     = m.NoiDung,
                    NgayThang   = DateTime.Now,
                    Loai        = m.Loai,
                    TrangThai   = 1,
                    NguoiDeXuat = ses.HoTen
                };
                db.DeXuats.InsertOnSubmit(dt);
                db.SubmitChanges();
                res.Status = StatusID.Success;

                res.Message = "Đã gửi đề xuất cho quản trị viên";
            }
            catch (Exception e)
            {
                res.Status  = StatusID.InternalServer;
                res.Message = e.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }