Ejemplo n.º 1
0
        public bool UserInsert(ref Article article, List <ArticleAuthors> articleAuthorses,
                               HttpPostedFileBase abstractFileId,
                               HttpPostedFileBase orginalFileId, List <DiscountType> transactionDiscountAttaches, string callbackurl,
                               FormStructure formModel)
        {
            try
            {
                ArticleBO articleBo = new ArticleBO();
                ModelView.InFormEntitiyList <RefereeCartable> keyValuePairs = new ModelView.InFormEntitiyList <RefereeCartable>();
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                PaymentConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                FormGeneratorConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                if (!articleBo.UserInsert(ConnectionHandler, FileManagerConnection,
                                          FormGeneratorConnection, article, articleAuthorses, abstractFileId, orginalFileId,
                                          formModel))
                {
                    return(false);
                }

                if (!articleBo.SendArticle(ConnectionHandler, FileManagerConnection, article, keyValuePairs))
                {
                    return(false);
                }

                article = new ArticleBO().Get(ConnectionHandler, article.Id);
                bool articlePaymnet = new ArticleBO().ArticlePaymnet(ConnectionHandler, PaymentConnection,
                                                                     ref article, transactionDiscountAttaches, callbackurl + article.Id);
                if (!articlePaymnet)
                {
                    throw new Exception(string.Format(Resources.Congress.ErrorInPayArticleAmount,
                                                      Extention.GetAtricleTitle(article.CongressId)));
                }

                ConnectionHandler.CommitTransaction();
                FileManagerConnection.CommitTransaction();
                PaymentConnection.CommitTransaction();
                FormGeneratorConnection.CommitTransaction();
                return(true);
            }
            catch (KnownException ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                PaymentConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            catch (Exception ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                PaymentConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
        public bool SentArticle(Article article, HttpPostedFileBase orginalFileId, FormStructure formModel)
        {
            ModelView.InFormEntitiyList <RefereeCartable> keyValuePairs = new ModelView.InFormEntitiyList <RefereeCartable>();
            bool      result;
            RefereeBO refereeBo = new RefereeBO();

            try
            {
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                FormGeneratorConnection.StartTransaction(IsolationLevel.ReadUncommitted);

                if (orginalFileId != null)
                {
                    article.OrginalFileId =
                        FileManagerComponent.Instance.FileTransactionalFacade(FileManagerConnection)
                        .Insert(orginalFileId);
                }
                new ArticleBO().SetStatus(article);
                ArticleBO articleBo = new ArticleBO();
                FormGeneratorComponent.Instance.FormDataTransactionalFacade(FormGeneratorConnection).ModifyFormData(formModel);
                articleBo.Update(ConnectionHandler, article);
                articleBo.SendArticle(ConnectionHandler, FileManagerConnection, article, keyValuePairs);
                ConnectionHandler.CommitTransaction();
                FileManagerConnection.CommitTransaction();
                FormGeneratorConnection.CommitTransaction();
                result = true;
            }
            catch (KnownException ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            catch (Exception ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            try
            {
                if (result)
                {
                    refereeBo.InformRefereeAddArticle(ConnectionHandler, article.CongressId, keyValuePairs);
                }
            }
            catch (Exception)
            {
            }
            return(result);
        }
Ejemplo n.º 3
0
        public bool AdminUpdate(Guid adminId, Article obj, List <ArticleAuthors> articleAuthorses,
                                string comment, HttpPostedFileBase flowFile, HttpPostedFileBase orginalFileId, HttpPostedFileBase abstractFileId, FormStructure formModel)
        {
            bool      result;
            ArticleBO articleBo = new ArticleBO();

            ModelView.InFormEntitiyList <Article> articles = new ModelView.InFormEntitiyList <Article>();

            try
            {
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                FormGeneratorConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                Article oldsatus = articleBo.Get(ConnectionHandler, obj.Id);
                articleBo.AdminUpdate(ConnectionHandler, FileManagerConnection, FormGeneratorConnection, adminId, obj, articleAuthorses, orginalFileId, abstractFileId, comment, flowFile, formModel);
                ConnectionHandler.CommitTransaction();
                FileManagerConnection.CommitTransaction();
                FormGeneratorConnection.CommitTransaction();
                result = true;
                if (oldsatus.Status != obj.Status)
                {
                    articles.Add(obj, Resources.Congress.ArticleChangeStatusEmail, Resources.Congress.ArticleChangeStatusSMS);
                }
            }
            catch (KnownException ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            catch (Exception ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            try
            {
                articleBo.InformArticle(ConnectionHandler, obj.CongressId, articles);
            }
            catch (Exception)
            {
            }
            return(result);
        }
Ejemplo n.º 4
0
        public bool UserUpdate(Article article, List <ArticleAuthors> articleAuthorses,
                               HttpPostedFileBase abstractFileId,
                               HttpPostedFileBase orginalFileId, FormStructure formModel)
        {
            ArticleBO articleBo = new ArticleBO();

            try
            {
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                FormGeneratorConnection.StartTransaction(IsolationLevel.ReadUncommitted);

                if (
                    !articleBo.UserUpdate(ConnectionHandler, FileManagerConnection,
                                          FormGeneratorConnection, article, articleAuthorses, abstractFileId, orginalFileId,
                                          formModel))
                {
                    return(false);
                }

                ConnectionHandler.CommitTransaction();
                FileManagerConnection.CommitTransaction();
                FormGeneratorConnection.CommitTransaction();
                return(true);
            }
            catch (KnownException ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            catch (Exception ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
        }
Ejemplo n.º 5
0
        public bool UserInsert(Article article, List <ArticleAuthors> articleAuthorses,
                               HttpPostedFileBase abstractFileId,
                               HttpPostedFileBase orginalFileId, FormStructure formModel)
        {
            bool result = false;

            ModelView.InFormEntitiyList <RefereeCartable> keyValuePairs = new ModelView.InFormEntitiyList <RefereeCartable>();
            ModelView.InFormEntitiyList <Article>         articles      = new ModelView.InFormEntitiyList <Article>();
            ArticleBO articleBo = new ArticleBO();

            try
            {
                ConnectionHandler.StartTransaction(IsolationLevel.ReadUncommitted);
                FileManagerConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                FormGeneratorConnection.StartTransaction(IsolationLevel.ReadUncommitted);
                if (
                    !articleBo.UserInsert(ConnectionHandler, FileManagerConnection,
                                          FormGeneratorConnection, article, articleAuthorses, abstractFileId, orginalFileId,
                                          formModel))
                {
                    return(false);
                }

                if (!articleBo.SendArticle(ConnectionHandler, FileManagerConnection, article, keyValuePairs))
                {
                    return(false);
                }

                ConnectionHandler.CommitTransaction();
                FileManagerConnection.CommitTransaction();
                FormGeneratorConnection.CommitTransaction();
                result = true;
                articles.Add(
                    article, Resources.Congress.ArticleInsertEmail,
                    Resources.Congress.ArticleInsertSMS
                    );
            }
            catch (KnownException)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                throw;
            }
            catch (Exception ex)
            {
                ConnectionHandler.RollBack();
                FileManagerConnection.RollBack();
                FormGeneratorConnection.RollBack();
                Log.Save(ex.Message, LogType.ApplicationError, ex.Source, ex.StackTrace);
                throw new KnownException(ex.Message, ex);
            }
            try
            {
                articleBo.InformArticle(ConnectionHandler, article.CongressId, articles);
                new RefereeBO().InformRefereeAddArticle(ConnectionHandler, article.CongressId, keyValuePairs);
            }
            catch (Exception)
            {
            }
            return(result);
        }