using ryCommonDb; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Xml.Linq; using 开发辅助工具.Manager; namespace 开发辅助工具.Tools.SmartEditor { public partial class FrmFavFile : Form { public FrmFavFile() { InitializeComponent(); } private void BtnCancel_Click(object sender, EventArgs e) { DialogResult= DialogResult.Cancel; } public int SelectedId = 0; public int GroupId = 0; public string FilePath { get; set; } = ""; private void BtnOK_Click(object sender, EventArgs e) { RyQuickSQL mySQL = new RyQuickSQL("FavFiles"); mySQL.AddField("name", TxtFavName.Text); mySQL.AddField("FilePath", FilePath); mySQL.AddField("FindText", TxtFind.Text); mySQL.AddField("GroupId", GroupId); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1) { mySQL.AddField("editTime", DateTime.Now); if(SelectedId==0) { mySQL.AddField("addTime", DateTime.Now); db.ExecuteNonQuery(mySQL.GetInsertSQL(), db.GetParameter(mySQL)); } else { db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where id=" + SelectedId, mySQL); } } db.Free(); DialogResult = DialogResult.OK; } } }