Ejemplo n.º 1
0
 public string AddEditExtraValue(int meetingid, string field, string value)
 {
     try
     {
         var q = from v in Db.MeetingExtras
                 where v.Field == field
                 where v.MeetingId == meetingid
                 select v;
         var ev = q.SingleOrDefault();
         if (ev == null)
         {
             ev = new MeetingExtra
             {
                 MeetingId = meetingid,
                 Field = field,
             };
             Db.MeetingExtras.InsertOnSubmit(ev);
         }
         ev.Data = value;
         Db.SubmitChanges();
         return "ok";
     }
     catch (Exception ex)
     {
         return ex.Message;
     }
 }
Ejemplo n.º 2
0
 public string AddEditExtraValue(int meetingid, string field, string value)
 {
     try
     {
         var q = from v in Db.MeetingExtras
                 where v.Field == field
                 where v.MeetingId == meetingid
                 select v;
         var ev = q.SingleOrDefault();
         if (ev == null)
         {
             ev = new MeetingExtra
             {
                 MeetingId = meetingid,
                 Field     = field,
             };
             Db.MeetingExtras.InsertOnSubmit(ev);
         }
         ev.Data = value;
         Db.SubmitChanges();
         return("ok");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Ejemplo n.º 3
0
 public ExtraValue(MeetingExtra v, ExtraValueModel model)
 {
     Type  = v.Type;
     Field = v.Field;
     Data  = v.Data;
     Id    = v.MeetingId;
     Model = model;
 }
Ejemplo n.º 4
0
 public ExtraValue(MeetingExtra v, ExtraValueModel model)
 {
     Type      = v.Type;
     Field     = v.Field.Trim();
     StrValue  = v.StrValue;
     DateValue = v.DateValue;
     Data      = v.Data;
     IntValue  = v.IntValue;
     BitValue  = v.BitValue;
     Id        = v.MeetingId;
     Model     = model;
 }
Ejemplo n.º 5
0
        public ActionResult NewExtraValue(int id, string field, string value, bool multiline)
        {
            var m = new MeetingModel(id);

            try
            {
                var mev = new MeetingExtra {
                    MeetingId = id, Field = field, Data = value, DataType = multiline ? "text" : null
                };
                DbUtil.Db.MeetingExtras.InsertOnSubmit(mev);
                DbUtil.Db.SubmitChanges();
            }
            catch (Exception ex)
            {
                return(Content("error: " + ex.Message));
            }
            return(View("ExtrasGrid", m.meeting));
        }