private void btn_sel_file_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); string connectString = string.Format(excel, openFileDialog1.FileName); try { //t.WaitingThreadStart(); myDs.Tables.Clear(); myDs.Clear(); OleDbConnection cnnxls = new OleDbConnection(connectString); OleDbDataAdapter myDa = new OleDbDataAdapter("select * from [Sheet1$]", cnnxls); myDa.Fill(myDs, "c"); //t.WaitingThreadStop(); Form f = new Form(); f.Size = new Size(549, 446); f.FormBorderStyle = FormBorderStyle.None; uctlShowImportField sif = new uctlShowImportField(); sif.myDs = myDs; sif.table_name = gridView1.GetDataRow(gridView1.FocusedRowHandle)["TABLE_NAME"].ToString(); sif.pt_name = cmb_ptname.Text.ToString(); sif.pt_id = cmb_ptname.SelectedValue.ToString(); CommonFunction.AddForm(f, sif); //MessageBox.Show("数据载入完成!"); } catch (Exception ex) { //t.WaitingThreadStop(); MessageBox.Show(ex.Message); } }
private void btn_addleaf_Click(object sender, EventArgs e) { try { if (tl_node.FocusedNode == null) { return; } uctlAddNode.layout_name = gridView2.GetDataRow(gridView2.FocusedRowHandle)["layout_name"].ToString(); uctlAddNode.parientid = ((DataRowView)tl_node.GetDataRecordByNode(tl_node.FocusedNode)).Row["ID"].ToString(); uctlAddNode.pt_id = cmb_pt.SelectedValue.ToString(); Form f = new Form(); f.FormBorderStyle = FormBorderStyle.None; f.Size = new Size(640, 475); uctlAddNode an = new uctlAddNode(); CommonFunction.AddForm(f, an); InitTreeListData(); Initgc_nodeData(); tl_node.ExpandAll(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void btn_save_Click(object sender, EventArgs e) { if (cmb_pt.SelectedItem == null) { return; } Form f = new Form(); f.FormBorderStyle = FormBorderStyle.None; f.Size = new Size(440, 147); uctlAddTempField atf = new uctlAddTempField(); uctlAddTempField.pt_name = cmb_pt.Text.ToString(); uctlAddTempField.pt_id = cmb_pt.SelectedValue.ToString(); if (gridView1.FocusedRowHandle < 0) { MessageBox.Show("未选择行!"); return; } uctlAddTempField.class_name = gridView1.GetDataRow(gridView1.FocusedRowHandle)["class_name"].ToString(); uctlAddTempField.item_name = gridView1.GetDataRow(gridView1.FocusedRowHandle)["item_name"].ToString(); uctlAddTempField.item_code = gridView1.GetDataRow(gridView1.FocusedRowHandle)["item_code"].ToString(); CommonFunction.AddForm(f, atf); GetField(); }
/// <summary> /// 上一个方法的重载,所选择的项有程序判断,只提供消息内容设置。 /// </summary> /// <param name="message"></param> public static void frmDisappearShow(string message) { Form f = new Form(); f.Size = new Size(344, 113); f.FormBorderStyle = FormBorderStyle.None; uctlMessageBox umb = new uctlMessageBox(message); CommonFunction.AddForm(f, umb); }
private void btn_save_Click(object sender, EventArgs e) { uctlAddSQLName.sql = rtb_sql.Text; uctlAddSQLName.ptid = cmb_pt.SelectedValue.ToString(); Form f = new Form(); f.Size = new Size(489, 60); f.FormBorderStyle = FormBorderStyle.None; uctlAddSQLName sn = new uctlAddSQLName(); CommonFunction.AddForm(f, sn); //FreshSQL(); CommonFunction.WriteErrorLog(this, "FreshSQL", null); }
private void btn_updatenodename_Click(object sender, EventArgs e) { if (tl_node.FocusedNode == null) { return; } uctlRenameNode.id = ((DataRowView)tl_node.GetDataRecordByNode(tl_node.FocusedNode)).Row["ID"].ToString(); Form f = new Form(); f.FormBorderStyle = FormBorderStyle.None; f.Size = new Size(492, 73); uctlRenameNode rn = new uctlRenameNode(); CommonFunction.AddForm(f, rn); Initgc_nodeData(); InitTreeListData(); tl_node.ExpandAll(); }
private void btn_newlayout_Click(object sender, EventArgs e) { Form f = new Form(); f.FormBorderStyle = FormBorderStyle.None; uctlAddNewXMLLayout anxl = new uctlAddNewXMLLayout(); if (cmb_pt.SelectedItem == null) { return; } anxl.pt_id = cmb_pt.SelectedValue.ToString(); f.Size = new Size(528, 71); CommonFunction.AddForm(f, anxl); getLayoutData(); //try //{ // string sql = ""; // //if (publicProperty.DATABASETYPE =="ORACLE") // //{ // //Guid g = new Guid(); // sql = string.Format("insert into pt_xml_config(ID,FIELD_NAME,pt_id,field) values('{1}','根节点','{0}','MYROOT')", cmb_pt.SelectedValue.ToString(),Guid.NewGuid()); // //} // //else if (publicProperty.DATABASETYPE=="SQLSERVER") // //{ // // sql = string.Format("insert into pt_xml_config(FIELD_NAME,pt_id) values('根节点',{0})", cmb_pt.SelectedValue.ToString()); // //} // DALUse.ExecuteSql(sql); // //this.FindForm().Close(); // uctlMessageBox.frmDisappearShow("添加成功!"); //} //catch (Exception ex) //{ // MessageBox.Show(ex.ToString()); //} //InitTreeListData(); //Initgc_nodeData(); //tl_node.ExpandAll(); }
private void btn_update_Click(object sender, EventArgs e) { if ((gridView1.FocusedRowHandle < 0) || gridView2.FocusedRowHandle < 0) { return; } uctlManageField.actionflag = "update"; uctlManageField.pt_id = cmb_ptname.SelectedValue.ToString(); uctlManageField.pt_name = cmb_ptname.Text.Trim(); uctlManageField.table_name = gridView1.GetDataRow(gridView1.FocusedRowHandle)["TABLE_NAME"].ToString(); uctlManageField.compare_id = gridView2.GetDataRow(gridView2.FocusedRowHandle)["COMPARE_ID"].ToString(); Form f = new Form(); f.Size = new Size(531, 102); f.FormBorderStyle = FormBorderStyle.None; uctlManageField mf = new uctlManageField(); CommonFunction.AddForm(f, mf); RefreshContent(); }