Exemplo n.º 1
0
        private List <MRole> getList(List <DataFilters> filters)
        {
            List <MRole> obj = new List <MRole>();

            using (NpgsqlConnection conn = GetConnection())
            {
                using (NpgsqlCommand com = new NpgsqlCommand())
                {
                    using (NpgsqlDataAdapter oDA = new NpgsqlDataAdapter())
                    {
                        using (DataTable dt = new DataTable())
                        {
                            conn.Open();
                            com.Connection     = conn;
                            com.CommandTimeout = conn.ConnectionTimeout;
                            oDA.SelectCommand  = com;

                            com.CommandText = "select mrole.*" +
                                              " from mrole where 1=1";
                            RepSqlDatabase.OperatorSQL(com, filters);
                            oDA.Fill(dt);

                            obj = (from DataRow x in dt.Rows
                                   select new MRole()
                            {
                                id = RepUtils.NullToInt(x["id"]),
                                role = RepUtils.NullToStr(x["role"]),
                                issupervisor = RepUtils.NullToBool(x["issupervisor"])
                            }).ToList();
                        }
                    }
                }
            }
            return(obj);
        }
Exemplo n.º 2
0
        private List <MAkun> getListAkun(List <DataFilters> filters)
        {
            List <MAkun> obj = new List <MAkun>();

            using (NpgsqlConnection conn = GetConnection())
            {
                using (NpgsqlCommand com = new NpgsqlCommand())
                {
                    using (NpgsqlDataAdapter oDA = new NpgsqlDataAdapter())
                    {
                        using (DataTable dt = new DataTable())
                        {
                            conn.Open();
                            com.Connection     = conn;
                            com.CommandTimeout = conn.ConnectionTimeout;
                            oDA.SelectCommand  = com;

                            com.CommandText = "select makun.*" +
                                              " from makun where 1=1";
                            RepSqlDatabase.OperatorSQL(com, filters);
                            oDA.Fill(dt);

                            obj = (from DataRow x in dt.Rows
                                   select new MAkun()
                            {
                                id = RepUtils.NullToLong(x["id"]),
                                kode = RepUtils.NullToStr(x["kode"]),
                                nama = RepUtils.NullToStr(x["nama"]),
                                idparent = RepUtils.NullToLong(x["idparent"]),
                                iddepartemen = RepUtils.NullToInt(x["iddepartemen"]),
                                keterangan = RepUtils.NullToStr(x["keterangan"]),
                                idtype = RepUtils.NullToInt(x["idtype"]),
                                isdebet = RepUtils.NullToBool(x["isdebet"]),
                                iskasbank = RepUtils.NullToBool(x["iskasbank"]),
                                norekening = RepUtils.NullToStr(x["norekening"]),
                                atasnamarekening = RepUtils.NullToStr(x["atasnamarekening"]),
                                idtypebank = RepUtils.NullToInt(x["idtypebank"]),
                                isneraca = RepUtils.NullToBool(x["isneraca"])
                            }).ToList();
                        }
                    }
                }
            }
            return(obj);
        }
Exemplo n.º 3
0
        private List <MKontak> getListKontak(long iduser, List <DataFilters> filters)
        {
            List <MKontak> obj = new List <MKontak>();

            using (NpgsqlConnection conn = GetConnection())
            {
                using (NpgsqlCommand com = new NpgsqlCommand())
                {
                    using (NpgsqlDataAdapter oDA = new NpgsqlDataAdapter())
                    {
                        using (DataTable dt = new DataTable())
                        {
                            conn.Open();
                            com.Connection     = conn;
                            com.CommandTimeout = conn.ConnectionTimeout;
                            oDA.SelectCommand  = com;

                            com.CommandText = "select mkontak.*" +
                                              " from mkontak inner join mkontakd on mkontakd.idkontak=mkontak.id where mkontakd.iduser=@iduser";
                            com.Parameters.AddWithValue("@iduser", iduser);
                            RepSqlDatabase.OperatorSQL(com, filters);
                            oDA.Fill(dt);

                            obj = (from DataRow x in dt.Rows
                                   select new MKontak()
                            {
                                id = RepUtils.NullToLong(x["id"]),
                                kode = RepUtils.NullToStr(x["kode"]),
                                nama = RepUtils.NullToStr(x["nama"]),
                                alamat1 = RepUtils.NullToStr(x["alamat1"]),
                                alamat2 = RepUtils.NullToStr(x["alamat2"]),
                                alamat3 = RepUtils.NullToStr(x["alamat3"]),
                                hp = RepUtils.NullToStr(x["hp"]),
                                telpon = RepUtils.NullToStr(x["telpon"]),
                                iswhatsapp = RepUtils.NullToBool(x["iswhatsapp"]),
                                norekening = RepUtils.NullToStr(x["norekening"]),
                                atasnamarekening = RepUtils.NullToStr(x["atasnamarekening"]),
                                bank = RepUtils.NullToStr(x["bank"])
                            }).ToList();
                        }
                    }
                }
            }
            return(obj);
        }
        private List <MJenisTransaksi> getList(List <DataFilters> filters)
        {
            List <MJenisTransaksi> obj = new List <MJenisTransaksi>();

            using (NpgsqlConnection conn = GetConnection())
            {
                using (NpgsqlCommand com = new NpgsqlCommand())
                {
                    using (NpgsqlDataAdapter oDA = new NpgsqlDataAdapter())
                    {
                        using (DataTable dt = new DataTable())
                        {
                            conn.Open();
                            com.Connection     = conn;
                            com.CommandTimeout = conn.ConnectionTimeout;
                            oDA.SelectCommand  = com;

                            com.CommandText = "select mjenistransaksi.*" +
                                              " from mjenistransaksi where 1=1";
                            RepSqlDatabase.OperatorSQL(com, filters);
                            oDA.Fill(dt);

                            obj = (from DataRow x in dt.Rows
                                   select new MJenisTransaksi()
                            {
                                id = RepUtils.NullToLong(x["id"]),
                                kode = RepUtils.NullToStr(x["kode"]),
                                nama = RepUtils.NullToStr(x["nama"]),
                                nourut = RepUtils.NullToInt(x["nourut"]),
                                keterangan = RepUtils.NullToStr(x["keterangan"]),
                                jenistransaksid = getDetil(com, oDA, RepUtils.NullToLong(x["id"]))
                            }).ToList();
                        }
                    }
                }
            }
            return(obj);
        }
Exemplo n.º 5
0
        private List <MUser> getListUser(List <DataFilters> filters)
        {
            List <MUser> obj = new List <MUser>();

            using (NpgsqlConnection conn = GetConnection())
            {
                using (NpgsqlCommand com = new NpgsqlCommand())
                {
                    using (NpgsqlDataAdapter oDA = new NpgsqlDataAdapter())
                    {
                        using (DataTable dt = new DataTable())
                        {
                            conn.Open();
                            com.Connection     = conn;
                            com.CommandTimeout = conn.ConnectionTimeout;
                            oDA.SelectCommand  = com;

                            com.CommandText = "select muser.*" +
                                              " from muser where 1=1";
                            RepSqlDatabase.OperatorSQL(com, filters);
                            oDA.Fill(dt);

                            obj = (from DataRow x in dt.Rows
                                   select new MUser()
                            {
                                id = RepUtils.NullToInt(x["id"]),
                                userid = RepUtils.NullToStr(x["userid"]),
                                pwd = "not for publish",
                                nama = RepUtils.NullToStr(x["nama"]),
                                idkontak = RepUtils.NullToInt(x["idkontak"]),
                                idrole = RepUtils.NullToInt(x["idrole"])
                            }).ToList();
                        }
                    }
                }
            }
            return(obj);
        }