public ActionResult Add(recsys_additional_service data)
        {
            bool isSuccessful = false;
            this._db.recsys_additional_service.AddObject(data);

            try
            {
                this._db.SaveChanges();
                isSuccessful = true;
            }
            catch (OptimisticConcurrencyException)
            {
                //# log down
            }

            return Json(isSuccessful, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Delete(recsys_additional_service data)
        {
            bool isSuccessful = false;

            recsys_additional_service record = this._db.recsys_additional_service.FirstOrDefault(theService => theService.id == data.id);

            this._db.recsys_additional_service.DeleteObject(record);

            try
            {
                this._db.SaveChanges();
                isSuccessful = true;
            }
            catch(OptimisticConcurrencyException)
            {
                //# log down
            }

            return Json(isSuccessful, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Edit(recsys_additional_service data)
        {
            bool isSuccessful = false;

            recsys_additional_service oldRecord = this._db.recsys_additional_service.FirstOrDefault(theService => theService.id == data.id);

            oldRecord.service_date = data.service_date;
            oldRecord.name = data.name;
            oldRecord.remark = data.remark;

            try
            {
                this._db.SaveChanges();
                isSuccessful = true;
            }
            catch (OptimisticConcurrencyException)
            {
                //# log down
            }

            return Json(isSuccessful, JsonRequestBehavior.AllowGet);
        }
Example #4
0
 /// <summary>
 /// Create a new recsys_additional_service object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static recsys_additional_service Createrecsys_additional_service(global::System.Int32 id)
 {
     recsys_additional_service recsys_additional_service = new recsys_additional_service();
     recsys_additional_service.id = id;
     return recsys_additional_service;
 }
Example #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the recsys_additional_service EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTorecsys_additional_service(recsys_additional_service recsys_additional_service)
 {
     base.AddObject("recsys_additional_service", recsys_additional_service);
 }