private int DeleteTblGlCashTransactionDetailCostCenter(TblGlCashTransactionDetailCostCenter row, int index, string company)
        {
            using (var entity = new ccnewEntities(GetSqlConnectionString(company)))
            {
                var query = (from e in entity.TblGlCashTransactionDetailCostCenters
                             where e.Iserial == row.Iserial
                             select e).SingleOrDefault();
                if (query != null)
                {
                    entity.DeleteObject(query);
                }

                entity.SaveChanges();
            }
            return(row.Iserial);
        }
 private TblGlCashTransactionDetailCostCenter UpdateOrInsertTblGlCashTransactionDetailCostCenters(TblGlCashTransactionDetailCostCenter newRow, bool save, int index, out int outindex, string company)
 {
     outindex = index;
     using (var entity = new ccnewEntities(GetSqlConnectionString(company)))
     {
         if (save)
         {
             entity.TblGlCashTransactionDetailCostCenters.AddObject(newRow);
         }
         else
         {
             var oldRow = (from e in entity.TblGlCashTransactionDetailCostCenters
                           where e.Iserial == newRow.Iserial
                           select e).SingleOrDefault();
             if (oldRow != null)
             {
                 GenericUpdate(oldRow, newRow, entity);
             }
         }
         entity.SaveChanges();
         return(newRow);
     }
 }