Exemplo n.º 1
0
        public bool UpdateAgentCustomerDetail(AgentCustomerDetail agentCustomerDetail)
        {
            bool blnValue = true;
            using (var dbContextTransaction = _dbContext.Database.BeginTransaction())
            {
                try
                {
                    _AgentCustomerDetail.Attach(agentCustomerDetail);
                    var entry = _dbContext.Entry(agentCustomerDetail);
                    entry.Property(e => e.CustomerMobileNo).IsModified = true;
                    entry.Property(e => e.CustomerEmailId).IsModified = true;
                    entry.Property(e => e.AgentCustomerName).IsModified = true;
                    entry.Property(e => e.ModifiedDate).IsModified = true;
                    entry.Property(e => e.ModifiedBy).IsModified = true;
                    _dbContext.SaveChanges();
                    dbContextTransaction.Commit();

                }
                catch (Exception)
                {
                    blnValue = false;
                    dbContextTransaction.Rollback();
                }
            }
            return blnValue;
        }
Exemplo n.º 2
0
 public bool SaveAgentCustomerDetail(AgentCustomerDetail agentCustomerDetail)
 {
     bool blnValue = true;
     using (var dbContextTransaction = _dbContext.Database.BeginTransaction())
     {
         try
         {
             _AgentCustomerDetail.Add(agentCustomerDetail);
             _dbContext.SaveChanges();
             dbContextTransaction.Commit();
         }
         catch (Exception)
         {
             blnValue = false;
             dbContextTransaction.Rollback();
         }
     }
     return blnValue;
 }