示例#1
0
 public ActionResult AddSourceOfFunds(SourceOfFunds sourceOfFunds)
 {
     try
     {
         DateTime dt = DateTime.Now;
         sourceOfFunds.SourceOfFundID = Guid.NewGuid();
         sourceOfFunds.DateCreated    = dt;
         sourceOfFunds.DateModified   = dt;
         sourceOfFunds.CreatedBy      = "Techspecialist";
         db.SourceOfFunds.Add(sourceOfFunds);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         LogHelper.Log(Log.Event.ADD_SOURCEOFFUNDS, ex.Message);
         ExceptionError(ex.Message, ex.StackTrace);
     }
     return(Json(new
     {
         success = true,
         message = "Source Of Fund added successfully!!!",
         data = db.SourceOfFunds.Select(x => new
         {
             x.SourceOfFundID,
             x.SourceOfFund,
         })
     }, JsonRequestBehavior.AllowGet));
 }
示例#2
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            SourceOfFunds sourceOfFunds = db.SourceOfFunds.Find(id);

            db.SourceOfFunds.Remove(sourceOfFunds);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "SourceOfFundID,SourceOfFund,EnableSourceOfFund,DateModified,CreatedBy,DateCreated")] SourceOfFunds sourceOfFunds)
        {
            if (ModelState.IsValid)
            {
                sourceOfFunds.SourceOfFundID = Guid.NewGuid();
                db.SourceOfFunds.Add(sourceOfFunds);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sourceOfFunds));
        }
示例#4
0
        // GET: SourceOfFunds/Details/5
        public ActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SourceOfFunds sourceOfFunds = db.SourceOfFunds.Find(id);

            if (sourceOfFunds == null)
            {
                return(HttpNotFound());
            }
            return(View(sourceOfFunds));
        }