private void BindGridView() { DataTable dt = JalanInfomation.getAllRoadInfo(); gvRoadList.DataSource = dt; gvRoadList.DataBind(); }
protected void btnAddRoad_Click(object sender, EventArgs e) { string NoRujukanTempah = ""; DataTable jalan = JalanInfomation.getRoadByID(Convert.ToInt32(ddlJalan.SelectedValue)); JalanTempahInfo tempah = new JalanTempahInfo(); if (!string.IsNullOrEmpty(txtJumHarga.Text)) { tempah.Jumlah = Convert.ToDouble(txtJumHarga.Text); } if (!string.IsNullOrEmpty(txtJumTiang.Text)) { tempah.JumlahTiangTempah = Convert.ToInt32(txtJumTiang.Text); } if (!string.IsNullOrEmpty(txtTarikhMula.Text)) { tempah.TarikhMula = Convert.ToDateTime(txtTarikhMula.Text); } if (!string.IsNullOrEmpty(txtTarikhTamat.Text)) { tempah.TarikhTamat = Convert.ToDateTime(txtTarikhTamat.Text); } JalanTempahInfo.AddTempah(jalan, tempah, out NoRujukanTempah); Session["EventOverall"] = null; Session["SelectedDates"] = null; SetCalendar(tempah.TarikhMula, tempah.TarikhTamat); string sScript0 = "window.alert('Jalan telah ditambah.');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "Page_Load", sScript0, true); }
private void BindGridView(int SelectedRoad) { ClearParameters(); dtJalanInfo = JalanInfomation.getRoadByID(SelectedRoad); gvRoadList.DataSource = dtJalanInfo; gvRoadList.DataBind(); Available = Convert.ToInt32(dtJalanInfo.Rows[0]["Tersedia"].ToString()); hdHargaSeunit.Value = dtJalanInfo.Rows[0]["HargaSeunit"].ToString(); }
private void GetAvailableDate(DateTime tarikhMula, DateTime tarikhTamat, int SelectedMonth, int SelectedYear, out List <EventDetails> EventDates) { EventDates = new List <EventDetails>(); dtJalanInfo = JalanInfomation.getRoadByID(Convert.ToInt32(ddlJalan.SelectedValue)); DataTable dtJalanBooked = JalanInfomation.getBookedByIDAndDates(SelectedRoad, tarikhMula, tarikhTamat); EventDates = EventDetails.getAll(dtJalanBooked, dtJalanInfo, SelectedMonth, SelectedYear); //Session["EventList"] = EventList; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dt = JalanInfomation.getAllRoadInfo(); gvRoadList.DataSource = dt; gvRoadList.DataBind(); } }
protected void btnSearch_Click(object sender, EventArgs e) { int RoadID = Convert.ToInt32(ddlJalan.SelectedValue); DataTable dtJalanList = JalanInfomation.getRoadByID(RoadID); gvRoadList.DataSource = dtJalanList; gvRoadList.DataBind(); lblRecord.Text = dtJalanList.Rows.Count.ToString(); }
protected void btnBatal_Click(object sender, EventArgs e) { if (lblNoRujJalanVal.Text != null) { JalanInfomation.InactiveJalanByID(Convert.ToInt32(lblNoRujJalanVal.Text)); BindGridView(); ClearTextBox(); string sScript0 = "window.alert('Jalan telah di batalkan.');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "Page_Load", sScript0, true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dtJalanList = JalanInfomation.getAllRoadInfo(); ddlJalan.DataValueField = "NoRujukanJalan"; ddlJalan.DataTextField = "NamaJalan"; ddlJalan.DataSource = dtJalanList; ddlJalan.DataBind(); BindGridView(); } }
//public void Page_Init(object sender, EventArgs e) //{ // btnTempah.Click += new EventHandler(this.btnTempah_Click); //} protected void Page_Load(object sender, EventArgs e) { //if(IsPostBack) // { // btnTempah.Click += new EventHandler(this.btnTempah_Click); // } if (!IsPostBack) { DataTable dtJalanList = JalanInfomation.getAllRoadInfo(); ddlJalan.DataValueField = "NoRujukanJalan"; ddlJalan.DataTextField = "NamaJalan"; ddlJalan.DataSource = dtJalanList; ddlJalan.DataBind(); } }
protected void btnKemaskini_Click(object sender, EventArgs e) { JalanInfomation jalanInfo = new JalanInfomation(); if (!string.IsNullOrEmpty(txtNamaJalan.Text)) { jalanInfo.NamaJalan = txtNamaJalan.Text.Trim(); } if (!string.IsNullOrEmpty(txtJumlahTiang.Text)) { jalanInfo.JumlahTiang = Convert.ToInt32(txtJumlahTiang.Text); } if (!string.IsNullOrEmpty(txtJumTiangTersedia.Text)) { jalanInfo.Tersedia = Convert.ToInt32(txtJumTiangTersedia.Text); } if (!string.IsNullOrEmpty(txtJumTiangRosak.Text)) { jalanInfo.Rosak = Convert.ToInt32(txtJumTiangRosak.Text); } if (!string.IsNullOrEmpty(txtJumArm.Text)) { jalanInfo.JumlahArm = Convert.ToInt32(txtJumArm.Text); } if (!string.IsNullOrEmpty(txtSaizGegantung.Text)) { jalanInfo.SaizGegantung = txtSaizGegantung.Text; } if (!string.IsNullOrEmpty(txtHargaSeuinit.Text)) { jalanInfo.HargaSeunit = Convert.ToDouble(txtHargaSeuinit.Text.Trim()); } if (!string.IsNullOrEmpty(txtKosSeunit.Text)) { jalanInfo.HargaKosSeunit = Convert.ToDouble(txtKosSeunit.Text.Trim()); } int RoadID = 0; if (!string.IsNullOrEmpty(lblNoRujJalanVal.Text)) { RoadID = Convert.ToInt32(lblNoRujJalanVal.Text); } JalanInfomation.UpdateJalan(jalanInfo, RoadID); BindGridView(); string sScript0 = "window.alert('Jalan telah dikemaskini.');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "Page_Load", sScript0, true); }
private void BindCalendar(string Month, string Year, string SelectedRoad) { dtJalanBooked = JalanInfomation.getBookedByIDAndMonth(SelectedRoad, Month, Year); int SelectedMonth = AppsCont.getMonthValue(Month.ToUpper()); List <EventDetails> EventList = EventDetails.getAll(dtJalanBooked, dtJalanInfo, SelectedMonth, Convert.ToInt16(Year)); Session["EventList"] = EventList; trCldr1.Visible = true; trCldr2.Visible = true; Calendar1.SelectedDates.Clear(); Calendar1.SelectedDate = new DateTime(EventList[0].Year, EventList[0].Month, EventList[0].Day); Calendar1.VisibleDate = new DateTime(EventList[0].Year, EventList[0].Month, EventList[0].Day); Calendar1.SelectedDayStyle.BackColor = System.Drawing.Color.White; Calendar1.SelectedDayStyle.ForeColor = System.Drawing.Color.Black; this.Calendar1.DayRender += new System.Web.UI.WebControls.DayRenderEventHandler(this.Calendar1_DayRender); }
private void BindToControls(int roadID) { DataTable dtJalan = JalanInfomation.getRoadByID(roadID); if (dtJalan != null) { txtNamaJalan.Text = dtJalan.Rows[0]["NamaJalan"].ToString(); txtJumlahTiang.Text = dtJalan.Rows[0]["JumlahTiang"].ToString(); txtJumTiangRosak.Text = dtJalan.Rows[0]["Rosak"].ToString(); txtJumTiangTersedia.Text = dtJalan.Rows[0]["Tersedia"].ToString(); txtKosSeunit.Text = dtJalan.Rows[0]["HargaKosSeunit"].ToString(); txtHargaSeuinit.Text = dtJalan.Rows[0]["HargaSeunit"].ToString(); txtJumArm.Text = dtJalan.Rows[0]["JumlahArm"].ToString(); txtSaizGegantung.Text = dtJalan.Rows[0]["SaizGegantung"].ToString(); } }
protected void btnTamJalan_Click(object sender, EventArgs e) { JalanInfomation jalanInfo = new JalanInfomation(); if (!string.IsNullOrEmpty(txtNamaJalan.Text)) { jalanInfo.NamaJalan = txtNamaJalan.Text.Trim(); } if (!string.IsNullOrEmpty(txtJumlahTiang.Text)) { jalanInfo.JumlahTiang = Convert.ToInt32(txtJumlahTiang.Text); } if (!string.IsNullOrEmpty(txtJumTiangTersedia.Text)) { jalanInfo.Tersedia = Convert.ToInt32(txtJumTiangTersedia.Text); } if (!string.IsNullOrEmpty(txtJumTiangRosak.Text)) { jalanInfo.Rosak = Convert.ToInt32(txtJumTiangRosak.Text); } if (!string.IsNullOrEmpty(txtJumArm.Text)) { jalanInfo.JumlahArm = Convert.ToInt32(txtJumArm.Text); } if (!string.IsNullOrEmpty(txtSaizGegantung.Text)) { jalanInfo.SaizGegantung = txtSaizGegantung.Text; } if (!string.IsNullOrEmpty(txtHargaSeuinit.Text)) { jalanInfo.HargaSeunit = Convert.ToDouble(txtHargaSeuinit.Text.Trim()); } if (!string.IsNullOrEmpty(txtKosSeunit.Text)) { jalanInfo.HargaKosSeunit = Convert.ToDouble(txtKosSeunit.Text.Trim()); } JalanInfomation.InsertNewJalan(jalanInfo); BindGridView(); string sScript0 = "window.alert('Jalan baru telah dimasukan dalam database.');"; ScriptManager.RegisterClientScriptBlock(Page, GetType(), "Page_Load", sScript0, true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //calendar1.ShowOtherMonthsDays = false; Session["EventList"] = null; Session["UserControl"] = null; DataTable dtJalanList = JalanInfomation.getAllRoadInfo(); ddlJalan.DataValueField = "NoRujukanJalan"; ddlJalan.DataTextField = "NamaJalan"; ddlJalan.DataSource = dtJalanList; ddlJalan.DataBind(); gvRoadList.DataSource = null; gvRoadList.DataBind(); } if (IsPostBack) { if (Session["UserControl"] != null) { List <Control> UscList = CreateControls(); Session["UserControl"] = UscList; } } }
private void BindGridView(string SelectedRoad) { dtJalanInfo = JalanInfomation.getRoadByID(Convert.ToInt32(SelectedRoad)); gvRoadList.DataSource = dtJalanInfo; gvRoadList.DataBind(); }