protected void LoadTable() { BL_Client oBL_Client = new BL_Client(); DataTable dt = oBL_Client.Select(null); try { //display table if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { _str = _str + "<tr>" + "<td>" + dt.Rows[i]["APPOINTMENT_ID"].ToString() + "</td>" + "<td>" + dt.Rows[i]["APPOINTMENT_NAME"].ToString() + "</td>" + "<td>" + dt.Rows[i]["PARENT"].ToString() + "</td>" + "<td>" + dt.Rows[i]["LIMIT_MONTH"].ToString() + "</td>" + "<td>" + dt.Rows[i]["LIMIT_YEAR"].ToString() + "</td>" + "<td>" + dt.Rows[i]["STATUS"].ToString() + "</td>" + "<td>" + dt.Rows[i]["CREATED_BY"].ToString() + "</td>" + "<td>" + dt.Rows[i]["CREATED_DATE"].ToString() + "</td>" + "<td>" + dt.Rows[i]["MODIFIED_BY"].ToString() + "</td>" + "<td>" + dt.Rows[i]["MODIFIED_DATE"].ToString() + "</td>" + "<td><a href='AppointmentForm.aspx?ap_id=" + dt.Rows[i]["APPOINTMENT_ID"].ToString() + "'>edit</a></td>" + "<td><a href='AppointmentForm.aspx?dlt_ap_id=" + dt.Rows[i]["APPOINTMENT_ID"].ToString() + "'>delete</a></td>" + "</tr>"; } } } catch (Exception ex) { Label5.Text = ex.Message.ToString(); } }
protected void LoadTable() { BL_Client oBL_Client = new BL_Client(); DataTable dt = oBL_Client.Select(null); try { //display table if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { _str = _str + "<tr>" + "<td>" + dt.Rows[i]["CLIENT_ID"].ToString() + "</td>" + "<td>" + dt.Rows[i]["CLIENT_NAME"].ToString() + "</td>" + "<td>" + dt.Rows[i]["CAR_NAME"].ToString() + "</td>" + "<td>" + dt.Rows[i]["DATE"].ToString() + "</td>" + "<td><a href='WebForm1.aspx?uid=" + dt.Rows[i]["CLIENT_ID"].ToString() + "'>edit</a></td>" + "<td><a href='WebForm1.aspx?Dlt_uid=" + dt.Rows[i]["CLIENT_ID"].ToString() + "'>delete</a></td>" + "</tr>"; } } } catch (Exception ex) { Label1.Text = ex.Message.ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { try { REF_Client oREF_Client = new REF_Client(); oREF_Client.APPOINTMENT_ID = _temp; oREF_Client.APPOINTMENT_NAME = TextBox1.Text; oREF_Client.PARENT = DropDownList1.SelectedItem.Text; oREF_Client.LIMIT_MONTH = Convert.ToInt32(TextBox2.Text); oREF_Client.LIMIT_YEAR = Convert.ToInt32(TextBox2.Text); oREF_Client.STATUS = 1; oREF_Client.CREATED_BY = 1; oREF_Client.CREATED_DATE = DateTime.Now.ToString(); oREF_Client.MODIFIED_BY = 1; oREF_Client.MODIFIED_DATE = DateTime.Now.ToString(); Label5.Text = Convert.ToString(oREF_Client.APPOINTMENT_ID); BL_Client oBL_Client = new BL_Client(); oBL_Client.Insert(oREF_Client, null); //saved LoadTable(); GetAppToDropdwn(); Clear(); } catch (Exception ex) { //pls try again Label5.Text = ex.Message.ToString(); } }
protected void Delete_App(string _dlt_ap_id) { BL_Client oBL_Client = new BL_Client(); try { oBL_Client.DeleteOne(_dlt_ap_id, null); } catch (Exception ex) { Label5.Text = ex.Message.ToString(); } }
protected void LoadRow(string _uid) { BL_Client oBL_Client = new BL_Client(); DataTable dt = oBL_Client.SelectOne(_uid, null); try { //display table if (dt.Rows.Count > 0) { TextBox1.Text = dt.Rows[0]["CLIENT_ID"].ToString(); TextBox2.Text = dt.Rows[0]["CLIENT_NAME"].ToString(); DropDownList1.SelectedValue = dt.Rows[0]["CAR_NAME"].ToString(); Date1.Value = dt.Rows[0]["DATE"].ToString(); } } catch (Exception ex) { Label1.Text = ex.Message.ToString(); } }
protected void getCar() { BL_Client oBL_Client = new BL_Client(); DataTable dt = oBL_Client.SelectCar(null); try { if (dt.Rows.Count != 0) { DropDownList1.DataSource = dt; DropDownList1.DataTextField = "CAR_NAME"; DropDownList1.DataValueField = "CAR_NAME"; DropDownList1.DataBind(); } } catch (Exception ex) { //pls try again Label1.Text = ex.Message.ToString(); } }
protected void Button1_Click(object sender, EventArgs e) { try { REF_Client oREF_Client = new REF_Client(); oREF_Client.CLIENT_ID = Convert.ToInt32(TextBox1.Text); oREF_Client.CLIENT_NAME = TextBox2.Text; oREF_Client.CAR_NAME = DropDownList1.SelectedValue.ToString(); oREF_Client.DATE = Date1.Value; BL_Client oBL_Client = new BL_Client(); oBL_Client.Insert(oREF_Client, null); //saved LoadTable(); } catch (Exception ex) { //pls try again Label1.Text = ex.Message.ToString(); } }
protected void LoadRow(string _ap_id) { BL_Client oBL_Client = new BL_Client(); DataTable dt = oBL_Client.SelectOne(_ap_id, null); Button1.Text = "Update"; try { //display table if (dt.Rows.Count > 0) { _temp = Convert.ToInt32(dt.Rows[0]["APPOINTMENT_ID"]); TextBox1.Text = dt.Rows[0]["APPOINTMENT_NAME"].ToString(); DropDownList1.SelectedItem.Text = dt.Rows[0]["PARENT"].ToString(); TextBox2.Text = dt.Rows[0]["LIMIT_MONTH"].ToString(); TextBox3.Text = dt.Rows[0]["LIMIT_YEAR"].ToString(); } } catch (Exception ex) { Label5.Text = ex.Message.ToString(); } }