AddEditExtraDate() публичный статический Метод

public static AddEditExtraDate ( CmsData.CMSDataContext db, int id, string field, System.DateTime value ) : void
db CmsData.CMSDataContext
id int
field string
value System.DateTime
Результат void
Пример #1
0
        public void AddExtraValueDate(object query, string name, object dt)
        {
            var dt2 = dt.ToDate();

            using (var db2 = NewDataContext())
                foreach (var pid in db2.PeopleQueryIds(query))
                {
                    Person.AddEditExtraDate(db2, pid, name, dt2);
                    db2.SubmitChanges();
                }
        }
Пример #2
0
        public void AddExtraValueDate(string savedQuery, string name, DateTime dt)
        {
            var list = db.PeopleQuery2(savedQuery).Select(ii => ii.PeopleId).ToList();

            foreach (var pid in list)
            {
                Person.AddEditExtraDate(db, pid, name, dt);
                db.SubmitChanges();
                ResetDb();
            }
        }
Пример #3
0
        public void AddExtraValueDate(object query, string name, object dt)
        {
            var list = db.PeopleQuery2(query).Select(ii => ii.PeopleId).ToList();
            var dt2  = dt.ToDate();

            foreach (var pid in list)
            {
                var db2 = NewDataContext();
                Person.AddEditExtraDate(db2, pid, name, dt2);
                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());
            }
        }