예제 #1
0
        public ActionResult SaveCloseMission(CloseMissionCiewModel Model)
        {
            var message = "OK";
            var trans   = _hrUnitOfWork.BeginTransaction();
            var errors  = UploadOneFile("ErrandRequest", Model.ErrandId.ToString());

            if (errors.Count > 0)
            {
                trans.Rollback();
                trans.Dispose();
                message = errors.First().errors.First().message;
                return(Json(message));
            }
            var record = _hrUnitOfWork.Repository <ErrandRequest>().Where(a => a.Id == Model.ErrandId).FirstOrDefault();

            record.Notes    = Model.Notes;
            record.Expenses = Model.Expenses;
            errors          = Save(Language);
            if (errors.Count > 0)
            {
                trans.Rollback();
                trans.Dispose();
                message = errors.First().errors.First().message;
                return(Json(message));
            }
            trans.Commit();
            trans.Dispose();

            return(Json(message));
        }
예제 #2
0
        public ActionResult CloseMission(int Id)
        {
            var record = _hrUnitOfWork.MissionRepository.CloseMission(Id);
            CloseMissionCiewModel Model = new CloseMissionCiewModel();

            Model.ValidFileExtensions = "'.jpg','.jpeg','.bmp','.png','.gif'";/*,'.doc','.docx','.xls','.xlsx'*/
            Model.Expenses            = record.Expenses;
            Model.Notes    = record.Notes;
            ViewBag.Id     = Id;
            Model.ErrandId = Id;
            return(PartialView("_CloseMission", Model));
        }