private void frmNDoc_Load(object sender, EventArgs e) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); int ret = 0; SettingsSingleton.getValue(SettingsSingleton.KeyNDocTop, out ret); if (ret > 0) { this.Top = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocLeft, out ret); if (ret > 0) { this.Left = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocWidth, out ret); if (ret > 0) { this.Width = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocHeight, out ret); if (ret > 0) { this.Height = ret; } con.CloseConnection(); } }
public AccessFuncs() { DataTable tbl = null; using (DAOContext con = new DAOContext(AccessConstring.FuncsConString)) { con.OpenConnection(); funcsDAO dao = new funcsDAO(con); tbl = dao.selectAll(); foreach (DataRow row in tbl.Rows) { string funcname = row["funcname"].ToString(); string stringfuncname = row["stringfuncname"].ToString(); DataTable argsTbl = dao.selectArgs(funcname); List<string> argTypes = new List<string>(); foreach (DataRow arow in argsTbl.Rows) { argTypes.Add(arow["argtype"].ToString()); } if (!AccessFuncs.FuncsData.ContainsKey(funcname)) { AccessFuncs.FuncsData.Add(funcname, new FuncData(funcname, stringfuncname, argTypes)); } } con.CloseConnection(); } }
public SeqAccessTableNode(string tableName) { using (DAOContext con = new DAOContext(AccessConstring.conString)) { con.OpenConnection(); tableDAO dao = new tableDAO(con, tableName); this.table = dao.selectAll(); con.CloseConnection(); } }
private void frmNDoc_FormClosing(object sender, FormClosingEventArgs e) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); SettingsSingleton.setValue(SettingsSingleton.KeyNDocTop, this.Top); SettingsSingleton.setValue(SettingsSingleton.KeyNDocLeft, this.Left); SettingsSingleton.setValue(SettingsSingleton.KeyNDocWidth, this.Width); SettingsSingleton.setValue(SettingsSingleton.KeyNDocHeight, this.Height); con.CloseConnection(); } }
public RandomAccessTableNode(string tableName) { using (DAOContext con = new DAOContext(AccessConstring.conString)) { con.OpenConnection(); tableDAO dao = new tableDAO(con, tableName); this.table = dao.selectAll(); con.CloseConnection(); } this.max = this.table.Rows.Count; int seed = Environment.TickCount; this.objRandom = new Random(seed); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { this.cmbReflectTarget.Save(); this.cmbPrefix.Save(); using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormTop, this.Top); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormLeft, this.Left); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormWidth, this.Width); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormHeight, this.Height); con.CloseConnection(); } }
private void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.tbxNDocComnment.Text)) { MessageBox.Show("テキストボックスが空です。"); return; } if (string.IsNullOrEmpty(lblTargetName.Text)) { MessageBox.Show("ターゲットが空です。"); return; } using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); SettingsSingleton.setValue(con, this.NDocHeader + this.lblTargetName.Text, this.tbxNDocComnment.Text); con.CloseConnection(); } this.Close(); }
public static string getStringValue(string headerText, string strgKey) { string strgValue = ""; //DBから読み込む using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.selectSetting(headerText, strgKey, out strgValue); con.CloseConnection(); } return strgValue; }
public static IList<string> getHeaderTexts() { List<string> headertexts = new List<string>(); DataTable tbl = null; //DBから読み込む using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); tbl = dao.selectHeaders(); con.CloseConnection(); } if (tbl != null) { foreach (DataRow row in tbl.Rows) { headertexts.Add(row["HEADERTEXT"].ToString()); } } return headertexts; }
public static void deleteSettings(string headerText, string strgKey) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.deleteSettings(headerText, strgKey); con.CloseConnection(); } }
public static void setStringValus(string headerText, string strgKey, IList<string> strgs) { int no = 1; using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.deleteSettings(headerText, strgKey); foreach (string strg in strgs) { dao.insertNew(headerText, strgKey, no, strg); no++; } con.CloseConnection(); } }
public static bool isExistsHeader(string headerText) { bool ret = false; using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); ret = dao.isExistsHeader(headerText); con.CloseConnection(); } return ret; }
private void Form1_Load(object sender, EventArgs e) { this.cmbReflectTarget.Load(); this.cmbPrefix.SaveFilename = "prefix.txt"; this.cmbPrefix.Load(); this.cmbPublicElse.SelectedIndex = 0; object selected = new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.WindowsForms, "System.Windows.Forms"); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.System, "System")); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.Generic, "System.Collections.Generic")); this.cmbNameSpace.Items.Add(selected); this.cmbNameSpace.SelectedItem = selected; this.tbxJpLineOfListBox.ParentListView = this.listJpArgsInfo; this.cmbExportMethod.Text = "TSV"; // Menu /* * //Copy * MenuItem mNdoc = new MenuItem(); * mNdoc.Text = "NDocコメント"; * mNdoc.Click += this.ShowNDocCommentDialog; * //this.cMenu.Items.Add(mNdoc); * this.tbxJpMethodName.ContextMenu = new ContextMenu(); * this.tbxJpMethodName.ContextMenu.MenuItems.Add(mNdoc); */ this.AddMenusToControl(this.tbxJpMethodName); this.AddMenusToControl(this.tbxJpReturnType); this.AddMenusToControl(this.listJpArgsInfo); // SIZE using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); int ret = 0; SettingsSingleton.getValue(SettingsSingleton.KeyMainFormTop, out ret); if (ret > 0) { this.Top = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormLeft, out ret); if (ret > 0) { this.Left = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormWidth, out ret); if (ret > 0) { this.Width = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormHeight, out ret); if (ret > 0) { this.Height = ret; } con.CloseConnection(); } }
public Context() { dao = new DAOContext(database_user, database_passwd, database_server, database_db); }
public funcsDAO(DAOContext con) : base(con) { }
public static IList<string> getStringValues(string headerText, string strgKey) { List<string> ret = new List<string>(); DataTable tbl = null; //DBから読み込む using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); tbl = dao.selectSettingRows(headerText, strgKey); con.CloseConnection(); } if (tbl != null) { foreach (DataRow row in tbl.Rows) { ret.Add(row["TEXTVALUE"].ToString()); } } return ret; }
public static void getValue(string headerText, string strgKey, out int intValue) { intValue = 0; //DBから読み込む using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.selectSetting(headerText, strgKey, out intValue); con.CloseConnection(); } }
public void Execute(string fullsigunature, string funcname, string returnType, string publicOr, string virtualString, List <string> args) { // prefix string prefix = this.ParentForm.cmbPrefix.Text.Trim(); if (string.IsNullOrEmpty(prefix)) { prefix = string.Empty; } using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); // english this.ParentForm.tbxReturnType.Text = returnType; this.ParentForm.tbxMethodName.Text = funcname; this.ParentForm.tbxPublicOr.Text = publicOr; this.ParentForm.tbxVirtual.Text = virtualString; this.ParentForm.listArgsInfo.Items.Clear(); foreach (string arg in args) { ListViewItem item = new ListViewItem(); item.Text = arg; this.ParentForm.listArgsInfo.Items.Add(item); } // Japanese string ret = string.Empty; SettingsSingleton.getValue(con, prefix + returnType, out ret); if (!string.IsNullOrEmpty(ret)) { this.ParentForm.tbxJpReturnType.Text = ret; } else { this.ParentForm.tbxJpReturnType.Text = returnType; } SettingsSingleton.getValue(con, prefix + funcname, out ret); if (!string.IsNullOrEmpty(ret)) { this.ParentForm.tbxJpMethodName.Text = ret; } else { this.ParentForm.tbxJpMethodName.Text = funcname; } this.ParentForm.tbxJpPublicOr.Text = publicOr; this.ParentForm.tbxJpVirtual.Text = virtualString; this.ParentForm.listJpArgsInfo.Items.Clear(); foreach (string arg in args) { ListViewItem item = new ListViewItem(); SettingsSingleton.getValue(con, prefix + arg, out ret); if (!string.IsNullOrEmpty(ret)) { item.Text = ret; } else { item.Text = arg; } this.ParentForm.listJpArgsInfo.Items.Add(item); } con.CloseConnection(); } }
public static void MergeHeader(string headerText) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.mergeHeader(headerText); con.CloseConnection(); } }
public void SaveJpNameToDB() { //prefix string prefix = this.cmbPrefix.Text.Trim(); if (string.IsNullOrEmpty(prefix)) { prefix = string.Empty; } // english string returnTypeEn = this.tbxReturnType.Text; string funcnameEn = this.tbxMethodName.Text; string publicOrEn = this.tbxPublicOr.Text; string virtualStringEn = this.tbxVirtual.Text; List <string> ArgsListEn = new List <string>();//this.ParentForm.listArgsInfo.Items foreach (var item in this.listArgsInfo.Items) { string arg = item.ToString(); ArgsListEn.Add(arg); /* * ListViewItem item = new ListViewItem(); * item.Text = arg; * this.ParentForm.listArgsInfo.Items.Add(item); */ } // Japanese string returnTypeJp = this.tbxJpReturnType.Text; string funcnameJp = this.tbxJpMethodName.Text; string publicOrJp = this.tbxJpPublicOr.Text; string virtualStringJp = this.tbxJpVirtual.Text; //this.ParentForm.listJpArgsInfo.Items; List <string> ArgsListJp = new List <string>(); foreach (var item in this.listJpArgsInfo.Items) { string arg = item.ToString(); ArgsListJp.Add(arg); } // convert and save using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); if (!string.IsNullOrEmpty(returnTypeEn.Trim()) && !string.IsNullOrEmpty(returnTypeJp.Trim())) { SettingsSingleton.setValue(con, prefix + returnTypeEn.Trim(), returnTypeJp.Trim()); } if (!string.IsNullOrEmpty(funcnameEn.Trim()) && !string.IsNullOrEmpty(funcnameJp.Trim())) { SettingsSingleton.setValue(con, prefix + funcnameEn.Trim(), funcnameJp.Trim()); } int maxArgEn = ArgsListEn.Count; int maxArgJp = ArgsListJp.Count; int max = (maxArgEn < maxArgJp) ? maxArgEn : maxArgJp; try { for (int i = 0; i < max; i++) { if (!string.IsNullOrEmpty(ArgsListEn[i].Trim()) && !string.IsNullOrEmpty(ArgsListJp[i].Trim())) { SettingsSingleton.setValue(con, prefix + ArgsListEn[i].Trim(), ArgsListJp[i].Trim()); } } } catch (Exception excp) { } con.CloseConnection(); } }
public static void setValue(string headerText, string strgKey, int intValue) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con); dao.mergeSettings(headerText,strgKey, intValue); con.CloseConnection(); } }
public MyDummySQLSettingsDAO(DAOContext con) : base(con) { }
public AccessSchemaDAO(DAOContext con) : base(con) { }
public tableDAO(DAOContext con, string tableName_) : base(con) { this.tableName = tableName_; }