private void btn_Update_County_Click(object sender, EventArgs e) { if (ddl_New_County_Type.SelectedIndex > 0) { Hashtable hsforSP = new Hashtable(); DataTable dt = new System.Data.DataTable(); //Insert hsforSP.Add("@Trans", "UPDATE_RESEARCH"); hsforSP.Add("@County_Id", County_Id); hsforSP.Add("@Research_County_Type_Id", int.Parse(ddl_New_County_Type.SelectedValue.ToString())); hsforSP.Add("@Research_Subscription_Link", txt_Subscription_Link.Text.ToString()); hsforSP.Add("@Research_County_Modified_By", User_Id); dt = dataaccess.ExecuteSP("Sp_Research_County", hsforSP); MessageBox.Show("County Type Updated Sucessfully"); btn_Clear_Click(sender, e); Bind_Research_Order_History(); foreach (Form f1 in Application.OpenForms) { if (f1.Name == "ReSearch_Order_Allocate") { f1.Close(); break; } } ReSearch_Order_Allocate rs = new ReSearch_Order_Allocate(User_Id, "1"); rs.Refresh(); rs.Show(); this.Close(); } else { MessageBox.Show("Please Select County Type"); } }
private void btn_Submit_Click(object sender, EventArgs e) { if (txt_Comments.Text != "" && txt_FollowupDate.Text != "") { if (btn_Submit.Text == "Submit") { Hashtable htin = new Hashtable(); DataTable dtin = new DataTable(); htin.Add("@Trans", "INSERT"); htin.Add("@Order_Id", Order_Id); htin.Add("@Order_Task", Order_Task_Id); if (txt_FollowupDate.Text != " ") { DateTimeFormatInfo usDtfi = new CultureInfo("en-US", false).DateTimeFormat; DateTime followup_date = Convert.ToDateTime(txt_FollowupDate.Text, usDtfi); htin.Add("@Followup_Date", followup_date); } htin.Add("@Comments", txt_Comments.Text); htin.Add("@Inserted_By", User_Id); dtin = dataaccess.ExecuteSP("Sp_Order_Task_Wise_Comments", htin); MessageBox.Show("Comments Submitted Successfully"); btn_Clear_Click(sender, e); Bind_Research_Order_History(); foreach (Form f1 in Application.OpenForms) { if (f1.Name == "ReSearch_Order_Allocate") { f1.Close(); break; } } ReSearch_Order_Allocate rs = new ReSearch_Order_Allocate(User_Id, "1"); rs.Refresh(); rs.Show(); } else { Hashtable htin = new Hashtable(); DataTable dtin = new DataTable(); htin.Add("@Trans", "UPDATE"); htin.Add("@Order_Id", Order_Id); htin.Add("@Order_Task", Order_Task_Id); htin.Add("@Order_Status_Comment_Id", Order_Status_Comment_Id); if (txt_FollowupDate.Text != " ") { DateTimeFormatInfo usDtfi = new CultureInfo("en-US", false).DateTimeFormat; DateTime followup_date = Convert.ToDateTime(txt_FollowupDate.Text, usDtfi); htin.Add("@Followup_Date", followup_date); } htin.Add("@Comments", txt_Comments.Text); htin.Add("@Inserted_By", User_Id); dtin = dataaccess.ExecuteSP("Sp_Order_Task_Wise_Comments", htin); Hashtable hsforSP = new Hashtable(); DataTable dt = new System.Data.DataTable(); //Insert hsforSP.Add("@Trans", "UPDATE_RESEARCH"); hsforSP.Add("@County_Id", County_Id); hsforSP.Add("@Research_County_Type_Id", int.Parse(ddl_New_County_Type.SelectedValue.ToString())); hsforSP.Add("@Research_Subscription_Link", txt_Subscription_Link.Text.ToString()); hsforSP.Add("@Research_County_Modified_By", User_Id); dt = dataaccess.ExecuteSP("Sp_Research_County", hsforSP); MessageBox.Show("Comments Updated Successfully"); } btn_Clear_Click(sender, e); Bind_Research_Order_History(); this.Close(); } else { MessageBox.Show("Please Enter Comments and Followup Date"); } }