Пример #1
0
        public List <GK_OA_WorkLogModel> GetGK_OA_WorkLogList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, DateTime DayWritedEqual, string UserIdEqual, string WeatherEqual, string MoodEqual, string ContextEqual, string WaiterEqual)
        {
            List <GK_OA_WorkLogModel> models        = new List <GK_OA_WorkLogModel>();
            GK_OA_WorkLogQueryModel   objQueryModel = new GK_OA_WorkLogQueryModel();

            objQueryModel.StartRecord    = StartRecord;
            objQueryModel.MaxRecords     = MaxRecords;
            objQueryModel.SortColumns    = SortColumns;
            objQueryModel.CodeEqual      = CodeEqual;
            objQueryModel.DayWritedEqual = DayWritedEqual;
            objQueryModel.UserIdEqual    = UserIdEqual;
            objQueryModel.WeatherEqual   = WeatherEqual;
            objQueryModel.MoodEqual      = MoodEqual;
            objQueryModel.ContextEqual   = ContextEqual;
            objQueryModel.WaiterEqual    = WaiterEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    models = new GK_OA_WorkLogBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Пример #2
0
        public int Delete(GK_OA_WorkLogModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new GK_OA_WorkLogBLL().Delete(ObjModel.Code, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Пример #3
0
        public GK_OA_WorkLogModel GetGK_OA_WorkLog(int Code)
        {
            GK_OA_WorkLogModel model = new GK_OA_WorkLogModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    model = new GK_OA_WorkLogBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Пример #4
0
        public List <GK_OA_WorkLogModel> GetGK_OA_WorkLogListOne(int Code)
        {
            List <GK_OA_WorkLogModel> list = new List <GK_OA_WorkLogModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    GK_OA_WorkLogBLL gbll = new GK_OA_WorkLogBLL();
                    list.Add(gbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Пример #5
0
        public List <GK_OA_WorkLogModel> GetGK_OA_WorkLogList(GK_OA_WorkLogQueryModel QueryModel)
        {
            List <GK_OA_WorkLogModel> models = new List <GK_OA_WorkLogModel>();

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