Example #1
0
        //[ValidateAntiForgeryToken]
        public ActionResult DeleteContract(int id)
        {
            Table_Contracts_UserRemarks table_Contracts_UserRemarks = db.Table_Contracts_UserRemarks.Find(id);

            db.Table_Contracts_UserRemarks.Remove(table_Contracts_UserRemarks);
            db.SaveChanges();
            return(Json(new { data = true }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        //[ValidateAntiForgeryToken]
        public ActionResult EditContract(int id, string Remark)
        {
            Table_Contracts_UserRemarks table_Contracts_UserRemarks = db.Table_Contracts_UserRemarks.Find(id);

            table_Contracts_UserRemarks.Remark     = Remark;
            table_Contracts_UserRemarks.LastUpdate = DateTime.Now;
            db.SaveChanges();

            return(Json(
                       new Table_Contracts_UserRemarksSelect
            {
                id = table_Contracts_UserRemarks.id,
                ContractID = table_Contracts_UserRemarks.ContractID,
                UserName = table_Contracts_UserRemarks.UserName,
                PageUserName = User.Identity.Name.ToLower(),
                Remark = table_Contracts_UserRemarks.Remark,
                LastUpdate = DateTime.Now.ToString(),
                ShowOrHide = ShowOrHideRemarkEntry(table_Contracts_UserRemarks.UserName, User.Identity.Name.ToLower())
            }
                       , JsonRequestBehavior.AllowGet));
        }
Example #3
0
        //[ValidateAntiForgeryToken]
        public ActionResult CreateContract(Table_Contracts_UserRemarks table_Contracts_UserRemarks)
        {
            table_Contracts_UserRemarks.LastUpdate = DateTime.Now;

            if (ModelState.IsValid)
            {
                db.Table_Contracts_UserRemarks.Add(table_Contracts_UserRemarks);
                db.SaveChanges();
                return(Json(
                           new Table_Contracts_UserRemarksSelect
                {
                    id = table_Contracts_UserRemarks.id,
                    ContractID = table_Contracts_UserRemarks.ContractID,
                    UserName = table_Contracts_UserRemarks.UserName,
                    PageUserName = User.Identity.Name.ToLower(),
                    Remark = table_Contracts_UserRemarks.Remark,
                    LastUpdate = DateTime.Now.ToString(),
                    ShowOrHide = ShowOrHideRemarkEntry(table_Contracts_UserRemarks.UserName, User.Identity.Name.ToLower())
                }
                           , JsonRequestBehavior.AllowGet));
            }
            return(Json(new { data = false }, JsonRequestBehavior.AllowGet));
        }