public static void CleanUp()
 {
     //O indicador não deveria ser deletado, mas como é um teste...
     var repository = new DefaultRepository<Indicador>(NHibernateHelper.OpenSession());
     var indicadores = repository.GetAll().Where(v => v.Nome.Contains("Teste"));
     foreach (var indicador in indicadores)
         repository.Delete(indicador);
 }
Esempio n. 2
0
 public void Delete(Filial filial)
 {
     using (var session = NHibernateHelper.OpenSession())
     {
         var filialRepository = new DefaultRepository<Filial>(session);
         filialRepository.Delete(filial);
     }
 }
Esempio n. 3
0
 public void Delete(Usuario usuario)
 {
     using (var session = NHibernateHelper.OpenSession())
     {
         var visaoRepository = new DefaultRepository<Usuario>(session);
         visaoRepository.Delete(usuario);
     }
 }
Esempio n. 4
0
 public void Delete(Visao visao)
 {
     using (var session = NHibernateHelper.OpenSession())
     {
         var visaoRepository = new DefaultRepository<Visao>(session);
         visaoRepository.Delete(visao);
     }
 }
Esempio n. 5
0
        public void Delete(Indicador indicador)
        {
            using (var session = NHibernateHelper.OpenSession())
            {
                ValidarVinculoComVisao(indicador, session);

                var repository = new DefaultRepository<Indicador>(session);
                repository.Delete(indicador);
            }
        }
Esempio n. 6
0
        void IFieldRepository.Delete(int id)
        {
            using (var scope = new QPConnectionScope())
            {
                try
                {
                    if (QPContext.DatabaseType == DatabaseType.SqlServer)
                    {
                        ChangeCleanEmptyLinksTriggerState(scope.DbConnection, false);
                        ChangeRemoveFieldTriggerState(scope.DbConnection, false);
                        ChangeReorderFieldsTriggerState(scope.DbConnection, false);
                        ChangeDeleteContentLinkTriggerState(scope.DbConnection, false);
                    }

                    var field = GetById(id);
                    field.ReorderContentFields(true);
                    var      isVirtual = field.Content.IsVirtual;
                    FieldDAL dal       = GetDal(field);

                    DefaultRepository.Delete <FieldDAL>(id);

                    if (!isVirtual)
                    {
                        Common.DropColumn(scope.DbConnection, dal);
                        DropLinkWithCheck(scope.DbConnection, dal);
                    }
                }
                finally
                {
                    if (QPContext.DatabaseType == DatabaseType.SqlServer)
                    {
                        ChangeCleanEmptyLinksTriggerState(scope.DbConnection, true);
                        ChangeRemoveFieldTriggerState(scope.DbConnection, true);
                        ChangeReorderFieldsTriggerState(scope.DbConnection, true);
                        ChangeDeleteContentLinkTriggerState(scope.DbConnection, true);
                    }
                }
            }
        }
Esempio n. 7
0
 internal static void Delete(int id)
 {
     DefaultRepository.Delete <ContentDAL>(id);
 }
Esempio n. 8
0
 public void Remove(int id)
 {
     DefaultRepository.Delete <WorkflowPermissionDAL>(id);
 }
Esempio n. 9
0
 /// <summary>
 /// Удаляет версию статьи
 /// </summary>
 /// <param name="id">ID версии</param>
 internal static void Delete(int id)
 {
     DefaultRepository.Delete <ArticleVersionDAL>(id);
 }
 public void Remove(int id)
 {
     DefaultRepository.Delete <EntityTypePermissionDAL>(id);
 }
Esempio n. 11
0
        public bool SaleOrderUpload(List <string> billNos)
        {
            var             auditType = AuditEnums.提交同步;
            ICPOBILLAuditor auditor   = new ICPOBILLAuditor("System", auditType);
            var             err       = auditor.CheckOption(billNos, auditType);



            if (!err.Equals(""))
            {
                throw new ArgumentException(err);
            }

            var token  = CommonToken.GetToken();
            var http   = new ArrowInterface.ArrowInterface();
            var Helper = new OracleDBHelper();

            string where = $" AND LHOUTSYSTEMOD IN ('{string.Join("','", billNos)}')";
            var bills = Helper.GetWithWhereStr <SaleOrderUploadParam>(where);

            bills.ForEach(b =>
            {
                var details = Helper.GetWhere(new SaleOrderUploadDetailedParam()
                {
                    lHOutSystemID = b.lHOutSystemID
                }).ToArray();

                b.saleOrderItemList = details;
            });

            List <string> errors = new List <string>();

            bills.ForEach(b =>
            {
                var conn = Helper.GetNewConnection();
                conn.Open();
                var tran = conn.BeginTransaction();
                try
                {
                    var result = http.SaleOrderUpload(token.Token, b);

                    if (result.Success)
                    {
                        var saleorderRepository = new DefaultRepository <Order>(DBTypeEnums.ORACLE);


                        ///返写箭牌销售单号到本地采购订单表ICPOBILL的FDesBillNo字段
                        var whereStr = $" AND FBILLNO='{b.lHOutSystemOd}'";
                        var icpobill = Helper.GetWithTranWithWhereStr <ICPOBILLMODEL>(whereStr, tran)
                                       .SingleOrDefault();

                        saleorderRepository.Delete(new { lHOutSystemID = b.lHOutSystemID }, tran);

                        foreach (var row in result.item.AsParallel())
                        {
                            Helper.InsertWithTransation(row, tran);

                            icpobill.FDesBillNo = row.orderNo;
                        }

                        //更新本地采购订单表ICPOBILL
                        icpobill.FSTATUS     = (int)ICPOBILLStatus.关闭;
                        icpobill.FSYNCSTATUS = (int)ICPOBILLSyneStatus.已同步;
                        Helper.UpdateWithTransation(icpobill, tran);
                    }
                    else
                    {
                        errors.Add($"单据【{b.lHOutSystemOd}】上传失败:{result.Message}");
                    }

                    tran.Commit();
                    conn.Close();
                }
                catch (Exception e)
                {
                    tran.Rollback();
                    conn.Close();
                    var message = $"销售订单【{b.lHOutSystemOd}】上传失败:{e.Message}";
                    LogHelper.Info(message);
                    LogHelper.Error(e);
                    throw;
                }
            });

            if (errors.Count > 0)
            {
                throw new Exception(string.Join("\r\n", errors));
            }

            return(true);
        }
 public void Remove(int id)
 {
     DefaultRepository.Delete <SiteFolderPermissionDAL>(id);
 }
Esempio n. 13
0
 public void Remove(int id)
 {
     DefaultRepository.Delete <ArticlePermissionDAL>(id);
 }
Esempio n. 14
0
 public void Remove(int id)
 {
     DefaultRepository.Delete <BackendActionPermissionDAL>(id);
 }
Esempio n. 15
0
 void IFieldRepository.Delete(int id)
 {
     DefaultRepository.Delete <FieldDAL>(id);
 }
 public void MultipleRemove(IEnumerable <int> ids)
 {
     DefaultRepository.Delete <ContentPermissionDAL>(ids.ToArray());
 }
Esempio n. 17
0
 public void MultipleRemove(IEnumerable <int> IDs)
 {
     DefaultRepository.Delete <WorkflowPermissionDAL>(IDs.ToArray());
 }
 public void Remove(int id)
 {
     DefaultRepository.Delete <ContentPermissionDAL>(id);
 }
Esempio n. 19
0
 /// <summary>
 /// Удаляет версии статьи
 /// </summary>
 /// <param name="ids">массив ID версий</param>
 internal static void MultipleDelete(int[] ids)
 {
     DefaultRepository.Delete <ArticleVersionDAL>(ids.ToArray());
 }