Exemple #1
0
        public JsonResult Edit(Communications.Models.CommunityAssociations obj)
        {
            string message = "";
            var    valid   = TryUpdateModel(obj);

            if (valid == true)
            {
                db.Entry(obj).State = EntityState.Modified;

                obj.IsActive   = true;
                obj.ModifiedBy = 1;
                obj.ModifiedOn = DateTime.Now;


                try
                {
                    db.SaveChanges();

                    message = "Community Association Saved Successfully";
                }
                catch (Exception ex)
                {
                    valid   = false;
                    message = "Error occurred while saving the Community Association";
                }
            }
            else
            {
                message = "Invalid Inputs";
            }

            return(Json(new
            {
                Valid = valid,
                Message = message,
                Errors = GetErrorsFromModelState()
            }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult Edit(int id)
 {
     Communications.Models.CommunityAssociations obj = new Communications.Models.CommunityAssociations();
     obj = obj.GetListByID(id, UserID);
     return(View(obj));
 }
Exemple #3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public ActionResult Create()
 {
     Communications.Models.CommunityAssociations obj = new Communications.Models.CommunityAssociations();
     return(View(obj));
 }