protected void lbNoteCom_Command(object sender, CommandEventArgs e) { Session["codePK"] = e.CommandName; Session["View"] = false; if (function.GetSelectValue("tbl_claim", "claim_id='" + e.CommandName + "'", "claim_status") != "1") { Session["View"] = true; } Response.Redirect("/Claim/claimDetailForm"); }
protected void FileGridView_RowDeleting(object sender, GridViewDeleteEventArgs e) { string partFile = function.GetSelectValue("tbl_claim_img", "claim_img_id='" + FileGridView.DataKeys[e.RowIndex].Value + "'", "claim_img_url"); string sql_delete = "DELETE FROM tbl_claim_img WHERE claim_img_id = '" + FileGridView.DataKeys[e.RowIndex].Value + "'"; if (function.MySqlQuery(sql_delete)) { if (File.Exists(Server.MapPath(partFile))) { File.Delete(Server.MapPath(partFile)); } BindImg(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] != null) { if (Session["UserCpoint"].ToString() != "0") { Response.Redirect("/Claim/claimForm"); } if (!this.IsPostBack) { if (txtDateOrder.Text == "") { txtDateOrder.Text = DateTime.Now.ToString("dd-MM-") + (DateTime.Now.Year + 543); } if (txtDateSendOrder.Text == "") { txtDateSendOrder.Text = DateTime.Now.ToString("dd-MM-") + (DateTime.Now.Year + 543); txtDateSendOrder_TextChanged(null, null); } PageLoadData(); string sql = "SELECT * FROM tbl_company ORDER BY company_name"; function.getListItem(txtCompany, sql, "company_name", "company_id"); //lbTitle.Text = Session["codePK"].ToString(); sql = "SELECT * FROM tbl_quotations q JOIN tbl_company c ON q.quotations_company_id = c.company_id WHERE q.quotations_claim_id = '" + Session["codePK"].ToString() + "' AND quotations_delete = '0'"; function.getListItem(txtCompanyOrder, sql, "company_name", "company_id"); } if (int.Parse(Session["status_id"].ToString()) >= 3) { if (int.Parse(Session["status_id"].ToString()) != 3) { btnSaveNoteTo.Visible = false; } string[] readText = File.ReadAllLines(HostingEnvironment.MapPath("/Config/") + "ListDocTechno.txt"); int num = 1; foreach (string s in readText) { if (num != 7) { AddControls(num, num + ". " + s + " จำนวน", Panel1); } else { AddControls(num, num + ". " + s + " " + function.GetSelectValue("tbl_claim_com", "claim_id='" + Session["codePK"].ToString() + "'", "claim_detail_insurer") + " จำนวน", Panel1); } num++; } string sql_doc = "SELECT * FROM tbl_quotations q JOIN tbl_company c ON c.company_id = q.quotations_company_id WHERE q.quotations_claim_id = '" + Session["codePK"].ToString() + "'"; MySqlDataReader rs = function.MySqlSelect(sql_doc); while (rs.Read()) { AddControls(num, num + ". ใบประเมินราคาค่าเสียหาย ของ " + rs.GetString("company_name") + " จำนวน", Panel1); num++; } rs.Close(); function.Close(); if (!this.IsPostBack) { getDataStatus3(); } } if (int.Parse(Session["status_id"].ToString()) >= 4) { getDataStatus4(); } if (int.Parse(Session["status_id"].ToString()) >= 5) { getDataStatus5(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["User"] == null) { Response.Redirect("/Login"); } else { lbUser.Text = "ยินดีต้อนรับ : " + Session["UserName"].ToString() + " : " + Session["UserPrivilege"] + " " + function.GetSelectValue("tbl_cpoint", "cpoint_id='" + Session["UserCpoint"].ToString() + "'", "cpoint_name"); if (Session["UserPrivilegeId"].ToString() == "0" || Session["UserPrivilegeId"].ToString() == "1") { nav3.Visible = true; nav4.Visible = true; nav5.Visible = true; nav6.Visible = true; } else { nav3.Visible = false; nav4.Visible = false; nav5.Visible = false; nav6.Visible = false; } if (Session["UserCpoint"].ToString() != "0") { nav0.Visible = false; } } }