protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater2.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton1"); Label lbHomeId = (Label)item.FindControl("Label1"); if (lbHomeId != null) { string param_homeid = lbHomeId.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { //Execute string sql_command = "EXEC [set_Project_02_Home] '" + param_projid + "','" + param_homeid + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Response.Write("<script>alert('Insert Data 02 Success');</script>"); Response.Redirect("CreateProject_03_01?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); //Response.Write("<script>alert('Insert Data 02 Please Contract Admin');</script>"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { TextBox tbNumMM = (TextBox)item.FindControl("TextBox1"); Label lbflooringType = (Label)item.FindControl("Label2"); if (lbflooringType != null) { string param_flooringType = lbflooringType.Text.Trim(); if (tbNumMM != null && tbNumMM.Text.Trim() != "0") { string param_numMM = tbNumMM.Text.Trim(); string sql_command = " EXEC [dbo].[set_Project_03_06_Flooring] " + " '" + param_projid + "','" + param_flooringType + "','" + param_numMM + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_07?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton1"); Label lbplumbingType = (Label)item.FindControl("Label1"); if (lbplumbingType != null) { string param_plumbingType = lbplumbingType.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_09_Plumbing] " + " '" + param_projid + "','" + param_plumbingType + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Update Spec ClassConfig.UpdateSpec(param_projid, "", userID); //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_10?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { TextBox tbNumRoom = (TextBox)item.FindControl("TextBox2"); TextBox tbNumMM = (TextBox)item.FindControl("TextBox3"); Label lbFloorType = (Label)item.FindControl("Label1"); Repeater rpFlooringType = (Repeater)item.FindControl("Repeater2"); if (lbFloorType != null) { string param_floorType = lbFloorType.Text.Trim(); string param_numRoom = string.Empty; if (tbNumRoom != null) { param_numRoom = tbNumRoom.Text.Trim(); } else { param_numRoom = "0"; } if (tbNumMM != null) { string param_numMM = tbNumMM.Text.Trim(); string param_flooringType = ""; foreach (RepeaterItem itemF in rpFlooringType.Items) { RadioButton rbSelect = (RadioButton)itemF.FindControl("RadioButton1"); Label lbFlooringType = (Label)itemF.FindControl("Label2"); if (rbSelect != null && rbSelect.Checked == true) { param_flooringType = lbFlooringType.Text; } } string sql_command = " EXEC [set_Project_03_03-06_Floor_New] " + " '" + param_projid + "','" + param_flooringType + "','" + param_floorType + "','" + param_numMM + "','" + param_numRoom + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Function Min Max string sql_min_max = " EXEC [dbo].[set_min_max_all] '" + param_projid + "', '" + userID + "' "; ClassConfig.GetDataSQL(sql_min_max); //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_04?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { //RadioButtonList rbSelect = (RadioButtonList)item.FindControl("RadioButtonList1"); Label lbRoofStyle = (Label)item.FindControl("Label1"); Label lbRoofType = (Label)item.FindControl("Label2"); RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton1"); if (lbRoofStyle != null && lbRoofType != null) { string param_roofStyle = lbRoofStyle.Text.Trim(); string param_roofType = lbRoofType.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_04_Roof] " + " '" + param_projid + "','" + param_roofStyle + "','" + param_roofType + "','" + userID + "','All'"; ClassConfig.GetDataSQL(sql_command); } // foreach (ListItem li in rbSelect.Items) // { //if (rbSelect != null && li.Selected == true) //{ //string param_roofType = li.Value.ToString().Trim(); //string sql_command = " EXEC [dbo].[set_Project_03_04_Roof] " // + " '" + param_projid + "','" + param_roofStyle + "','" + param_roofType + "','" + userID + "'"; //ClassConfig.GetDataSQL(sql_command); //} } } //Update Spec ClassConfig.UpdateSpec(param_projid, "", userID); //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_05?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton1"); Label lbindoorType = (Label)item.FindControl("Label2"); if (lbindoorType != null) { string param_indoorType = lbindoorType.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_10_Ceiling] " + " '" + param_projid + "','INDOOR','" + param_indoorType + "','" + getMM3() + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } foreach (RepeaterItem item in Repeater2.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton2"); Label lboutdoorType = (Label)item.FindControl("Label4"); if (lboutdoorType != null) { string param_outdoorType = lboutdoorType.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_10_Ceiling] " + " '" + param_projid + "','OUTDOOR','" + param_outdoorType + "','" + (double.Parse(getMM3(), CultureInfo.InvariantCulture) * 0.45).ToString() + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Update Spec ClassConfig.UpdateSpec(param_projid, "", userID); //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_11?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { foreach (RepeaterItem item in Repeater1.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton1"); Label lbwindoorType = (Label)item.FindControl("Label2"); if (lbwindoorType != null) { string param_windoorType = lbwindoorType.Text.Trim(); string param_Num = lbdoor1.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_14_WinDoor] " + " '" + param_projid + "',N'ประตูภายใน','" + param_windoorType + "','" + param_Num + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } foreach (RepeaterItem item in Repeater2.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton2"); Label lbwindoorType = (Label)item.FindControl("Label2"); if (lbwindoorType != null) { string param_windoorType = lbwindoorType.Text.Trim(); string param_Num = lbdoor2.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_14_WinDoor] " + " '" + param_projid + "',N'ประตูห้องน้ำ','" + param_windoorType + "','" + param_Num + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } foreach (RepeaterItem item in Repeater3.Items) { RadioButton rbSelect = (RadioButton)item.FindControl("RadioButton3"); Label lbwindoorType = (Label)item.FindControl("Label2"); if (lbwindoorType != null) { string param_windoorType = lbwindoorType.Text.Trim(); string param_Num = lbwin1.Text.Trim(); if (rbSelect != null && rbSelect.Checked == true) { string sql_command = " EXEC [dbo].[set_Project_03_14_WinDoor] " + " '" + param_projid + "',N'หน้าต่าง','" + param_windoorType + "','" + param_Num + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); } } } //Update Status ClassConfig.UpdateStatus(param_projid, "On Progress", userID); //Redirect Response.Redirect("CreateProject_03_15?id=" + param_projid); } catch (Exception) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { //Get val form control string param_free = tbfree.Text.Trim(); string param_promotion = tbpromotion.Text.Trim(); string param_other = tbother.Text.Trim(); string param_detail = tbdetail.Text.Trim(); string sql_command = " EXEC [dbo].[set_Project_03_15_Money] " + " '" + param_projid + "','" + param_free + "','" + param_promotion + "','" + param_other + "',N'" + param_detail + "','" + userID + "' "; ClassConfig.GetDataSQL(sql_command); //Update Payment Term foreach (RepeaterItem item in Repeater1.Items) { Label lbTerm = (Label)item.FindControl("Label1"); TextBox tbDetail = (TextBox)item.FindControl("tbDetail"); TextBox tbPCT = (TextBox)item.FindControl("tbPCT"); string param_payment_term = lbTerm.Text.Trim(); string param_payment_detail = tbDetail.Text.Trim(); string param_payment_PCT = tbPCT.Text.Trim(); sql_command = " EXEC [dbo].[set_Project_03_15_TermPayment] " + " '" + param_projid + "','" + param_payment_term + "','" + param_payment_PCT + "', N'" + param_payment_detail + "','" + userID + "'"; ClassConfig.GetDataSQL(sql_command); } //Update Attach List (2019-12-31) string Attach01 = tbComment01.Text.Trim().Replace("'", ""); string Attach02 = tbComment02.Text.Trim().Replace("'", ""); string Attach03 = tbComment03.Text.Trim().Replace("'", ""); string Attach04 = tbComment04.Text.Trim().Replace("'", ""); string Attach05 = tbComment05.Text.Trim().Replace("'", ""); string Attach06 = tbComment06.Text.Trim().Replace("'", ""); string Attach07 = tbComment07.Text.Trim().Replace("'", ""); string Attach08 = tbComment08.Text.Trim().Replace("'", ""); string Attach09 = tbComment09.Text.Trim().Replace("'", ""); string Attach10 = tbComment10.Text.Trim().Replace("'", ""); string sqlText = " EXEC [dbo].[set_Project_03_17_Text] '" + param_projid + "', " + "N'" + Attach01 + "'," + "N'" + Attach02 + "'," + "N'" + Attach03 + "'," + "N'" + Attach04 + "'," + "N'" + Attach05 + "'," + "N'" + Attach06 + "'," + "N'" + Attach07 + "'," + "N'" + Attach08 + "'," + "N'" + Attach09 + "'," + "N'" + Attach10 + "' "; ClassConfig.GetDataSQL(sqlText); //Update Status ClassConfig.UpdateStatus(param_projid, "Complete", userID); //New Requirement string sql = " EXEC [BESTBoQ].[dbo].[set_Last_Price] '" + param_projid + "' "; ClassConfig.GetDataSQL(sql); //generate_doc genContract = new generate_doc(); //genContract.GenerateContract(param_projid); //Redirect Response.Redirect("Project_Detail.aspx?r=estimateComplete&id=" + param_projid); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); //Response.Write("<script>alert('Insert Data 01 Please Contract Admin');</script>"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { //Get val form control string param_projectname = tbProjectName.Text.Trim(); string param_projecttype = ddProjectType.SelectedValue.ToString().Trim(); string param_customer = tbCustomerName.Text.Trim(); string[] param_time = tbStartProject.Text.Trim().Split('/'); string param_startproject = param_time[2] + param_time[1] + param_time[0]; string param_country = ddCountry.SelectedValue.ToString().Trim(); string param_province = ddProvince.SelectedValue.ToString().Trim(); string param_address = tbAddress.Text.Trim(); string param_spec = rbCostFunction.SelectedValue.ToString().Trim(); string param_phoneCus = tbTelephoneCus.Text.Trim(); string param_emailCus = tbEmailCus.Text.Trim(); string param_idCus = tbCusID.Text.Trim(); string[] param_birth = tbBirthdate.Text.Trim().Split('/'); string param_birthDate = param_birth[2] + param_birth[1] + param_birth[0]; //Execute Command try { string param_command = " EXEC [dbo].[set_Project_01_Desc] N'" + param_projid + "',N'" + param_projectname + "',N'" + param_customer + "',N'" + param_projecttype + "',N'" + param_country + "',N'" + param_province + "',N'" + param_address + "', '" + param_startproject + "',N'" + userID + "' ,N'" + param_phoneCus + "' ,N'" + param_emailCus + "' ,'" + param_birthDate + "' ,N'" + param_idCus + "' "; DataTable dtResult = ClassConfig.GetDataSQL(param_command); if (dtResult.Rows.Count > 0) { string id = dtResult.Rows[0]["projectid"].ToString(); //Update Status ClassConfig.UpdateStatus(id, "On Progress", userID); param_command = "EXEC [dbo].[set_Project_Spec] '" + id + "','" + param_spec + "','" + userID + "' "; dtResult = ClassConfig.GetDataSQL(param_command); Response.Redirect("CreateProject_02?id=" + id); } //Response.Write("<script>alert('Insert Data 01 Success');</script>"); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "$('#alertError').show();", true); //Response.Write("<script>alert('Insert Data 01 Please Contract Admin');</script>"); } }