Example #1
0
        public ActionResult ConfirmRejectAgreement(TmcApplicationComment comment)
        {
            var commentApp = db.TmcApplicationComments.FirstOrDefault(m => m.Id == comment.Id);

            if (commentApp == null)
            {
                commentApp = comment;
                db.TmcApplicationComments.Add(commentApp);
            }
            else
            {
                commentApp.Comment = comment.Comment;
            }


            if (comment.Type == 1)
            {
                var tmcIn = db.TmcIns.First(m => m.Id == comment.ApplicationId);
                tmcIn.StateType = -1;
            }
            else if (comment.Type == 2)
            {
                var tmcOut = db.TmcOuts.First(m => m.Id == comment.ApplicationId);
                tmcOut.StateType = -1;
            }

            db.SaveChanges();
            return(Json(comment.Id, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public ActionResult WriteoffDialog(Guid id, int type, string url)
        {
            var createEmployeeId = UserHelper.GetCurrentEmployee().Id;
            //            var applicationComment = db.TmcApplicationComments
            //                .Where(a => a.ApplicationId == id)
            //                .OrderByDescending(a => a.CreateDate)
            //                .FirstOrDefault();
            var applicationComment = new TmcApplicationComment()
            {
                Id               = Guid.NewGuid(),
                ApplicationId    = id,
                CreateEmployeeId = createEmployeeId,
                Type             = type,
                Url              = url
            };

            return(PartialView(applicationComment));
        }
Example #3
0
        public ActionResult ConfirmWriteoff(TmcApplicationComment comment)
        {
            var tmc = db.Tmcs.First(m => m.Id == comment.ApplicationId);

            tmc.WriteoffDate = DateTime.Now;
            tmc.StateType    = 2;

            var commentApp = db.TmcApplicationComments.FirstOrDefault(m => m.Id == comment.Id);

            if (commentApp == null)
            {
                commentApp = comment;
                db.TmcApplicationComments.Add(commentApp);
            }
            else
            {
                commentApp.Comment = comment.Comment;
            }

            db.SaveChanges();
            return(Json(comment.Id, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        public ActionResult ConfirmRejectReportAgreement(TmcApplicationComment comment)
        {
//            var commentApp = db.TmcApplicationComments.FirstOrDefault(m => m.Id == comment.Id);
//            if (commentApp == null)
//            {
//                commentApp = comment;
//                db.TmcApplicationComments.Add(commentApp);
//            }
//            else
//            {
//                commentApp.Comment = comment.Comment;
//            }

            var report = db.TmcReportTasks.First(m => m.Id == comment.ApplicationId);

            if (report.State == 0)
            {
                report.State = -1; //отклонить
                report.Note  = comment.Comment;
            }
            db.SaveChanges();
            return(Json(comment.Id, JsonRequestBehavior.AllowGet));
        }