예제 #1
0
        public List <ATTACHMENTDC> Insert(List <ATTACHMENTDC> objATTACHMENTs)
        {
            List <ATTACHMENTDC> attachmentsList = new List <ATTACHMENTDC>();
            DBConnection        objConnection   = new DBConnection();
            ATTACHMENTDA        objATTACHMENTDA = new ATTACHMENTDA();

            try
            {
                var attachments = SetNecessaryFields(objATTACHMENTs);
                objConnection.Open(true);
                attachmentsList = objATTACHMENTDA.Insert(objConnection, attachments);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(attachmentsList);
        }
예제 #2
0
        public ATTACHMENTDC Insert(ATTACHMENTDC objATTACHMENT)
        {
            ATTACHMENTDC addedAttachmentdc;
            DBConnection objConnection   = new DBConnection();
            ATTACHMENTDA objATTACHMENTDA = new ATTACHMENTDA();

            try
            {
                objConnection.Open(true);
                objATTACHMENT.FILE_SIZE = TransformFileSize(objATTACHMENT.FILE_SIZE);
                addedAttachmentdc       = objATTACHMENTDA.Insert(objConnection, objATTACHMENT);
                objConnection.Commit();
            }
            catch (Exception ex)
            {
                objConnection.Rollback();
                throw ex;
            }
            finally
            {
                objConnection.Close();
            }
            return(addedAttachmentdc);
        }