Ejemplo n.º 1
0
    //加载所有信息
    public void LoadDataBind()
    {
        DDLPaymentType.DataSource     = Dictionaries.GetDictionaries(DictionariesEnum.支付方式);
        DDLPaymentType.DataValueField = "ID";
        DDLPaymentType.DataTextField  = "Title";
        DDLPaymentType.DataBind();

        //订单信息
        int id = CommonClass.ReturnRequestInt("id", 0);

        orders = OrderService.OrdersService.Get(id);

        if (orders.IsPassing == 1)
        {
            RadioPassing.Checked = true;
        }

        if (orders.IsPassing == 2)
        {
            RadioNoPassing.Checked = true;
        }

        TbPassingReason.Text = orders.PassingReason;

        //支付信息
        List <Expression> express = new List <Expression>();

        express.Add(new Expression("OrderNumber", "=", orders.OrderNumber));
        distribution = OrderService.DistributionService.Get(express);
        DDLPaymentType.SelectedValue = distribution.PaymentID.ToStr();

        RepList.DataSource = OrderService.OrderDetailsService.Search(express);
        RepList.DataBind();
    }
Ejemplo n.º 2
0
        public static List <EmployeeSalary> GetEmployeesSalaryList(string sp_query, DynamicParameters param)
        {
            RepList <EmployeeSalary> repList            = new RepList <EmployeeSalary>();
            List <EmployeeSalary>    employeeSalaryList = repList.returnListClass_SP(sp_query, param);

            return(employeeSalaryList);
        }
Ejemplo n.º 3
0
        public static List <EmployeeMasterModel> GetEmployeeMasterDataList(string sp_query, DynamicParameters param)
        {
            RepList <EmployeeMasterModel> repList             = new RepList <EmployeeMasterModel>();
            List <EmployeeMasterModel>    employeeMaster_List = repList.returnListClass_SP(sp_query, param);

            return(employeeMaster_List);
        }
Ejemplo n.º 4
0
        public int InsertData(TurmaDTO _turmaDTO)
        {
            RepList <TurmaDTO> listProjeto = new RepList <TurmaDTO>();
            RepGen <TurmaDTO>  sqlCommand  = new RepGen <TurmaDTO>();

            string query = "INSERT INTO TB_Turmas VALUES (";
            var    param = new DynamicParameters();

            param.Add("@nomeTurma", _turmaDTO.nomeTurma, DbType.String);
            param.Add("@descricaoTurma", _turmaDTO.descricaoTurma, DbType.String);
            param.Add("@descricaoPeriodo", _turmaDTO.descricaoPeriodo, DbType.String);
            param.Add("@horaInicio", _turmaDTO.horaInicio, DbType.String);
            param.Add("@horaTermino", _turmaDTO.horaTermino, DbType.String);
            param.Add("@idPessoaEducador", _turmaDTO.idPessoaEducador, DbType.Int32);
            param.Add("@dtCadastro", DateTime.Now, DbType.DateTime);
            param.Add("@flagAtivo", _turmaDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", _turmaDTO.idPessoaUltAlteracao, DbType.Int32);
            param.Add("@idProjeto", _turmaDTO.idProjeto, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += "@" + item + ",";
            }

            query = query.Remove(query.Length - 1) + ")";

            query += "; SELECT CAST(scope_identity() AS int)";

            var result = sqlCommand.ExecuteSQLCommand(query, param);

            return(result);
        }
Ejemplo n.º 5
0
        public List <FrequenciaDTO> GetDataInDataBase(FrequenciaDTO objectDTO)
        {
            RepList <FrequenciaDTO> listProjeto = new RepList <FrequenciaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, B.idTurma, B.nomeTurma, C.idProjeto, C.nomeProjeto, D.nomeUsuario as nomePessoaUltAlteracao ";
            query += " FROM TB_Frequencia    A ";
            query += " INNER JOIN TB_Turmas   B ON A.idTurma   = B.idTurma";
            query += " INNER JOIN TB_Projetos C ON B.idProjeto = C.idProjeto";
            query += " LEFT  JOIN TB_Usuarios D ON A.idPessoaUltAlteracao = D.idUsuario";

            if (objectDTO.idFrequencia != 0)
            {
                whereClause += " AND A.idFrequencia = " + objectDTO.idFrequencia.ToString();
            }

            if (objectDTO.idProjeto != 0)
            {
                whereClause += " AND C.idProjeto = " + objectDTO.idProjeto.ToString();
            }

            if (objectDTO.idTurma != 0)
            {
                whereClause += " AND A.idTurma = " + objectDTO.idTurma.ToString();
            }

            query += whereClause;

            return(listProjeto.GetDataInDatabase(query));
        }
Ejemplo n.º 6
0
        public List <PessoaDTO> GetPessoasPorTipoID(int idTipoPessoa)
        {
            RepList <PessoaDTO> listPessoa = new RepList <PessoaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, ";
            query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END ";
            query += " FROM TB_Pessoas          A ";

            if (idTipoPessoa != 0)
            {
                whereClause += " AND idTipoPessoa = " + idTipoPessoa;
            }

            whereClause += " AND flagAtivo = 1";

            //if (objectDTO.flagAtivo != null)
            //    whereClause += " AND flagAtivo like '%" + objectDTO.nomeProjeto + "%'";

            query += whereClause;

            return(listPessoa.GetDataInDatabase(query));
        }
Ejemplo n.º 7
0
        public int UpdateData(ContatoDTO objectDTO)
        {
            RepList <ContatoDTO> listEndereco = new RepList <ContatoDTO>();
            RepGen <ContatoDTO>  sqlCommand   = new RepGen <ContatoDTO>();

            string query = "UPDATE TB_Contatos SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@idPai", objectDTO.idPai, DbType.Int32);
            param.Add("@idMae", objectDTO.idMae, DbType.Int32);
            param.Add("@telefone1", objectDTO.telefone1, DbType.String);
            param.Add("@contato1", objectDTO.contato1, DbType.String);
            param.Add("@telefone2", objectDTO.telefone2, DbType.String);
            param.Add("@contato2", objectDTO.contato2, DbType.String);
            param.Add("@telefone3", objectDTO.telefone3, DbType.String);
            param.Add("@contato3", objectDTO.contato3, DbType.String);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idContato = " + objectDTO.idContato.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
Ejemplo n.º 8
0
        public int InsertData(EscolaDTO objectDTO)
        {
            RepList <EscolaDTO> listProjeto = new RepList <EscolaDTO>();
            RepGen <EscolaDTO>  sqlCommand  = new RepGen <EscolaDTO>();

            string query = "INSERT INTO TB_ESCOLAS VALUES (";
            var    param = new DynamicParameters();

            param.Add("@nomeEscola", objectDTO.nomeEscola, DbType.String);
            param.Add("@observacoes", objectDTO.observacoes, DbType.String);
            param.Add("@idEndereco", objectDTO.idEndereco, DbType.Int32);
            param.Add("@dtCadastro", DateTime.Now, DbType.DateTime);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += "@" + item + ",";
            }

            query = query.Remove(query.Length - 1) + ")";

            query += "; SELECT CAST(scope_identity() AS int)";

            var result = sqlCommand.ExecuteSQLCommand(query, param);

            return(result);
        }
Ejemplo n.º 9
0
        public int UpdateData(EscolaDTO objectDTO)
        {
            RepList <EscolaDTO> listProjeto = new RepList <EscolaDTO>();
            RepGen <EscolaDTO>  sqlCommand  = new RepGen <EscolaDTO>();

            string query = "UPDATE TB_ESCOLAS SET ";

            string where = string.Empty;

            var param = new DynamicParameters();

            param.Add("@nomeEscola", objectDTO.nomeEscola, DbType.String);
            param.Add("@observacoes", objectDTO.observacoes, DbType.String);
            param.Add("@idEndereco", objectDTO.idEndereco, DbType.Int32);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += " " + item + " = @" + item + ",";
            }

            query = query.Remove(query.Length - 1);

            where += " WHERE idEscola = " + objectDTO.idEscola.ToString();
            query += where;

            var result = sqlCommand.ExecuteSQL(query, param);

            return(result);
        }
Ejemplo n.º 10
0
        public List <DashboardDTO> GetAlunosPorBairro()
        {
            RepList <DashboardDTO> resultList = new RepList <DashboardDTO>();

            string query       = string.Empty;
            string whereClause = "";

            query += " SELECT id = B.idBairro, displayName = C.bai_no, displayCount = COUNT(1)";
            query += " FROM TB_Pessoas           A";
            query += " INNER JOIN TB_Enderecos   B ON A.idEndereco = B.idEndereco";
            query += " INNER JOIN TB_CEP_Bairro  C ON B.idBairro = C.bai_nu_sequencial";
            query += " GROUP BY B.idBairro, C.bai_no";

            /*
             * if (objectDTO.idPessoa != 0)
             *  whereClause += " AND A.idPessoa = " + objectDTO.idPessoa.ToString();
             *
             * if (!string.IsNullOrEmpty(objectDTO.nomePessoa))
             *  whereClause += " AND A.nomePessoa like '%" + objectDTO.nomePessoa + "%'";
             */

            //query += whereClause;

            return(resultList.GetDataInDatabase(query));
        }
Ejemplo n.º 11
0
        public List <EscolaDTO> GetDataInDataBase(EscolaDTO objectDTO)
        {
            RepList <EscolaDTO> listPessoa = new RepList <EscolaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, B.*, C.nomeUsuario as nomePessoaUltAlteracao, ";
            query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END ";
            query += " FROM TB_ESCOLAS          A ";
            query += " LEFT JOIN TB_ENDERECOS   B ON A.idEndereco = B.idEndereco";
            query += " LEFT JOIN TB_Usuarios    C ON A.idPessoaUltAlteracao = C.idUsuario";

            if (objectDTO.idEscola != 0)
            {
                whereClause += " AND A.idEscola = " + objectDTO.idEscola.ToString();
            }

            if (!string.IsNullOrEmpty(objectDTO.nomeEscola))
            {
                whereClause += " AND A.nomeEscola like '%" + objectDTO.nomeEscola + "%'";
            }

            query += whereClause;

            return(listPessoa.GetDataInDatabase(query));
        }
Ejemplo n.º 12
0
    //加载所有信息
    public void LoadDataBind()
    {
        int pageSize    = AspNetPager1.PageSize;
        int recordCount = 0;
        int pageIndex   = ViewState["PageIndex"].ToInt();

        List <Expression> expression = new List <Expression>();

        //只显示已销售的订单
        expression.Add(new Expression("OrderStateID", "=", "6"));

        if (ViewState["StartDate"] != null)
        {
            expression.Add(new Expression("OrderDate", ">=", ViewState["StartDate"].ToStr()));
        }

        if (ViewState["EndDate"] != null)
        {
            expression.Add(new Expression("OrderDate", "<=", ViewState["EndDate"].ToStr()));
        }

        var list = OrderService.OrdersService.Search(pageSize, pageIndex, expression, "orderDate desc", ref recordCount);

        RepList.DataSource = list;
        RepList.DataBind();
    }
Ejemplo n.º 13
0
        public int UpdateData(List <DadosVariaveisDTO> listObj, int idPessoa)
        {
            RepList <PessoaDTO> listProjeto = new RepList <PessoaDTO>();
            RepGen <PessoaDTO>  sqlCommand  = new RepGen <PessoaDTO>();

            // ************************
            // DELETE
            // ************************
            var param = new DynamicParameters();

            param.Add("@idPessoa", idPessoa, DbType.String);

            var result = sqlCommand.ExecuteSQLCommand("delete TB_PessoaDV where idPessoa = @idPessoa", param);

            // ************************
            // INSERT
            // ************************

            foreach (var item in listObj)
            {
                var param2 = new DynamicParameters();
                param2.Add("@idPessoa", idPessoa, DbType.String);
                param2.Add("@idDadoVariavel", item.idDadoVariavel, DbType.Int32);

                result = sqlCommand.ExecuteSQLCommand("INSERT INTO TB_PessoaDV (idPessoa, idDadoVariavel) VALUES (@idPessoa, @idDadoVariavel)", param2);
            }

            return(result);
        }
Ejemplo n.º 14
0
        public static object GetScalarValue(string sql_query, DynamicParameters param)
        {
            RepList <object> repList      = new RepList <object>();
            object           returnScalar = repList.returnScalar(sql_query, param);

            return(returnScalar);
        }
Ejemplo n.º 15
0
    //加载所有信息
    public void LoadDataBind()
    {
        int pageSize    = AspNetPager1.PageSize;
        int recordCount = 0;
        int pageIndex   = ViewState["PageIndex"].ToInt();

        int categoryId = 0;

        if (!string.IsNullOrEmpty(Request["categoryId"]))
        {
            categoryId = Request["categoryId"].ToInt();
        }
        else
        {
            categoryId = ProductCategory.CategoryId;
        }

        List <Expression> expression = new List <Expression>();

        if (categoryId > 0)
        {
            expression.Add(new Expression("ProCategoryId", "=", categoryId));
        }

        RepList.DataSource = ProductService.PropertiesService.Search(pageSize, pageIndex, expression, " OrderBy asc,AddDate desc", ref recordCount);
        RepList.DataBind();
        AspNetPager1.RecordCount = recordCount;
    }
Ejemplo n.º 16
0
        public List <ClassObjects.users> allRecords(ClassObjects.users _usuario)
        {
            RepList <ClassObjects.users> lista = new RepList <ClassObjects.users>();
            DynamicParameters            param = new DynamicParameters();

            return(lista.returnListClass("users_SelectAll", param));
        }
        public List <DailyShift> GetAllDailyShifts()
        {
            RepList <DailyShift> lista = new RepList <DailyShift>();
            DynamicParameters    param = new DynamicParameters();

            return(lista.returnListClass("SELECT * FROM DailyShifts", param));
        }
Ejemplo n.º 18
0
    //加载所有信息
    public void LoadDataBind()
    {
        int pageSize    = AspNetPager1.PageSize;
        int recordCount = 0;
        int pageIndex   = ViewState["PageIndex"].ToInt();

        TB_Order_Orders   order      = new TB_Order_Orders();
        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("IsDelete", "=", "1"));

        if (Request.QueryString["state"] != null)
        {
            int state = CommonClass.ReturnRequestInt("state", 0);
            expression.Add(new Expression("OrderStateID", "=", state.ToStr()));
        }

        var list = OrderService.OrdersService.Search(pageSize, pageIndex, expression, ref recordCount);

        if (ViewState["StartDate"] != null && ViewState["EndDate"] != null)
        {
            expression.Add(new Expression("OrderDate", ">=", ViewState["StartDate"].ToStr()));
            expression.Add(new Expression("OrderDate", "<=", ViewState["EndDate"].ToStr()));

            list = list.Where(o => o.OrderDate >= Convert.ToDateTime(ViewState["StartDate"]) && o.OrderDate <= Convert.ToDateTime(ViewState["EndDate"])).ToList();
        }

        RepList.DataSource = list;
        RepList.DataBind();
    }
Ejemplo n.º 19
0
        public int InsertData(ContatoDTO objectDTO)
        {
            RepList <ContatoDTO> listProjeto = new RepList <ContatoDTO>();
            RepGen <ContatoDTO>  sqlCommand  = new RepGen <ContatoDTO>();

            string query = "INSERT INTO TB_Contatos VALUES (";
            var    param = new DynamicParameters();

            param.Add("@idPai", objectDTO.idPai, DbType.Int32);
            param.Add("@idMae", objectDTO.idMae, DbType.Int32);
            param.Add("@telefone1", objectDTO.telefone1, DbType.String);
            param.Add("@contato1", objectDTO.contato1, DbType.String);
            param.Add("@telefone2", objectDTO.telefone2, DbType.String);
            param.Add("@contato2", objectDTO.contato2, DbType.String);
            param.Add("@telefone3", objectDTO.telefone3, DbType.String);
            param.Add("@contato3", objectDTO.contato3, DbType.String);

            foreach (var item in param.ParameterNames)
            {
                query += "@" + item + ",";
            }

            query = query.Remove(query.Length - 1) + ")";

            query += "; SELECT CAST(scope_identity() AS int)";

            var result = sqlCommand.ExecuteSQLCommand(query, param);

            return(result);
        }
Ejemplo n.º 20
0
        public List <MatriculaDTO> GetSituacaoAluno(MatriculaDTO objectDTO)
        {
            RepList <MatriculaDTO> listResult = new RepList <MatriculaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.idPessoa, A.nomePessoa, A.dtNascimento, B.descGenero, C.nomeUsuario as nomePessoaUltAlteracao, D.descTipoPessoa, ";
            query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END, ";
            query += " qtdeMatricula = (SELECT COUNT(1) FROM TB_Matricula E WHERE E.idPessoa = A.idPessoa AND E.dtCancelamento is null) ";
            query += " FROM TB_Pessoas          A ";
            query += " LEFT JOIN TB_Generos     B ON A.idGenero = B.idGenero";
            query += " LEFT JOIN TB_Usuarios    C ON A.idPessoaUltAlteracao = C.idUsuario";
            query += " LEFT JOIN TB_TipoPessoas D ON A.idTipoPessoa = D.idTipoPessoa";

            if (objectDTO.idPessoa != 0)
            {
                whereClause += " AND A.idPessoa = " + objectDTO.idPessoa.ToString();
            }

            if (!string.IsNullOrEmpty(objectDTO.nomePessoa))
            {
                whereClause += " AND A.nomePessoa like '%" + objectDTO.nomePessoa + "%'";
            }

            if (objectDTO.idTipoPessoa != 0)
            {
                whereClause += " AND A.idTipoPessoa = " + objectDTO.idTipoPessoa;
            }

            query += whereClause;

            return(listResult.GetDataInDatabase(query));
        }
Ejemplo n.º 21
0
        public List <TurmaDTO> GetDataInDataBase(TurmaDTO _turmaDTO)
        {
            RepList <TurmaDTO> listTurma = new RepList <TurmaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, A.HoraInicio + ' às ' + A.HoraTermino as horario, B.nomeProjeto, C.nomeUsuario as nomePessoaUltAlteracao, D.nomePessoa as nomeEducador,";
            query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END ";
            query += " FROM TB_Turmas A ";
            query += " LEFT JOIN TB_Projetos B ON A.idProjeto = B.idProjeto";
            query += " LEFT JOIN TB_Usuarios C ON A.idPessoaUltAlteracao = C.idUsuario";
            query += " LEFT JOIN TB_Pessoas  D ON A.idPessoaEducador = D.idPessoa";

            if (_turmaDTO.idTurma != 0)
            {
                whereClause += " AND A.idTurma = " + _turmaDTO.idTurma.ToString();
            }

            if (!string.IsNullOrEmpty(_turmaDTO.nomeTurma))
            {
                whereClause += " AND A.nomeTurma like '%" + _turmaDTO.nomeTurma + "%'";
            }

            query += whereClause;

            return(listTurma.GetDataInDatabase(query));
        }
Ejemplo n.º 22
0
        public List <MatriculaDTO> GetDataInDataBase(MatriculaDTO objectDTO)
        {
            RepList <MatriculaDTO> listPessoa = new RepList <MatriculaDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, B.nomePessoa, C.nomeTurma, D.nomeProjeto, C.HoraInicio, C.HoraTermino";
            //query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END ";
            query += " FROM TB_Matricula        A ";
            query += " LEFT JOIN TB_Pessoas     B ON A.idPessoa   = B.idPessoa";
            query += " LEFT JOIN TB_Turmas      C ON A.idTurma    = C.idTurma";
            query += " LEFT JOIN TB_Projetos    D ON C.idProjeto  = D.idProjeto";

            if (objectDTO.idPessoa != 0)
            {
                whereClause += " AND A.idPessoa = " + objectDTO.idPessoa.ToString();
            }

            //if (objectDTO.flagAtivo != null)
            //    whereClause += " AND flagAtivo like '%" + objectDTO.nomeProjeto + "%'";

            query += whereClause;

            return(listPessoa.GetDataInDatabase(query));
        }
Ejemplo n.º 23
0
    //加载所有信息
    public void LoadDataBind()
    {
        int id = CommonClass.ReturnRequestInt("id", 0);

        orders = OrderService.OrdersService.Get(id);

        if (orders.IsPassing == 1)
        {
            RadioPassing.Checked = true;
        }

        if (orders.IsPassing == 2)
        {
            RadioNoPassing.Checked = true;
        }

        TbPassingReason.Text = orders.PassingReason;

        List <Expression> express = new List <Expression>();

        express.Add(new Expression("OrderNumber", "=", orders.OrderNumber));

        distribution = OrderService.DistributionService.Get(express);

        RepList.DataSource = OrderService.OrderDetailsService.Search(express);
        RepList.DataBind();
    }
Ejemplo n.º 24
0
        public List <user> allRecords(user _user)
        {
            RepList <user>    lista = new RepList <user>();
            DynamicParameters param = new DynamicParameters();

            return(lista.returnListClass("users_SelectAll", param));
        }
Ejemplo n.º 25
0
        public static EmployeeSalary GetEmployeeSalary(string sp_query, DynamicParameters param)
        {
            RepList <EmployeeSalary> repList        = new RepList <EmployeeSalary>();
            EmployeeSalary           employeeSalary = repList.returnClass_SP(sp_query, param);

            return(employeeSalary);
        }
Ejemplo n.º 26
0
        public List <ProjetoDTO> GetDataInDataBase(ProjetoDTO objectDTO)
        {
            RepList <ProjetoDTO> listProjeto = new RepList <ProjetoDTO>();

            string query       = string.Empty;
            string whereClause = " WHERE 1 = 1 ";

            query += " SELECT A.*, B.nomeUsuario as nomePessoaUltAlteracao, ";
            query += " descricaoAtivo = CASE WHEN A.flagAtivo = 1 then 'Ativo' else 'Desativado' END ";
            query += " FROM TB_Projetos      A ";
            query += " LEFT JOIN TB_Usuarios B ON A.idPessoaUltAlteracao = B.idUsuario";

            if (objectDTO.idProjeto != 0)
            {
                whereClause += " AND A.idProjeto = " + objectDTO.idProjeto.ToString();
            }

            if (objectDTO.nomeProjeto != string.Empty)
            {
                whereClause += " AND A.nomeProjeto like '%" + objectDTO.nomeProjeto + "%'";
            }

            if (objectDTO.flagAtivo == true)
            {
                whereClause += " AND A.flagAtivo = 1";
            }

            query += whereClause;

            return(listProjeto.GetDataInDatabase(query));
        }
Ejemplo n.º 27
0
        public static List <EmployeeAttendance_Get_Model> EmployeeAttendance_Get(string sp_query, DynamicParameters param)
        {
            RepList <EmployeeAttendance_Get_Model> repList             = new RepList <EmployeeAttendance_Get_Model>();
            List <EmployeeAttendance_Get_Model>    empAttendanceModels = repList.returnListClass_SP(sp_query, param);

            return(empAttendanceModels);
        }
Ejemplo n.º 28
0
        public int InsertData(ProjetoDTO objectDTO)
        {
            RepList <ProjetoDTO> listProjeto = new RepList <ProjetoDTO>();
            RepGen <ProjetoDTO>  sqlCommand  = new RepGen <ProjetoDTO>();

            string query = "INSERT INTO TB_Projetos VALUES (";
            var    param = new DynamicParameters();

            param.Add("@nomeProjeto", objectDTO.nomeProjeto, DbType.String);
            param.Add("@descricaoProjeto", objectDTO.descricaoProjeto, DbType.String);

            param.Add("@dtInicio", objectDTO.dtInicio, DbType.Date);
            param.Add("@dtTermino", objectDTO.dtTermino, DbType.Date);

            //param.Add("@idPessoaResposavel", objectDTO.idPessoaResposavel, DbType.Int32);
            param.Add("@nomeResposavel", objectDTO.nomeResposavel, DbType.String);
            param.Add("@dtCadastro", DateTime.Now, DbType.DateTime);
            param.Add("@flagAtivo", objectDTO.flagAtivo, DbType.Boolean);
            param.Add("@dtUltAlteracao", DateTime.Now, DbType.DateTime);
            param.Add("@idPessoaUltAlteracao", objectDTO.idPessoaUltAlteracao, DbType.Int32);

            foreach (var item in param.ParameterNames)
            {
                query += "@" + item + ",";
            }

            query = query.Remove(query.Length - 1) + ")";

            query += "; SELECT CAST(scope_identity() AS int)";

            var result = sqlCommand.ExecuteSQLCommand(query, param);

            return(result);
        }
Ejemplo n.º 29
0
        public static async Task <List <EmployeeMasterModel> > GetEmployeeMasterDataList_Async(string sp_query, DynamicParameters param)
        {
            RepList <EmployeeMasterModel> repList             = new RepList <EmployeeMasterModel>();
            List <EmployeeMasterModel>    employeeMaster_List = await repList.returnListClass_SP_Async(sp_query, param);

            return(employeeMaster_List);
        }
Ejemplo n.º 30
0
    //加载所有信息
    public void LoadDataBind()
    {
        int pageSize    = AspNetPager1.PageSize;
        int recordCount = 0;
        int pageIndex   = ViewState["PageIndex"].ToInt();

        List <Expression> expression = new List <Expression>();

        expression.Add(new Expression("ProName", "like", TbKey.Text.Trim()));
        if (DDLMark.SelectedValue != "")
        {
            expression.Add(new Expression("Mark", "like", DDLMark.SelectedValue));
        }
        if (CategoryId.CategoryID != 0)
        {
            expression.Add(new Expression("CategoryID", "=", CategoryId.CategoryID.ToStr()));
        }
        if (TbStartDate.Text.Trim() != string.Empty)
        {
            expression.Add(new Expression("AddDate", ">=", TbStartDate.Text));
        }
        if (TbStopDate.Text.Trim() != string.Empty)
        {
            DateTime stopDate = Convert.ToDateTime(TbStopDate.Text).AddDays(1);
            expression.Add(new Expression("AddDate", "<", stopDate.ToShortDateString()));
        }
        List <TB_Product_Products> list = ProductService.ProductsService.Search(pageSize, pageIndex, expression, " Id desc,AddDate desc", ref recordCount);

        RepList.DataSource = list;
        RepList.DataBind();
        AspNetPager1.RecordCount = recordCount;
    }