public selectlabel_test() { InitializeComponent(); dcore = new DataCoreLibrary(); DataControls.LoadComboBoxData(cmbunit, DataDefinition.GetUnitTab(), "UNITNAME", "REFNUM"); cmbunit.SelectedValue = 0; }
public navy_search(string id13, string name, string sname, string status, string mode) { dcore = new DataCoreLibrary(); InitializeComponent(); DataControls.LoadComboBoxData(cmbselectaddress, DataDefinition.GetUnitTab(), "unitname", "REFNUM"); if (!string.IsNullOrEmpty(txtid13.Text.Trim())) { id13 = txtid13.Text.Trim(); } else if (!string.IsNullOrEmpty(id13)) { txtid13.Text = id13; } if (!string.IsNullOrEmpty(txtname.Text.Trim())) { name = txtname.Text.Trim(); } else if (!string.IsNullOrEmpty(name)) { txtname.Text = name; } if (!string.IsNullOrEmpty(txtlname.Text.Trim())) { sname = txtlname.Text.Trim(); } else if (!string.IsNullOrEmpty(sname)) { txtlname.Text = sname; } mode_search = mode; GetData(id13, name, sname, status); }
public PeopleForm(string mode, string id13) { modes = mode; townnameManage_old = new DataControls.TownnameTab(); townnameManage = new DataControls.TownnameTab(); dcore = new DataCoreLibrary(); InitializeComponent(); //dp_indate.Format = DateTimePickerFormat.Custom; //dp_indate.CustomFormat = " "; //dp_outdate.Format = DateTimePickerFormat.Custom; //dp_outdate.CustomFormat = " "; cardid = id13; townnameManage.LoadProvinceToComboBox(cmbprovince, ""); townnameManage.LoadProvinceToComboBox(cmbprovince_old, ""); //townnameManage.LoadCityToComboBox(cmbdistrict, ""); //townnameManage.LoadTumbonToComboBox(cmbsub_district, ""); if (modes == "new") { chkout.Enabled = false; } else { chkout.Enabled = true; } // DataControls.LoadComboBoxData(cmbselectaddress, DataDefinition.GetUnitmoreTab(), "unit_name", "unit_id"); // DataControls.LoadComboBoxData(cmbselect_out, DataDefinition.Getstatusmore(), "status_name", "status_id"); GetData(id13); // UploadExhibitor(); }
protected void UpdateNLabel() { string number_label = string.Empty; int checkcount = 0; int num = 0;// เช็คหมายเลขฉลาก string ID = string.Empty; string Nlabel = string.Empty; dcoreUpdateUsedPerson = new DataCoreLibrary(); // List<string> Nlabel = new List<string>(); foreach (DataRow dr in personTable.Rows) { if (checkcount % totalnumber_label == 0) { number_label = arr_new[num]; ID = dr["NAVYID"].ToString(); Nlabel = number_label; dcoreUpdateUsedPerson.UpdateNLabelPerson(ID, Nlabel); num++; } else { ID = dr["NAVYID"].ToString(); Nlabel = number_label; dcoreUpdateUsedPerson.UpdateNLabelPerson(ID, Nlabel); } checkcount++; } }
private void btnDelete_Click(object sender, EventArgs e) { if (gvResult.SelectedRows.Count > 0) { if (MessageBox.Show("ต้องการลบข้อมูลของบุคคลนี้ ใช่หรือไม่", "ลบข้อมูล", MessageBoxButtons.YesNo) == DialogResult.Yes) { try { string navyid = gvResult.SelectedRows[0].Cells["navyid"].Value.ToString(); string id13 = gvResult.SelectedRows[0].Cells["id13"].Value.ToString(); if (dcore.DeletePerson(navyid)) { DataCoreLibrary dcore2 = new DataCoreLibrary(); dcore2.ChangeDB("midb"); dcore2.UpdatePersonUnUsed(id13); MessageBox.Show("ลบข้อมูลเรียบร้อย"); Search(gvResult); } else { MessageBox.Show("ไม่สามารถลบข้อมูลได้"); } } catch (Exception ex) { MessageBox.Show("พบข้อผิดพลาดในการลบข้อมูล .. " + ex.Message); } } } else { MessageBox.Show("กรุณาเลือกข้อมูล ก่อนทำการลบ"); } }
public SearchNivyForm(string id13) { InitializeComponent(); tempInput = new InputSearchPersonNivy(); inputSearch = new SearchPersonNivyInputControl2(); inputSearch.Dock = DockStyle.Top; inputSearch.SearchButtonClick += new EventHandler(SearchPersonNivy_ButtonSubmitClick); groupBox1.Controls.Add(inputSearch); btnNextPage.Enabled = false; btnPrevPage.Enabled = false; pictureBox1.Visible = false; try { Control[] c = (inputSearch.Controls.Find("textBoxID13", true)); if (c.Length > 0) { ((TextBox)c[0]).Text = id13; //SearchPersonNivy_ButtonSubmitClick(null, null); dcore = new DataCoreLibrary(); Search(); gvResult.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSearch_Click(object sender, EventArgs e) { dcore = new DataCoreLibrary(); //System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(Search)); //thread.Start(); Search(); //gvResult.Focus(); }
public LostInformation() { InitializeComponent(); dcore = new DataCoreLibrary(); reportViewer1.LocalReport.Refresh(); mtxtYearin.Focus(); mtxtYearin.SelectAll(); }
public AddSubUnit() { dcore = new DataCoreLibrary(); townnameManage_old = new DataControls.TownnameTab(); InitializeComponent(); townnameManage_old.LoadProvinceToComboBox(cmbprovince_old, ""); DataControls.LoadComboBoxData(cmbUnit, DataDefinition.GetUnitmoreTab(), "unit_name", "unit_id"); }
public ReportAddressMore() { InitializeComponent(); dcore = new DataCoreLibrary(); DataControls.LoadComboBoxData(cmbselectaddress, DataDefinition.GetUnitTab(), "UNITNAME", "REFNUM"); }
public PreAdderss() { dcore = new DataCoreLibrary(); dcoreUpdateUsedPerson = new DataCoreLibrary(); QueryString.Search query = new QueryString.Search(); InitializeComponent(); rdedit.Checked = true; }
public View_Indictment(string navyid) { InitializeComponent(); dcore = new DataCoreLibrary(); //dcore.ChangeDB("navdb"); // rcore = new ReportCoreLibrary(); this.navyid = navyid; GetandSetInitialForm(navyid); }
private void Btn_Search_Click(object sender, EventArgs e) { dcore = new DataCoreLibrary(); Label_Batt.Text = Cmb_Batt.Text; Label_Company.Text = Cmb_Company.Text; loaddata(); Cmb_Company.SelectAll(); Cmb_Batt.SelectAll(); }
public ReportSummaryPersonForm() { InitializeComponent(); dcore = new DataCoreLibrary(); GetReportData(); mtxtYearin.Focus(); }
public ViewProfile(string id) { townnameManage_old = new DataControls.TownnameTab(); townnameManage = new DataControls.TownnameTab(); dcore = new DataCoreLibrary(); InitializeComponent(); GetData(id, ""); }
public MoveToAddressUnit(string id, string number) { report_number = number; navyid = id; dcore = new DataCoreLibrary(); townnameManage = new DataControls.TownnameTab(); InitializeComponent(); GetData(id); DataControls.LoadComboBoxData(cmbUnit, DataDefinition.GetUnitmoreTab(), "unit_name", "unit_id"); }
private bool updateDoc() { dcore = new DataCoreLibrary(); string cbbcode; cbbcode = DataControls.GetSelectedValueComboBoxToString(cbb); if (cbbcode != "" && cbbcode != null) { switch (mode) { case "addictive": { dcore.UpdateAddictive(navyid, cbbcode); } break; default: { if (gvSearch.SelectedRows[0].Cells["คพท"].Value.ToString() != "") { DialogResult dialogResult = MessageBox.Show( "พลฯ " + gvSearch.SelectedRows[0].Cells["ชื่อ"].Value.ToString() + " " + gvSearch.SelectedRows[0].Cells["นามสกุล"].Value.ToString() + " มีสาขาอาชีพ" + gvSearch.SelectedRows[0].Cells["คพท"].Value.ToString() + " ยืนยันการเปลี่ยนสาขาอาชีพหรือไม่?", "แจ้งเตือน", MessageBoxButtons.YesNo); /*if (dialogResult == DialogResult.Yes) * { * updateDoc(); * }*/ if (dialogResult == DialogResult.No) { return(false); } } dcore.UpdateKptclass(navyid, cbbcode); } break; } MessageBox.Show("เสร็จสิีน"); load(); txtname.Text = ""; txtsname.Text = ""; mtxtid8.Text = ""; txtname.Focus(); return(true); } else { MessageBox.Show("เลือกสาขาอาชีพก่อน"); cbb.Focus(); return(false); } }
//Add New Data Indictment public AddNewIndictment(string navyid, RTCDetails rtcDetails) { InitializeComponent(); txtBox_Indictment.Focus(); AddEnterKeyDown(); this.navyid = navyid; dcore = new DataCoreLibrary(); //_rtcDetails = rtcDetails; SetDetailsText(rtcDetails); SetRTBStyle(txtDetails); FlagFunction = "save"; }
private void Btn_Search_Click(object sender, EventArgs e) { dcore = new DataCoreLibrary(); page = 1; Search(gv_result); TxtBox_Yearin.Focus(); TxtBox_ID8.SelectAll(); TxtBox_ID13.SelectAll(); TxtBox_Name.SelectAll(); TxtBox_Sname.SelectAll(); GVsSetAutoSizeColumns(); }
public ProcessPersonCardForm() { InitializeComponent(); searchPersonNivyInputControl1.SearchButtonClick += new EventHandler(SearchPersonNivy_ButtonSubmitClick); DataControls.LoadComboBoxData(cbbArmtown, DataDefinition.GetArmtownTab(), "ARMNAME", "ARMID"); dcoreSearch = new DataCoreLibrary(System.Configuration.ConfigurationManager.ConnectionStrings["midb"].ConnectionString); dcoreSave = new DataCoreLibrary(); tableImages.Columns.Add("no", typeof(int)); tableImages.Columns.Add("name", typeof(string)); tableImages.Columns.Add("size", typeof(string)); }
private void btnSearch_Click(object sender, EventArgs e) { dcore = new DataCoreLibrary(); page = 1; GetSearchData(); mtxtYearin.Focus(); mtxtYearin.SelectAll(); mTextBoxID8.SelectAll(); textBoxID13.SelectAll(); textBoxRunNum.SelectAll(); textBoxName.SelectAll(); textBoxSname.SelectAll(); SetValueForText1 = textBoxID13.Text; }
public SearchPersonRequestForm() { InitializeComponent(); AddEnterKeyDown(); rbAddNew.Checked = true; rbEditOrDelete.Checked = false; paramSearch = new ParamSearchPerson(); pTable = new PersonRequestDataSet.PersonDataTable(); prTable = new PersonRequestDataSet.PersonRequestDataTable(); dcore = new DataCoreLibrary(); rcore = new ReportCoreLibrary(); mtxtYearin.Text = dcore.GetMaxYearin(); }
private void btnclearall_Click(object sender, EventArgs e) { if (MessageBox.Show("ต้องการล้างล้างข้อมูลหมายเลขฉลากทั้งหมดใช่หรือไม่", "ล้างข้อมูลทั้งหมด", MessageBoxButtons.YesNo) == DialogResult.Yes) { dcoreUpdateUsedPerson = new DataCoreLibrary(); dcoreUpdateUsedPerson.ClearAllNLabelPerson(); GetData(); MessageBox.Show("ล้างข้อมูลทั้งหมดสำเร็จ", "ล้างข้อมูลทั้งหมด", MessageBoxButtons.OK); // System.Windows.Forms.Application.Exit(); } else { this.Activate(); } }
private void btnclear_Click(object sender, EventArgs e) { if (MessageBox.Show("ต้องการล้างล้างข้อมูลหมายเลขฉลากใช่หรือไม่", "ล้างข้อมูล", MessageBoxButtons.YesNo) == DialogResult.Yes) { dcoreUpdateUsedPerson = new DataCoreLibrary(); dcoreUpdateUsedPerson.ClearNLabelPerson(DataControls.GetSelectedValueComboBoxToString(cmbunit)); GetData(); MessageBox.Show("ล้างข้อมูลสำเร็จ", "ล้างข้อมูล", MessageBoxButtons.OK); // System.Windows.Forms.Application.Exit(); } else { this.Activate(); } }
//Edit Data Indictment public AddNewIndictment(string navyid, RTCDetails rtcDetails, string indictmentTxt, string datecapture) { InitializeComponent(); txtBox_Indictment.Focus(); AddEnterKeyDown(); dcore = new DataCoreLibrary(); this.navyid = navyid; this.IndictmentTxt = indictmentTxt; this.datecapture = datecapture; //_rtcDetails = rtcDetails; SetDetailsText(rtcDetails); SetRTBStyle(txtDetails); FlagFunction = "edit"; txtBox_capture.Text = convertUNDate(datecapture); AddEnterKeyDown(); }
private void load() { string cbbcode; if (cbb.SelectedIndex != -1) { dcore = new DataCoreLibrary(); if (cbb.Text.Trim() != "" && cbb.Text.Trim() != "System.Data.DataRowView") { cbbcode = DataControls.GetSelectedValueComboBoxToString(cbb); switch (mode) { case "addictive": { dtUpdate = dcore.getaddictive(cbbcode, out count); Set_dtColumnName(dtUpdate); } break; default: { dtUpdate = dcore.getkptclass(cbbcode, out count); Set_dtColumnName(dtUpdate); } break; } lblcountkptclass.Text = count.ToString() + " Record"; gvKptclass.DataSource = dtUpdate; gvKptclass.SelectionMode = DataGridViewSelectionMode.FullRowSelect; gvKptclass.MultiSelect = false; gvKptclass.ReadOnly = true; for (int i = 0; i <= gvKptclass.Columns.Count - 1; i++) { int colw = gvKptclass.Columns[i].Width; gvKptclass.Columns[i].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; } } else { cbbcode = null; } } }
public SearchPersonTransferForm() { InitializeComponent(); AddEnterKeyDown(); rbAddNew.Checked = true; rbEditOrDelete.Checked = false; paramSearch = new ParamSearchPerson(); dtPerson = new DataTable(); dtTransDetail = new DataTable(); dtPunishmentDetail = new DataTable(); dtDataOldYearin = new DataTable(); dtIndicment = new DataTable(); dcoreNav = new DataCoreLibrary(); dcoreNav.ChangeDB("navdb"); dcoreNavAll = new DataCoreLibrary(); dcoreNavAll.ChangeDB("navdb_all"); mtxtYearin.Text = dcoreNav.GetMaxYearin(); }
private void SearchPersonNivy_ButtonSubmitClick(object sender, EventArgs e) { //backgroundWorker1.RunWorkerAsync(); pictureBox1.Visible = true; dcore = new DataCoreLibrary(); if (checkBoxSearchNivyAll.Checked) { dcore = new DataCoreLibrary(System.Configuration.ConfigurationManager.ConnectionStrings["midb"].ConnectionString); } Search(); gvResult.Focus(); //if (backgroundWorker1.WorkerSupportsCancellation == true) //{ // // Cancel the asynchronous operation. // backgroundWorker1.CancelAsync(); //} pictureBox1.Visible = false; }
public MoveToAddressOld(string id, string selectmove, string number) { navyid = id; report_number = number; townnameManage_old = new DataControls.TownnameTab(); dcore = new DataCoreLibrary(); InitializeComponent(); MessageBox.Show(selectmove + id); if (selectmove.Equals("Old")) { label4.Text = "ภูมิลำเนาเดิม"; MessageBox.Show(id); GetData(id, selectmove); // f.Text = "ย้ายกลับภูมิลำเนาเดิม"; } else { label4.Text = "ที่อยู่ใหม่"; townnameManage_old.LoadProvinceToComboBox(cmbprovince_old, ""); GetData(id, selectmove); // f.Text = "ย้ายไปที่อยู่ใหม่"; } }
private void SearchPersonNivy_ButtonSubmitClick(object sender, EventArgs e) { dcore = new DataCoreLibrary(); dcore.ChangeDB("midb"); Search(); }