Exemplo n.º 1
0
        private void frmKotaBrowse_Load(object sender, EventArgs e)
        {
            try
            {
                if (!SecurityManager.IsManager())
                {
                    cmdAdd.Enabled    = false;
                    cmdEdit.Enabled   = false;
                    cmdDelete.Enabled = false;
                }
                this.Cursor = Cursors.WaitCursor;
                dtProv      = FillComboBox.DBGetProvinsi(Guid.Empty);

                if (dtProv.Rows.Count > 0)
                {
                    dtProv.DefaultView.Sort = "Nama";
                    gridProvinsi.DataSource = dtProv.DefaultView;
                    LoadKota();
                }
                else
                {
                    dtKota.Clear();
                    gridKota.DataSource = dtKota.DefaultView;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
        private void LoadWilayah()
        {
            displayPanel("Wilayah");
            DataTable dtProp, dt;

            if (formMode == enumFormMode.New)
            {
                txtWilArea.Text           = _area;
                dtProp                    = FillComboBox.DBGetProvinsi(Guid.Empty);
                dtProp.DefaultView.Sort   = "Nama ASC";
                cboProvinsi.DisplayMember = "Nama";
                cboProvinsi.ValueMember   = "RowID";
                cboProvinsi.DataSource    = dtProp.DefaultView;
                this.Text                 = "Master Kota";
                this.Title                = "Master Kota";

                // ambil dari app setting
                DataTable dummyPR = new DataTable();
                using (Database dbsubPR = new Database())
                {
                    dbsubPR.Commands.Add(dbsubPR.CreateCommand("usp_AppSetting_LIST"));
                    dbsubPR.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "PROVPEMILIKBPKB"));
                    dummyPR = dbsubPR.Commands[0].ExecuteDataTable();
                    if (dummyPR.Rows.Count > 0)
                    {
                        cboProvinsi.Text = dummyPR.Rows[0]["Value"].ToString();
                    }
                }
                DataTable dummyKT = new DataTable();
                using (Database dbsubKT = new Database())
                {
                    dbsubKT.Commands.Add(dbsubKT.CreateCommand("usp_AppSetting_LIST"));
                    dbsubKT.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "KOTAPEMILIKBPKB"));
                    dummyKT = dbsubKT.Commands[0].ExecuteDataTable();
                    if (dummyKT.Rows.Count > 0)
                    {
                        cboKota.Text = dummyKT.Rows[0]["Value"].ToString();
                    }
                }
            }
            else
            {
                dt     = FillComboBox.DBGetWilayah(_rowID, Guid.Empty, Guid.Empty);
                dtProp = FillComboBox.DBGetProvinsi(Guid.Empty);
                dtProp.DefaultView.Sort   = "Nama ASC";
                cboProvinsi.DisplayMember = "Nama";
                cboProvinsi.ValueMember   = "RowID";
                cboProvinsi.DataSource    = dtProp.DefaultView;
                txtWilArea.Text           = _area;
                _areaRowID        = (Guid)Tools.isNull(dt.Rows[0]["AreaRowID"], "");
                cboProvinsi.Text  = Tools.isNull(dt.Rows[0]["Provinsi"], "").ToString();
                cboKota.Text      = Tools.isNull(dt.Rows[0]["Kota"], "").ToString();
                cboKecamatan.Text = Tools.isNull(dt.Rows[0]["Kecamatan"], "").ToString();
                this.Text         = "Master Kota Update";
                this.Title        = "Master Kota Update";
            }
        }
Exemplo n.º 3
0
        private void LoadProvinsi()
        {
            displayPanel("Provinsi");

            if (formMode == enumFormMode.New)
            {
                txtProvinsi.Text = "";
                this.Text        = "Master Kota";
                this.Title       = "Master Kota";
            }
            else
            {
                DataTable dt = FillComboBox.DBGetProvinsi(_rowID);
                txtProvinsi.Text = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                this.Text        = "Master Kota Update";
                this.Title       = "Master Kota Update";
            }
        }
Exemplo n.º 4
0
        private void frmLapPenjualan_Load(object sender, EventArgs e)
        {
            rangeDateBox1.FromDate       = new DateTime(GlobalVar.GetServerDate.Year, GlobalVar.GetServerDate.Month, 1);
            rangeDateBox1.ToDate         = GlobalVar.GetServerDate;
            cboOrderBy.SelectedIndex     = 0;
            cboStatusLunas.SelectedIndex = 0;
            cboKondisi.SelectedIndex     = 0;
            DataTable dtProp = FillComboBox.DBGetProvinsi(Guid.Empty);

            dtProp.Rows.Add(Guid.Empty, "");
            dtProp.DefaultView.Sort      = "Nama ASC";
            cboProvinsi.DisplayMember    = "Nama";
            cboProvinsi.ValueMember      = "RowID";
            cboProvinsi.DataSource       = dtProp.DefaultView;
            txtStatusKirim.SelectedIndex = 0;

            DataTable dummyPR = new DataTable();

            using (Database dbsubPR = new Database())
            {
                dbsubPR.Commands.Add(dbsubPR.CreateCommand("usp_AppSetting_LIST"));
                dbsubPR.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "PROVPEMILIKBPKB"));
                dummyPR = dbsubPR.Commands[0].ExecuteDataTable();
                if (dummyPR.Rows.Count > 0)
                {
                    cboProvinsi.Text = dummyPR.Rows[0]["Value"].ToString();
                }
            }
            DataTable dummyKT = new DataTable();

            using (Database dbsubKT = new Database())
            {
                dbsubKT.Commands.Add(dbsubKT.CreateCommand("usp_AppSetting_LIST"));
                dbsubKT.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "KOTAPEMILIKBPKB"));
                dummyKT = dbsubKT.Commands[0].ExecuteDataTable();
                if (dummyKT.Rows.Count > 0)
                {
                    cboKota.Text = dummyKT.Rows[0]["Value"].ToString();
                }
            }

            updatePerubahanJenisBayar();
        }
Exemplo n.º 5
0
        private void ListProvinsiDomisili()
        {
            try
            {
                DataTable dt = FillComboBox.DBGetProvinsi(Guid.Empty);

                if (dt.Rows.Count > 0)
                {
                    dt.DefaultView.Sort          = "Nama ASC";
                    cboProvinsiDom.DisplayMember = "Nama";
                    cboProvinsiDom.ValueMember   = "RowID";
                    cboProvinsiDom.DataSource    = dt.DefaultView;
                }
                else
                {
                    dt.Clear();
                    cboProvinsiDom.DataSource = dt;
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }
Exemplo n.º 6
0
        private void frmVendorUpdate_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                this.ListIdentitas();

                if (formMode == enumFormMode.Update)
                {
                    DataTable dt = new DataTable();
                    using (Database db = new Database())
                    {
                        db.Commands.Add(db.CreateCommand("usp_Vendor_LIST"));
                        db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _rowID));
                        dt = db.Commands[0].ExecuteDataTable();

                        txtNama.Text = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                        string _idt = dt.Rows[0]["Identitas"].ToString();
                        switch (Tools.Left(_idt, 1))
                        {
                        case "K":
                            cboIdentitas.SelectedIndex = 1;
                            break;

                        case "S":
                            cboIdentitas.SelectedIndex = 2;
                            break;

                        case "P":
                            cboIdentitas.SelectedIndex = 3;
                            break;
                        }
                        txtNoIdentitas.Text = Tools.isNull(dt.Rows[0]["NoIdentitas"], "").ToString();
                        txtAlamatIdt.Text   = Tools.isNull(dt.Rows[0]["AlamatIdt"], "").ToString();
                        txtRTIdt.Text       = Tools.isNull(dt.Rows[0]["RTIdt"], "").ToString();
                        txtRWIdt.Text       = Tools.isNull(dt.Rows[0]["RWIdt"], "").ToString();

                        DataTable dtProp = FillComboBox.DBGetProvinsi(Guid.Empty);
                        dtProp.DefaultView.Sort      = "Nama ASC";
                        cboProvinsiIdt.DisplayMember = "Nama";
                        cboProvinsiIdt.ValueMember   = "RowID";
                        cboProvinsiIdt.DataSource    = dtProp.DefaultView;
                        cboProvinsiIdt.Text          = Tools.isNull(dt.Rows[0]["ProvinsiIdt"], "").ToString();

                        cboKotaIdt.Text      = Tools.isNull(dt.Rows[0]["KotaIdt"], "").ToString();
                        cboKecamatanIdt.Text = Tools.isNull(dt.Rows[0]["KecamatanIdt"], "").ToString();
                        cboKelurahanIdt.Text = Tools.isNull(dt.Rows[0]["KelurahanIdt"], "").ToString();

                        txtAlamatDom.Text = Tools.isNull(dt.Rows[0]["AlamatDom"], "").ToString();
                        txtRTDom.Text     = Tools.isNull(dt.Rows[0]["RTDom"], "").ToString();
                        txtRWDom.Text     = Tools.isNull(dt.Rows[0]["RWDom"], "").ToString();

                        cboProvinsiDom.DisplayMember = "Nama";
                        cboProvinsiDom.ValueMember   = "RowID";
                        cboProvinsiDom.DataSource    = dtProp.DefaultView;
                        cboProvinsiDom.Text          = Tools.isNull(dt.Rows[0]["ProvinsiDom"], "").ToString();

                        cboKotaDom.Text      = Tools.isNull(dt.Rows[0]["KotaDom"], "").ToString();
                        cboKecamatanDom.Text = Tools.isNull(dt.Rows[0]["KecamatanDom"], "").ToString();
                        cboKelurahanDom.Text = Tools.isNull(dt.Rows[0]["KelurahanDom"], "").ToString();

                        txtTelp.Text       = Tools.isNull(dt.Rows[0]["NoTelp"], "").ToString();
                        txtHP.Text         = Tools.isNull(dt.Rows[0]["NoHP"], "").ToString();
                        txtKeterangan.Text = Tools.isNull(dt.Rows[0]["Keterangan"], "").ToString();
                    }
                }
                else
                {
                    this.ListProvinsiIdentitas();
                    this.ListProvinsiDomisili();

                    /*
                     * DataTable dtn = new DataTable();
                     * dtn.Clear();
                     * cboKecamatanIdt.DataSource = dtn;
                     * cboKecamatanDom.DataSource = dtn;
                     * cboKelurahanIdt.DataSource = dtn;
                     * cboKelurahanDom.DataSource = dtn;
                     */
                    txtNama.Text         = "";
                    txtNoIdentitas.Text  = "";
                    txtAlamatIdt.Text    = "";
                    txtRTIdt.Text        = "";
                    txtRWIdt.Text        = "";
                    cboKelurahanIdt.Text = "";
                    cboKecamatanIdt.Text = "";
                    cboKotaIdt.Text      = "";
                    cboProvinsiIdt.Text  = "";
                    txtAlamatDom.Text    = "";
                    txtRTDom.Text        = "";
                    txtRWDom.Text        = "";
                    cboKelurahanDom.Text = "";
                    cboKecamatanDom.Text = "";
                    cboKotaDom.Text      = "";
                    cboProvinsiDom.Text  = "";
                    txtTelp.Text         = "";
                    txtHP.Text           = "";
                    txtKeterangan.Text   = "";

                    // ambil dari app setting
                    DataTable dummyPR = new DataTable();
                    using (Database dbsubPR = new Database())
                    {
                        dbsubPR.Commands.Add(dbsubPR.CreateCommand("usp_AppSetting_LIST"));
                        dbsubPR.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "PROVPEMILIKBPKB"));
                        dummyPR = dbsubPR.Commands[0].ExecuteDataTable();
                        if (dummyPR.Rows.Count > 0)
                        {
                            cboProvinsiIdt.Text = dummyPR.Rows[0]["Value"].ToString();
                            cboProvinsiDom.Text = dummyPR.Rows[0]["Value"].ToString();
                        }
                    }
                    DataTable dummyKT = new DataTable();
                    using (Database dbsubKT = new Database())
                    {
                        dbsubKT.Commands.Add(dbsubKT.CreateCommand("usp_AppSetting_LIST"));
                        dbsubKT.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "KOTAPEMILIKBPKB"));
                        dummyKT = dbsubKT.Commands[0].ExecuteDataTable();
                        if (dummyKT.Rows.Count > 0)
                        {
                            cboKotaIdt.Text = dummyKT.Rows[0]["Value"].ToString();
                            cboKotaDom.Text = dummyKT.Rows[0]["Value"].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 7
0
        private void frmLeasingUpdate_Load(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (formMode == enumFormMode.Update)
                {
                    DataTable dt = new DataTable();
                    using (Database db = new Database())
                    {
                        db.Commands.Add(db.CreateCommand("usp_Leasing_LIST"));
                        db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _rowID));
                        dt = db.Commands[0].ExecuteDataTable();
                    }
                    txtNama.Text    = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    txtAlamat.Text  = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    txtTelepon.Text = Tools.isNull(dt.Rows[0]["Telepon"], "").ToString();

                    DataTable dt2 = FillComboBox.DBGetProvinsi(Guid.Empty);
                    dt2.DefaultView.Sort      = "Nama ASC";
                    cboProvinsi.DisplayMember = "Nama";
                    cboProvinsi.ValueMember   = "RowID";
                    cboProvinsi.DataSource    = dt2.DefaultView;
                    cboProvinsi.Text          = Tools.isNull(dt.Rows[0]["Provinsi"], "").ToString();

                    Guid      _provRowID = (Guid)cboProvinsi.SelectedValue;
                    DataTable dt3        = FillComboBox.DBGetKota(Guid.Empty, _provRowID);

                    dt3.DefaultView.Sort  = "Nama ASC";
                    cboKota.DisplayMember = "Nama";
                    cboKota.ValueMember   = "RowID";
                    cboKota.DataSource    = dt3.DefaultView;
                    cboKota.Text          = Tools.isNull(dt.Rows[0]["Kota"], "").ToString();
                }
                else
                {
                    DataTable dt = FillComboBox.DBGetProvinsi(Guid.Empty);
                    dt.DefaultView.Sort       = "Nama ASC";
                    cboProvinsi.DisplayMember = "Nama";
                    cboProvinsi.ValueMember   = "RowID";
                    cboProvinsi.DataSource    = dt.DefaultView;

                    Guid      _provRowID = (Guid)cboProvinsi.SelectedValue;
                    DataTable dt2        = FillComboBox.DBGetKota(Guid.Empty, _provRowID);

                    dt2.DefaultView.Sort  = "Nama ASC";
                    cboKota.DisplayMember = "Nama";
                    cboKota.ValueMember   = "RowID";
                    cboKota.DataSource    = dt2.DefaultView;
                    // ambil dari app setting
                    DataTable dummyPR = new DataTable();
                    using (Database dbsubPR = new Database())
                    {
                        dbsubPR.Commands.Add(dbsubPR.CreateCommand("usp_AppSetting_LIST"));
                        dbsubPR.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "PROVPEMILIKBPKB"));
                        dummyPR = dbsubPR.Commands[0].ExecuteDataTable();
                        if (dummyPR.Rows.Count > 0)
                        {
                            cboProvinsi.Text = dummyPR.Rows[0]["Value"].ToString();
                        }
                    }
                    DataTable dummyKT = new DataTable();
                    using (Database dbsubKT = new Database())
                    {
                        dbsubKT.Commands.Add(dbsubKT.CreateCommand("usp_AppSetting_LIST"));
                        dbsubKT.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "KOTAPEMILIKBPKB"));
                        dummyKT = dbsubKT.Commands[0].ExecuteDataTable();
                        if (dummyKT.Rows.Count > 0)
                        {
                            cboKota.Text = dummyKT.Rows[0]["Value"].ToString();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 8
0
        private void frmIdentitasPerusahaan_Load(object sender, EventArgs e)
        {
            try
            {
                dt = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_Perusahaan_LIST"));

                    dt = db.Commands[0].ExecuteDataTable();
                }

                DataTable dtprop = FillComboBox.DBGetProvinsi(Guid.Empty);
                dtprop.DefaultView.Sort   = "Nama ASC";
                cboProvinsi.DisplayMember = "Nama";
                cboProvinsi.ValueMember   = "RowID";
                cboProvinsi.DataSource    = dtprop.DefaultView;

                if (dt.Rows.Count > 0)
                {
                    DataTable dtKota = FillComboBox.DBGetStateAll(Guid.Empty, "", Guid.Empty, Tools.isNull(dt.Rows[0]["Kota"], "").ToString(), Guid.Empty, "", Guid.Empty, "");
                    formMode                = enumFormMode.Update;
                    _rowID                  = (Guid)(dt.Rows[0]["RowID"]);
                    txtCabangID.Text        = Tools.isNull(dt.Rows[0]["CabangID"], "").ToString();
                    txtInitPerusahaan.Text  = Tools.isNull(dt.Rows[0]["InitPerusahaan"], "").ToString();
                    txtNama.Text            = Tools.isNull(dt.Rows[0]["Nama"], "").ToString();
                    txtAlamat.Text          = Tools.isNull(dt.Rows[0]["Alamat"], "").ToString();
                    cboProvinsi.Text        = Tools.isNull(dt.Rows[0]["Propinsi"], "").ToString();
                    cboKota.Text            = Tools.isNull(dt.Rows[0]["Kota"], "").ToString();
                    txtNegara.Text          = Tools.isNull(dt.Rows[0]["Negara"], "").ToString();
                    txtTelp.Text            = Tools.isNull(dt.Rows[0]["Telp"], "").ToString();
                    txtNPWP.Text            = Tools.isNull(dt.Rows[0]["NPWP"], "").ToString();
                    txtEmail.Text           = Tools.isNull(dt.Rows[0]["Email"], "").ToString();
                    txtKodePos.Text         = Tools.isNull(dt.Rows[0]["KodePos"], "").ToString();
                    txtFax.Text             = Tools.isNull(dt.Rows[0]["Fax"], "").ToString();
                    txtWebsite.Text         = Tools.isNull(dt.Rows[0]["Website"], "").ToString();
                    txtPenanggungJawab.Text = Tools.isNull(dt.Rows[0]["PenanggungJawab"], "").ToString();
                    txtNoKTPPJ.Text         = Tools.isNull(dt.Rows[0]["NoKTP_PJ"], "").ToString();
                    txtJabatan.Text         = Tools.isNull(dt.Rows[0]["Jabatan"], "").ToString();
                    txtDirektur.Text        = Tools.isNull(dt.Rows[0]["Direktur"], "").ToString();
                }
                else
                {
                    formMode                = enumFormMode.New;
                    txtCabangID.Text        = "";
                    txtInitPerusahaan.Text  = "";
                    txtNama.Text            = "";
                    txtAlamat.Text          = "";
                    txtNegara.Text          = "";
                    txtTelp.Text            = "";
                    txtNPWP.Text            = "";
                    txtEmail.Text           = "";
                    txtKodePos.Text         = "";
                    txtFax.Text             = "";
                    txtWebsite.Text         = "";
                    txtPenanggungJawab.Text = "";
                    txtNoKTPPJ.Text         = "";
                    txtJabatan.Text         = "";
                    txtDirektur.Text        = "";
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }