Пример #1
0
 public ActionResult ApplyOrder(string table, string location, Dictionary<string, int> orders)
 {
     var m = new ExtraValueModel(table, location);
     m.ApplyOrder(orders);
     m = new ExtraValueModel(table, location);
     return View("ListStandard", m);
 }
Пример #2
0
        private string AddNewExtraValueToRecord()
        {
            var o = ExtraValueModel.TableObject(Id, ExtraValueTable, Id2);

            switch (AdhocExtraValueType.Value)
            {
            case "Code":
                o.AddEditExtraCode(ExtraValueName, ExtraValueTextBox);
                break;

            case "Text":
                o.AddEditExtraText(ExtraValueName, ExtraValueTextArea);
                break;

            case "Text2":
                o.AddEditExtraText(ExtraValueName, ExtraValueTextArea);
                break;

            case "Date":
                o.AddEditExtraDate(ExtraValueName, ExtraValueDate);
                break;

            case "Int":
                o.AddEditExtraInt(ExtraValueName, ExtraValueInteger);
                break;

            case "Bit":
                o.AddEditExtraBool(ExtraValueName, ExtraValueCheckbox);
                break;
            }
            DbUtil.Db.SubmitChanges();
            o.LogExtraValue("add", ExtraValueName);
            return(null);
        }
Пример #3
0
 public ExtraValue(MeetingExtra v, ExtraValueModel model)
 {
     Type = v.Type;
     Field = v.Field;
     Data = v.Data;
     Id = v.MeetingId;
     Model = model;
 }
Пример #4
0
 public ExtraValue(MeetingExtra v, ExtraValueModel model)
 {
     Type  = v.Type;
     Field = v.Field;
     Data  = v.Data;
     Id    = v.MeetingId;
     Model = model;
 }
Пример #5
0
 public ExtraValue(OrganizationExtra v, ExtraValueModel model)
 {
     Type = v.Type;
     Field = v.Field;
     StrValue = v.StrValue;
     DateValue = v.DateValue;
     Data = v.Data;
     IntValue = v.IntValue;
     BitValue = v.BitValue;
     Id = v.OrganizationId;
     Model = model;
 }
Пример #6
0
 public ExtraValue(FamilyExtra v, ExtraValueModel model)
 {
     Type = v.Type;
     Field = v.Field;
     StrValue = v.StrValue;
     DateValue = v.DateValue;
     Data = v.Data;
     IntValue = v.IntValue;
     BitValue = v.BitValue;
     Id = v.FamilyId;
     Model = model;
 }
Пример #7
0
 public ExtraValue(OrganizationExtra v, ExtraValueModel model)
 {
     Type      = v.Type;
     Field     = v.Field;
     StrValue  = v.StrValue;
     DateValue = v.DateValue;
     Data      = v.Data;
     IntValue  = v.IntValue;
     BitValue  = v.BitValue;
     Id        = v.OrganizationId;
     Model     = model;
 }
Пример #8
0
 public ExtraValue(FamilyExtra v, ExtraValueModel model)
 {
     Type      = v.Type;
     Field     = v.Field;
     StrValue  = v.StrValue;
     DateValue = v.DateValue;
     Data      = v.Data;
     IntValue  = v.IntValue;
     BitValue  = v.BitValue;
     Id        = v.FamilyId;
     Model     = model;
 }
Пример #9
0
 public ExtraValue(ContactExtra 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.ContactId;
     Model     = model;
 }
Пример #10
0
 public ExtraValue(MeetingExtra v, ExtraValueModel model)
 {
     Type = v.Type;
     Field = v.Field;
     StrValue = v.StrValue;
     DateValue = v.DateValue;
     Data = v.Data;
     IntValue = v.IntValue;
     BitValue = v.BitValue;
     Id = v.MeetingId;
     Model = model;
 }
Пример #11
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;
 }
Пример #12
0
 public ExtraValue(OrgMemberExtra 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.OrganizationId;
     Id2       = v.PeopleId;
     Model     = model;
 }
Пример #13
0
 public ActionResult Edit(string table, string type, string pk, string name, string value)
 {
     ExtraValueModel m;
     if(table == "OrgMember")
     {
         var a = pk.Split('.');
         m = new ExtraValueModel(a[0].ToInt(), a[1].ToInt(), table, "Adhoc");
     }
     else
         m = new ExtraValueModel(pk.ToInt(), table);
     m.EditExtra(type, HttpUtility.UrlDecode(name), value);
     return new EmptyResult();
 }
 public ActionResult AddExtraValue(NewExtraValueModel m)
 {
     try
     {
         m.AddAsNewAdhoc();
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return View("Tabs/ExtraValue/NewAdHoc", m);
     }
     var em = new ExtraValueModel(m.Id, m.Id2, "OrgMember", "Adhoc");
     return View("Tabs/ExtraValue/Adhoc", em);
 }
Пример #15
0
        internal static Value AddField(Value f, ExtraValue ev, ExtraValueModel m = null)
        {
            if (f == null)
            {
                f = new Value
                {
                    Name = ev.Field,
                    Standard = false
                };
                f.Type = ev.Type;
            }
            else
                f.Standard = true;

            f.Id = ev?.Id ?? (m?.Id ?? 0);
            f.Extravalue = ev;
            f.Model = m;
            return f;
        }
Пример #16
0
        internal static Value AddField(Value f, ExtraValue ev, ExtraValueModel m = null)
        {
            if (f == null)
            {
                f = new Value
                {
                    Name     = ev.Field,
                    Standard = false
                };
                f.Type = ev.Type;
            }
            else
            {
                f.Standard = true;
            }

            f.Id         = ev?.Id ?? (m?.Id ?? 0);
            f.Extravalue = ev;
            f.Model      = m;
            return(f);
        }
Пример #17
0
 public ActionResult DeleteAdhoc(string table, int id, string name)
 {
     var m = new ExtraValueModel(id, table, "Adhoc");
     m.Delete(name);
     return View("AdHoc", m);
 }
Пример #18
0
 public ActionResult DeleteExtraValue(int oid, int pid, string name)
 {
     var m = new ExtraValueModel(oid, pid, "OrgMember", "Adhoc");
     m.Delete(name);
     return Content("deleted");
 }
Пример #19
0
 public ActionResult ExtraValues(int oid, int pid)
 {
     var em = new ExtraValueModel(oid, pid, "OrgMember", "Adhoc");
     return View("Tabs/ExtraValue/Adhoc", em);
 }
Пример #20
0
 public ActionResult ListStandard(string table, string location, int id)
 {
     var m = new ExtraValueModel(id, table, location);
     return View(m);
 }
Пример #21
0
 public ActionResult DeleteStandard(string table, string location, string name, bool removedata)
 {
     var m = new ExtraValueModel(table, location);
     m.DeleteStandard(name, removedata);
     return Content("ok");
 }
Пример #22
0
 public ActionResult Delete(string table, int id, string name)
 {
     var m = new ExtraValueModel(id, table, "Standard");
     m.Delete(name);
     return View("Standard", m);
 }
Пример #23
0
 public ActionResult Location(string location, string table, int id, string label)
 {
     var m = new ExtraValueModel(id, table, location);
     ViewBag.EvLocationLabel = label;
     return View(m);
 }
Пример #24
0
 public ActionResult Display(string table, string location, int id)
 {
     var m = new ExtraValueModel(id, table, location);
     return View(location, m);
 }
Пример #25
0
 public ActionResult Bits(string table, int id, string name)
 {
     var m = new ExtraValueModel(id, table);
     return Content(m.DropdownBitsJson(HttpUtility.UrlDecode(name)));
 }
Пример #26
0
 public ActionResult Codes(string table, string name)
 {
     var m = new ExtraValueModel(table);
     return Content(m.CodesJson(HttpUtility.UrlDecode(name)));
 }
Пример #27
0
 public ActionResult ExtraValues(int id)
 {
     var m = new ExtraValueModel(id, "People", "Volunteer");
     ViewBag.EvLocationLabel = DbUtil.Db.Setting("ExtraVolunteerDataLabel", "Extra Volunteer Data");
     return View("/Views/ExtraValue/Location.cshtml", m);
 }
Пример #28
0
 public ActionResult Edit(string table, string type, string pk, string name, string value)
 {
     var m = new ExtraValueModel(pk.ToInt(), table);
     m.EditExtra(type, HttpUtility.UrlDecode(name), value);
     return new EmptyResult();
 }
Пример #29
0
 public ActionResult SwitchMultiline(string table, string location, string name)
 {
     var m = new ExtraValueModel(table, location);
     m.SwitchMultiline(name);
     return View("ListStandard", m);
 }