AddEditExtraBool() 공개 정적인 메소드

public static AddEditExtraBool ( CmsData.CMSDataContext db, int id, string field, bool value ) : void
db CmsData.CMSDataContext
id int
field string
value bool
리턴 void
예제 #1
0
 public void AddExtraValueBool(object query, string name, bool b)
 {
     using (var db2 = NewDataContext())
         foreach (var pid in db2.PeopleQueryIds(query))
         {
             Person.AddEditExtraBool(db2, pid, name, b);
             db2.SubmitChanges();
         }
 }
예제 #2
0
        public void AddExtraValueBool(object savedQuery, string name, bool b)
        {
            var list = db.PeopleQuery2(savedQuery).Select(ii => ii.PeopleId).ToList();

            foreach (var pid in list)
            {
                Person.AddEditExtraBool(db, pid, name, b);
                db.SubmitChanges();
                ResetDb();
            }
        }
예제 #3
0
        public void AddExtraValueBool(object query, string name, bool b)
        {
            var list = db.PeopleQuery2(query).Select(ii => ii.PeopleId).ToList();

            foreach (var pid in list)
            {
                var db2 = NewDataContext();
                Person.AddEditExtraBool(db2, pid, name, b);
                db2.SubmitChanges();
                db2.Dispose();
            }
        }
예제 #4
0
        private void ProcessExtraValues(CMSDataContext db, Person p, string[] a)
        {
            if (!extravaluenames.Any())
                return;

            foreach (var name in extravaluenames)
            {
                var b = name.Split('.');
                if (name.EndsWith(".txt"))
                    p.AddEditExtraText(b[0], a[names[name]].Trim());
                else if (name.EndsWith(".org"))
                {

                    if (testing)
                        continue;
                    var d = a[names[name]].Trim().Trim();
                    if (!d.HasValue())
                        continue;
                    if (d == "TRUE")
                        d = "Member";
                    var oid = 0;
                    if (orgs.ContainsKey(b[0]))
                        oid = orgs[b[0]];
                    else
                    {
                        var prog = Organization.FetchOrCreateProgram(db, "InsertPeople");
                        var div = Organization.FetchOrCreateDivision(db, prog, "InsertPeople");
                        var o = Organization.FetchOrCreateOrganization(db, div, b[0].SplitUpperCaseToString());
                        oid = o.OrganizationId;
                        orgs.Add(b[0], oid);
                    }
                    var mtid = 0;
                    if (membertypes.ContainsKey(d))
                        mtid = membertypes[d];
                    else
                    {
                        var mt = Organization.FetchOrCreateMemberType(db, d);
                        mtid = mt.Id;
                        membertypes.Add(d, mtid);
                    }
                    OrganizationMember.InsertOrgMembers(db, oid, p.PeopleId, mtid, DateTime.Today, null, false);
                }
                else if (name.EndsWith(".dt"))
                {
                    var d = a[names[name]].Trim().ToDate();
                    if (d.HasValue)
                        p.AddEditExtraDate(b[0], d.Value);
                }
                else if (name.EndsWith(".int"))
                    p.AddEditExtraInt(b[0], a[names[name]].Trim().ToInt());
                else if (name.EndsWith(".bit"))
                {
                    var v = a[names[name]];
                    if (v.HasValue())
                        p.AddEditExtraBool(b[0], v.ToInt() == 1);
                }
                else
                    p.AddEditExtraCode(name, a[names[name]].Trim());
            }
        }