Esempio n. 1
0
 public int Update(ContactIdentificationInfoEntity t, string[] properties = null)
 {
     using (BrightourDbContext db = new BrightourDbContext())
     {
         return(db.Update(t, properties));
     }
 }
Esempio n. 2
0
        public int UpdateIdentificationInfo(IdentificationModel t, string[] paramStrings = null)
        {
            ContactIdentificationInfoEntity contactIdentificationInfoEntity =
                Mapper.Map <IdentificationModel, ContactIdentificationInfoEntity>(t);

            contactIdentificationInfoEntity.LastUpdateTime = DateTime.Now;
            return(_dal.Update(contactIdentificationInfoEntity, paramStrings));
        }
Esempio n. 3
0
        public int AddIdentificationInfo(IdentificationModel t)
        {
            ContactIdentificationInfoEntity contactIdentificationInfoEntity =
                Mapper.Map <IdentificationModel, ContactIdentificationInfoEntity>(t);

            contactIdentificationInfoEntity.LastUpdateTime = DateTime.Now;
            return(_dal.Insert(contactIdentificationInfoEntity));
        }
Esempio n. 4
0
 public int Insert(ContactIdentificationInfoEntity t)
 {
     using (BrightourDbContext db = new BrightourDbContext())
     {
         var log = db.ContactIdentificationInfo.Add(t);
         db.SaveChanges();
         return(log.Contactid);
     }
 }
Esempio n. 5
0
        public AddResultBaseModel <int> Edit(EditContactModel model)
        {
            ContactInfoEntity contactInfoEntity = _contactDal.Find <ContactInfoEntity>(model.ContactId);

            if (model.Cname.Contains("/"))
            {
                contactInfoEntity.Ename = model.Cname;
                contactInfoEntity.Cname = string.Empty;
            }
            else
            {
                contactInfoEntity.Cname = model.Cname;
                contactInfoEntity.Ename = string.Empty;
            }

            contactInfoEntity.Mobile         = model.Mobile;
            contactInfoEntity.LastUpdateTime = DateTime.Now;
            contactInfoEntity.UpdateOid      = "sys";
            contactInfoEntity.DelTime        = DateTime.Now;
            contactInfoEntity.Email          = model.Email;
            if (!string.IsNullOrEmpty(model.IsDel))
            {
                contactInfoEntity.IsDel = model.IsDel;
            }

            _contactDal.Update(contactInfoEntity);

            ContactIdentificationInfoEntity contactIdentificationInfoEntity =
                _contactIdentificationDal.Query <ContactIdentificationInfoEntity>(
                    n => n.Contactid == model.ContactId && n.Iid == model.Iid, true).FirstOrDefault();

            if (contactIdentificationInfoEntity != null)
            {
                contactIdentificationInfoEntity.Iid            = model.Iid;
                contactIdentificationInfoEntity.CardNo         = model.CardNo;
                contactIdentificationInfoEntity.LastUpdateTime = DateTime.Now;
                _contactIdentificationDal.Update(contactIdentificationInfoEntity);
            }
            else
            {
                _contactIdentificationDal.Insert <ContactIdentificationInfoEntity>(new ContactIdentificationInfoEntity()
                {
                    Contactid      = model.ContactId,
                    CardNo         = model.CardNo,
                    Iid            = model.Iid,
                    LastUpdateTime = DateTime.Now
                });
            }

            return(new AddResultBaseModel <int>()
            {
                IsSuccessed = true, Id = model.ContactId
            });
        }
Esempio n. 6
0
 public int Delete(ContactIdentificationInfoEntity t)
 {
     throw new NotImplementedException();
 }