Exemplo n.º 1
0
        public static OrgMemberExtra GetExtraValue(CMSDataContext db, int oid, int pid, string field)
        {
            //field = field.Replace('/', '-');
            var q = from v in db.OrgMemberExtras
                    where v.Field == field
                    where v.OrganizationId == oid
                    where v.PeopleId == pid
                    select v;
            var ev = q.SingleOrDefault();

            if (ev == null)
            {
                ev = new OrgMemberExtra()
                {
                    OrganizationId  = oid,
                    PeopleId        = pid,
                    Field           = field,
                    TransactionTime = DateTime.Now
                };
                db.OrgMemberExtras.InsertOnSubmit(ev);
            }
            return(ev);
        }
Exemplo n.º 2
0
 private void detach_OrgMemberExtras(OrgMemberExtra entity)
 {
     this.SendPropertyChanging();
     entity.OrganizationMember = null;
 }