Esempio n. 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));
 }
Esempio n. 2
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            SourceOfFunds sourceOfFunds = db.SourceOfFunds.Find(id);

            db.SourceOfFunds.Remove(sourceOfFunds);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 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));
        }
Esempio n. 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));
        }