public string Delete(int id)
        {
            string             rpta;
            membership_history history = new membership_history();

            try {
                using (var ctx = new transshipEntities()) {
                    history = ctx.membership_history.FirstOrDefault(x => x.membership_HistoryId == id);

                    if (history != null)
                    {
                        ctx.Entry(history).State = EntityState.Deleted;
                        ctx.SaveChanges();

                        rpta = "ok";
                    }
                    else
                    {
                        rpta = "fail";
                    }
                }
            } catch (Exception e) {
                LogBook.TextLog.Info(string.Format("{0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : string.Empty));
                throw e;
            }

            return(rpta);
        }
        public HttpResponseMessage Put(membership_history model)
        {
            try {
                BOMemberShip_Payments member = new BOMemberShip_Payments();
                membership_history    memb;

                memb = member.updtaHistory(model);
                return(Request.CreateResponse(HttpStatusCode.OK, memb));
            } catch (Exception e) {
                ErrorMessage mensaje = new ErrorMessage("2.1", "Exception to update memberShip history - " + e.GetBaseException().Message, e.ToString());
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, mensaje));
            }
        }
        public membership_history SaveHistory(membership_history model)
        {
            var history = new membership_history();

            try {
                using (var ctx = new transshipEntities()) {
                    history = ctx.membership_history.Add(model);
                    ctx.SaveChanges();

                    return(history);
                }
            } catch (Exception e) {
                LogBook.TextLog.Info(string.Format("{0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : string.Empty));
                throw e;
            }
        }
        public membership_history UpdateHistory(membership_history model)
        {
            membership_history history = new membership_history();

            history = model;
            try {
                using (var ctx = new transshipEntities()) {
                    ctx.Entry(history).State = EntityState.Modified;
                    ctx.SaveChanges();

                    return(history);
                }
            } catch (Exception e) {
                LogBook.TextLog.Info(string.Format("{0} {1}", e.Message, e.InnerException != null ? e.InnerException.Message : string.Empty));
                throw e;
            }
        }
Exemple #5
0
 public membership_history updtaHistory(membership_history history)
 {
     return(customer.UpdateHistory(history));
 }
Exemple #6
0
 public membership_history saveHistory(membership_history history)
 {
     return(customer.SaveHistory(history));
 }