protected void btnSaveQuotations_Click(object sender, EventArgs e) { string sql = "INSERT INTO tbl_quotations (quotations_claim_id,quotations_company_id,quotations_company_price,quotations_note_number,quotations_delete,quotations_date_send,quotations_date_recive,quotations_doc_img,quotations_order,quotations_order_img) VALUES ('" + Session["codePK"].ToString() + "','" + txtCompany.SelectedValue + "','0','" + txtNoteNumber.Text + "','0','" + function.ConvertDateTimeEB(DateTime.Now.ToString("dd-MM-yyyy")).ToString("dd-MM-yyyy") + "','0','0','0','0')"; //string script = ""; if (function.MySqlQuery(sql)) { //script = "บันทึกสำเร็จ"; sql = "SELECT * FROM tbl_status_detail WHERE detail_claim_id='" + Session["codePK"].ToString() + "' AND detail_status_id= '2'"; MySqlDataReader rs = function.MySqlSelect(sql); if (!rs.Read()) { rs.Close(); function.Close(); sql = "INSERT INTO tbl_status_detail (detail_status_id,detail_claim_id,detail_date_start,detail_date_end) VALUES ('2','" + Session["codePK"].ToString() + "','" + function.ConvertDateTimeEB(DateTime.Now.ToString("dd-MM-yyyy")).ToString("dd-MM-yyyy") + "','" + function.ConvertDateTime(function.ConvertDateTimeEB(DateTime.Now.ToString("dd-MM-yyyy")).ToString("dd-MM-yyyy"), Quotations) + "')"; if (function.MySqlQuery(sql)) { sql = "UPDATE tbl_claim SET claim_status = '2' WHERE claim_id = '" + Session["codePK"].ToString() + "'"; function.MySqlQuery(sql); } } rs.Close(); function.Close(); txtNoteNumber.Text = ""; txtCompany.SelectedIndex = 0; Response.Redirect("/Techno/TechnoFormDetail"); } BindConpaney(); //ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('" + script + "')", true); }