protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtPeriode.Date = new BLL.Administer.ClosingBll().GetLastClose().AddDays(1); txtPeriode2.Date = DateTime.Today; var branchCode = ((wcf_auth.GeneralUserProfile)Session["userprofile"]).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; var pengirim = new Pertamina.PKBL.BLL.Akuntansi.TransferDanaBankBll().GetKantorCabang(Convert.ToInt32(branchCode)); if (branchCode == "9900" || branchCode == "9999") { chregion1.Text = "AREA SUMBAGUT"; chregion2.Text = "AREA SUMBAGSEL"; chregion3.Text = "AREA JBB"; chregion4.Text = "AREA JATENG-YOGYAKARTA"; chregion5.Text = "AREA JATIM-BALINUS"; chregion6.Text = "AREA KALIMANTAN"; chregion7.Text = "AREA SULAWESI"; chregion8.Text = "AREA MALUKU-PAPUA"; chregion9.Text = "AREA KANTOR PUSAT"; } else { chregion1.Text = pengirim.Rows[0]["branch_name"].ToString(); chregion1.Attributes["data-branch"] = branchCode; chregion2.Visible = false; chregion3.Visible = false; chregion4.Visible = false; chregion5.Visible = false; chregion6.Visible = false; chregion7.Visible = false; chregion8.Visible = false; chregion9.Visible = false; } DataTable data = new DataTable(); data.Columns.Add("province_name", typeof(string)); data.Columns.Add("province_code", typeof(string)); data.Columns.Add("branch_code", typeof(string)); data.PrimaryKey = new DataColumn[] { data.Columns["province_code"] }; DataRow row; row = data.NewRow(); row["province_name"] = "--pilih--"; row["province_code"] = "all"; row["branch_code"] = "0"; data.Rows.InsertAt(row, 0); cbbPropnsi.DataSource = data; cbbPropnsi.TextField = "province_name"; cbbPropnsi.ValueField = "province_code"; cbbPropnsi.DataBind(); cbbPropnsi.SelectedItem = cbbPropnsi.Items.FindByValue("all"); Session["provinsi"] = data; Session["data"] = null; } else { if (Session["data"] != null) { var data = (DataTable)Session["data"]; gv.DataSource = data; gv.DataBind(); } } }
private void initCombo() { var branchCode = ((wcf_auth.GeneralUserProfile)SessionCheck.Check(Response, Session["userprofile"])).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; DataTable dt = new DataTable(); DataRow dr; DataView view; dt.Columns.Add("value", typeof(string)); dt.Columns.Add("text", typeof(string)); dr = dt.NewRow(); dr["value"] = "all"; dr["text"] = "--semua--"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["value"] = "KB"; dr["text"] = "Kas / Bank"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["value"] = "GL"; dr["text"] = "Umum"; dt.Rows.Add(dr); view = new DataView(dt); cbbJenis.DataSource = view; cbbJenis.TextField = "text"; cbbJenis.ValueField = "value"; cbbJenis.DataBind(); if (branchCode == "9900" || branchCode == "9999") { var data = new Pertamina.PKBL.BLL.Administer.MasterKantorCabangBll().GetData(new Hashtable()); var cabang = data.Clone(); cabang.Columns["branch_code"].DataType = typeof(string); foreach (DataRow item in data.Rows) { cabang.ImportRow(item); } dr = cabang.NewRow(); dr["branch_name"] = "--semua--"; dr["branch_code"] = "all"; cabang.Rows.InsertAt(dr, 0); cbbBranch.DataSource = cabang; cbbBranch.TextField = "branch_name"; cbbBranch.ValueField = "branch_code"; cbbBranch.DataBind(); cbbBranch.SelectedItem = cbbBranch.Items.FindByValue("all"); } else { var pengirim = new Pertamina.PKBL.BLL.Akuntansi.TransferDanaBankBll().GetKantorCabang(Convert.ToInt32(branchCode)); cbbBranch.DataSource = pengirim; cbbBranch.TextField = "branch_name"; cbbBranch.ValueField = "branch_code"; cbbBranch.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { roleAuth(); if (!IsPostBack) { gvPerPinjBinLingk.Columns["requestor_address"].ExportWidth = 200; var date = Convert.ToInt32(DateTime.Today.Year.ToString()); DataTable dt = new DataTable(); dt.Columns.Add("text", typeof(string)); dt.Columns.Add("value", typeof(string)); DataRow dr; DataView dv; for (int i = date; i >= 1990; i--) { dr = dt.NewRow(); dr["text"] = i.ToString(); dr["value"] = i; dt.Rows.Add(dr); } dr = dt.NewRow(); dr["text"] = "--pilih--"; dr["value"] = 0; dt.Rows.InsertAt(dr, 0); dv = new DataView(dt); cbbTahun.DataSource = dv; cbbTahun.TextField = "text"; cbbTahun.ValueField = "value"; cbbTahun.DataBind(); cbbTahun.SelectedIndex = 0; txtPeriode.Date = new BLL.Administer.ClosingBll().GetLastClose().AddDays(1); txtSampaii.Date = DateTime.Today; cbbBulan.SelectedItem = cbbBulan.Items.FindByValue("0"); cbbTahun.SelectedItem = cbbTahun.Items.FindByValue("0"); var branchCode = ((wcf_auth.GeneralUserProfile)Session["userprofile"]).mAuthObjectValueList.FirstOrDefault(t => t.mAuthObjectName == "REGION").Value1; var pengirim = new Pertamina.PKBL.BLL.Akuntansi.TransferDanaBankBll().GetKantorCabang(Convert.ToInt32(branchCode)); if (branchCode == "9900" || branchCode == "9999") { chregion1.Text = "AREA SUMBAGUT"; chregion2.Text = "AREA SUMBAGSEL"; chregion3.Text = "AREA JBB"; chregion4.Text = "AREA JATENG-YOGYAKARTA"; chregion5.Text = "AREA JATIM-BALINUS"; chregion6.Text = "AREA KALIMANTAN"; chregion7.Text = "AREA SULAWESI"; chregion8.Text = "AREA MALUKU-PAPUA"; chregion9.Text = "AREA KANTOR PUSAT"; } else { chregion1.Text = pengirim.Rows[0]["branch_name"].ToString(); chregion1.Attributes["data-branch"] = branchCode; chregion2.Visible = false; chregion3.Visible = false; chregion4.Visible = false; chregion5.Visible = false; chregion6.Visible = false; chregion7.Visible = false; chregion8.Visible = false; chregion9.Visible = false; } DataTable data = new DataTable(); data.Columns.Add("province_name", typeof(string)); data.Columns.Add("province_code", typeof(string)); data.Columns.Add("branch_code", typeof(string)); data.PrimaryKey = new DataColumn[] { data.Columns["province_code"] }; DataRow row; row = data.NewRow(); row["province_name"] = "--pilih--"; row["province_code"] = "all"; row["branch_code"] = "0"; data.Rows.InsertAt(row, 0); cbbPropnsi.DataSource = data; cbbPropnsi.TextField = "province_name"; cbbPropnsi.ValueField = "province_code"; cbbPropnsi.DataBind(); cbbPropnsi.SelectedItem = cbbPropnsi.Items.FindByValue("all"); Session["provinsi"] = data; var MasterSektor = new Pertamina.PKBL.BLL.Kemitraan.MasterSektorKemitraanBll().GetData(new Hashtable()); DataTable sektor = MasterSektor.Clone(); sektor.Columns["id"].DataType = typeof(string); foreach (DataRow drow in MasterSektor.Rows) { sektor.ImportRow(drow); } row = sektor.NewRow(); row["sector_name"] = "--pilih--"; row["id"] = "all"; sektor.Rows.InsertAt(row, 0); cbbSektor.DataSource = sektor; cbbSektor.TextField = "sector_name"; cbbSektor.ValueField = "id"; cbbSektor.DataBind(); cbbSektor.SelectedItem = cbbSektor.Items.FindByValue("all"); Session["data"] = null; } else { if (Session["data"] != null) { var data = (DataTable)Session["data"]; gvPerPinjBinLingk.DataSource = data; gvPerPinjBinLingk.DataBind(); } } }