Ejemplo n.º 1
0
 public void UpdateCustomerCode(tblCustomerReference customerReference)
 {
     string sqlQuery = @"UPDATE [dbo].[tblCustomerReference]
                      SET [Name] ='" + customerReference.Name + @"',[CustomerCode] ='" + customerReference.CustomerCode +
                       @"' WHERE ReferenceId =" + customerReference.ReferenceId;
     int noOfRowUpdated = _coreDBEntities.Database.ExecuteSqlCommand(sqlQuery);
 }
Ejemplo n.º 2
0
 public tblCustomerReference AddCustomerReferenceCode(tblCustomerReference customerReference)
 {
     try
     {
         _coreDBEntities.Database.Connection.Open();
         customerReference.CreatedBy  = " Application";
         customerReference.CreateDate = DateTime.Now;
         _coreDBEntities.tblCustomerReferences.Add(customerReference);
         _coreDBEntities.SaveChanges();
     }
     catch (DbEntityValidationException ex)
     {
     }
     return(customerReference);
 }