Beispiel #1
0
        public int Delete(TC_OA_DocumentModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_DocumentBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Beispiel #2
0
        public List <TC_OA_DocumentModel> GetTC_OA_DocumentList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string UserCodeEqual, string UnitCodeEqual, DateTime ApplayDateEqual, string DocumentNameEqual, int AuditingEqual)
        {
            List <TC_OA_DocumentModel> models        = new List <TC_OA_DocumentModel>();
            TC_OA_DocumentQueryModel   objQueryModel = new TC_OA_DocumentQueryModel();

            objQueryModel.StartRecord       = StartRecord;
            objQueryModel.MaxRecords        = MaxRecords;
            objQueryModel.SortColumns       = SortColumns;
            objQueryModel.CodeEqual         = CodeEqual;
            objQueryModel.UserCodeEqual     = UserCodeEqual;
            objQueryModel.UnitCodeEqual     = UnitCodeEqual;
            objQueryModel.ApplayDateEqual   = ApplayDateEqual;
            objQueryModel.DocumentNameEqual = DocumentNameEqual;
            objQueryModel.AuditingEqual     = AuditingEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new TC_OA_DocumentBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Beispiel #3
0
        public TC_OA_DocumentModel GetTC_OA_Document(int Code)
        {
            TC_OA_DocumentModel model = new TC_OA_DocumentModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new TC_OA_DocumentBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Beispiel #4
0
        public List <TC_OA_DocumentModel> GetTC_OA_DocumentListOne(int Code)
        {
            List <TC_OA_DocumentModel> list = new List <TC_OA_DocumentModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_OA_DocumentBLL tbll = new TC_OA_DocumentBLL();
                    list.Add(tbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Beispiel #5
0
        public List <TC_OA_DocumentModel> GetTC_OA_DocumentList(TC_OA_DocumentQueryModel QueryModel)
        {
            List <TC_OA_DocumentModel> models = new List <TC_OA_DocumentModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new TC_OA_DocumentQueryModel();
                    }
                    models = new TC_OA_DocumentBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }