Example #1
0
        public int Delete(TC_OA_UnusualModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new TC_OA_UnusualBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Example #2
0
        public TC_OA_UnusualModel GetTC_OA_Unusual(int Code)
        {
            TC_OA_UnusualModel model = new TC_OA_UnusualModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new TC_OA_UnusualBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Example #3
0
        public List <TC_OA_UnusualModel> GetTC_OA_UnusualListOne(int Code)
        {
            List <TC_OA_UnusualModel> list = new List <TC_OA_UnusualModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    TC_OA_UnusualBLL lbll = new TC_OA_UnusualBLL();
                    list.Add(lbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #4
0
        public List <TC_OA_UnusualModel> GetTC_OA_UnusualList(TC_OA_UnusualQueryModel QueryModel)
        {
            List <TC_OA_UnusualModel> models = new List <TC_OA_UnusualModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    if (QueryModel == null)
                    {
                        QueryModel = new TC_OA_UnusualQueryModel();
                    }
                    models = new TC_OA_UnusualBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #5
0
        public List <TC_OA_UnusualModel> GetTC_OA_UnusualList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, string ProjectCodeEqual, string ProjectNameEqual, string UserCodeEqual, DateTime ApplayDateEqual, string CoustomTypeEqual, string CoustomNameEqual, string TelephoneEqual, string EmailEqual, string RemarkEqual, string ReasonEqual, string suggestEqual, int AuditingEqual)
        {
            List <TC_OA_UnusualModel> models        = new List <TC_OA_UnusualModel>();
            TC_OA_UnusualQueryModel   objQueryModel = new TC_OA_UnusualQueryModel();

            objQueryModel.StartRecord      = StartRecord;
            objQueryModel.MaxRecords       = MaxRecords;
            objQueryModel.SortColumns      = SortColumns;
            objQueryModel.CodeEqual        = CodeEqual;
            objQueryModel.ProjectCodeEqual = ProjectCodeEqual;
            objQueryModel.ProjectNameEqual = ProjectNameEqual;
            objQueryModel.UserCodeEqual    = UserCodeEqual;
            objQueryModel.ApplayDateEqual  = ApplayDateEqual;
            objQueryModel.CoustomTypeEqual = CoustomTypeEqual;
            objQueryModel.CoustomNameEqual = CoustomNameEqual;
            objQueryModel.TelephoneEqual   = TelephoneEqual;
            objQueryModel.EmailEqual       = EmailEqual;
            objQueryModel.RemarkEqual      = RemarkEqual;
            objQueryModel.ReasonEqual      = ReasonEqual;
            objQueryModel.suggestEqual     = suggestEqual;
            objQueryModel.AuditingEqual    = AuditingEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new TC_OA_UnusualBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }