本文整理汇总了C#中AccessHelper类的典型用法代码示例。如果您正苦于以下问题:C# AccessHelper类的具体用法?C# AccessHelper怎么用?C# AccessHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessHelper类属于命名空间,在下文中一共展示了AccessHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Approach_DetailContent
public Approach_DetailContent()
{
InitializeComponent();
Access = new AccessHelper();
Query = new QueryHelper();
dicSurveyFields = new Dictionary<decimal, IEnumerable<string>>();
this.Group = "畢業學生進路";
_RunningKey = "";
this.Load += new EventHandler(Form_Load);
this.form_loaded = false;
_Errors = new ErrorProvider();
_Listener = new ChangeListener();
_Listener.Add(new DataGridViewSource(this.dgvData));
_Listener.Add(new TextBoxSource(this.txtMemo));
_Listener.Add(new NumericUpDownSource(this.txtSurveyYear));
_Listener.StatusChanged += new EventHandler<ChangeEventArgs>(Listener_StatusChanged);
this.dgvData.CellEnter += new DataGridViewCellEventHandler(dgvData_CellEnter);
this.dgvData.CurrentCellDirtyStateChanged += new EventHandler(dgvData_CurrentCellDirtyStateChanged);
this.dgvData.DataError += new DataGridViewDataErrorEventHandler(dgvData_DataError);
this.dgvData.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvData_ColumnHeaderMouseClick);
this.dgvData.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvData_RowHeaderMouseClick);
this.dgvData.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dgvData_MouseClick);
_BGWLoadData = new BackgroundWorker();
_BGWLoadData.DoWork += new DoWorkEventHandler(_BGWLoadData_DoWork);
_BGWLoadData.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_BGWLoadData_RunWorkerCompleted);
_BGWSaveData = new BackgroundWorker();
_BGWSaveData.DoWork += new DoWorkEventHandler(_BGWSaveData_DoWork);
_BGWSaveData.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_BGWSaveData_RunWorkerCompleted);
}
示例2: CheckLuoJi
/// <summary>
/// 检查指定表的逻辑关联性
/// </summary>
/// <param name="sql"></param>
/// <param name="table"></param>
/// <param name="crl"></param>
/// <param name="tName"></param>
public void CheckLuoJi(string sql, KeyValuePair<string, string> table, MainCrl crl, string tName)
{
AccessHelper accessHelper = new AccessHelper();
AccessHelper ah = new AccessHelper();
//字段值大于等于某一字段值
DataTable dt = accessHelper.SelectToDataTable("select * from GuiZe where 规则类型='逻辑关联性'");
if (dt.Rows.Count > 0)
{
if (table.Key.Equals("ZBXXB"))
{
string path = table.Value;
DataTable dataTable = ah.SelectToDataTable("select * from ZBXXB", path);
for(int i=0;i<dt.Rows.Count;i++)
{
DataTable ResultTable = ah.SelectToDataTable(dt.Rows[i]["表达式"].ToString(), path);
if(ResultTable.Rows.Count>0)
{
for (int j = 0; j < ResultTable.Rows.Count;j++ )
{
for (int k = 0; k < dataTable.Rows.Count;k++ )
{
if (ResultTable.Rows[j]["ZDTYBM"].Equals(dataTable.Rows[k]["ZDTYBM"]))
{
ComMsg.ResultShow.Add(new ResultEntity(tName, dt.Rows[i]["规则类型"].ToString(), dt.Rows[i]["规则编号"].ToString(), dt.Rows[i]["规则名称"].ToString(),
dt.Rows[i]["字段名"] + dt.Rows[i]["错误描述"].ToString(), (k + 1) + "", dt.Rows[i]["严重程度"].ToString(), DateTime.Now.ToShortDateString()));
}
}
}
}
}
}
}
}
示例3: ExportEvaluation_ComplexQueries_Handler
public ExportEvaluation_ComplexQueries_Handler()
{
this.Access = new AccessHelper();
this._User_Form = new ExportEvaluation_ComplexQueries();
this._Statistics = new List<UDT.TeacherStatistics>();
}
开发者ID:jungfengpaulwang,项目名称:EMBATeachingEvaluation,代码行数:7,代码来源:ExportEvaluation_ComplexQueries_Handler.cs
示例4: tbEdit_Click
private void tbEdit_Click(object sender, EventArgs e)
{
AccessHelper ah = new AccessHelper();
string pwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tbOldPwd.Text, "MD5");
string sql = "select * from UserTable where uName='" + tbUserName.Text + "' and uPwd='" + pwd + "'";
DataTable dt = ah.SelectToDataTable(sql);
if (dt.Rows.Count == 0)
{
MessageBox.Show("用户名或密码错误!");
return;
}
if(tbNewPwd.Text.Length<6)
{
MessageBox.Show("请输入长度大于等于6位的密码!");
return;
}
if (!tbNewPwd.Text.Trim().Equals(tbRePwd.Text.Trim()))
{
MessageBox.Show("两次输入密码不一致!");
return;
}
string editPwd = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tbNewPwd.Text, "MD5");
string editSql = "update UserTable set uName='"+tbUserName.Text.Trim()+"',uPwd='"+editPwd+"' where id=" + dt.Rows[0]["id"].ToString();
if(ah.ExecuteSQLNonquery(editSql))
{
this.DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("修改失败!");
}
}
示例5: CGWJPZFrm_Load
private void CGWJPZFrm_Load(object sender, EventArgs e)
{
this.muLuTableAdapter.Fill(this.settingDataSet.MuLu);
if (CGWJID > 0)
{
AccessHelper ah = new AccessHelper();
string sql = "select * from WenJian where ID=" + CGWJID;
DataTable dt = ah.SelectToDataTable(sql);
if (dt.Rows.Count > 0)
{
DataRow dr = dt.Rows[0];
cbAction.Text = dr["文件开始字符"].ToString();
tbEnd.Text = dr["文件结束字符"].ToString();
tbType.Text = dr["文件类型"].ToString();
if ((bool)dr["是否必填"])
rbYes.Checked = true;
else
rbNo.Checked = true;
string type = dr["文件扩展名"].ToString();
foreach(Control c in this.groupBox1.Controls)
{
if (c is CheckBox)
{
if(type.Contains(((CheckBox)c).Text))
{
((CheckBox)c).Checked = true;
}
}
}
}
}
}
示例6: frmFAQ
public frmFAQ()
{
InitializeComponent();
Access = new AccessHelper();
this.Load += new EventHandler(frmFAQ_Load);
}
示例7: tbSave_Click
private void tbSave_Click(object sender, EventArgs e)
{
//检查数据格式
if(CheckMsg())
{
AccessHelper ah = new AccessHelper();
string sql = string.Empty;
if(XZQHID==0)//新增
{
sql = "insert into QuHua(行政区编码,行政区名称,父级编码) values('"+tbQHBM.Text.Trim()+"',";
sql+="'"+tbQHMC.Text.Trim()+"','"+FJQHBM+"')";
}
else
{
sql = "update QuHua set 行政区编码='"+tbQHBM.Text.Trim()+"',行政区名称='"+tbQHMC.Text.Trim()+"',父级编码='"+FJQHBM+"' where ID="+XZQHID;
}
if(ah.ExecuteSQLNonquery(sql))
{
this.DialogResult = DialogResult.OK;
string OtherSql = "update QuHua set 父级编码='" + tbQHBM.Text.Trim() + "' where 父级编码='"+oldQHBM+"'";
ah.ExecuteSQLNonquery(OtherSql);
MessageBox.Show("保存成功");
this.Close();
}
else
{
MessageBox.Show("保存失败");
}
ah.Close();
}
FJQHBM = string.Empty;
}
示例8: Absence_EmailNotification
public Absence_EmailNotification()
{
InitializeComponent();
Access = new AccessHelper();
Query = new QueryHelper();
}
示例9: Form_Load
private void Form_Load(object sender, EventArgs e)
{
this.Text = "新增" + _Catalog;
Access = new AccessHelper();
List<GraduationRequirement> graduationRequirements = Access.Select<GraduationRequirement>();
List<DepartmentGroup> departmentGroups = Access.Select<DepartmentGroup>();
ComboItem comboItem1 = new ComboItem("不進行複製");
comboItem1.Tag = null;
this.cboGraduationRequirementRule.Items.Add(comboItem1);
foreach (GraduationRequirement var in graduationRequirements)
{
IEnumerable<DepartmentGroup> filterRecords = departmentGroups.Where(x => x.UID == var.DepartmentGroupID.ToString());
if (filterRecords.Count() == 0)
continue;
string departmentGroup = filterRecords.Select(x => x.Name).ElementAt(0);
ComboItem item = new ComboItem(departmentGroup + "-" + var.Name);
item.Tag = var;
cboGraduationRequirementRule.Items.Add(item);
}
cboGraduationRequirementRule.SelectedItem = comboItem1;
txtName.Focus();
}
示例10: btnSave_Click
/// <summary>
/// 保存编辑的目录
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnSave_Click(object sender, EventArgs e)
{
AccessHelper ah = new AccessHelper();
string sql = string.Empty;
if (CheckMsg())
{
if(MLID==0)//新增
{
if(ExistSameMuLu(tbCGML.Text.Trim()))
{
MessageBox.Show("包含相同目录的记录,请检查后录入");
return;
}
sql = "insert into Mulu(目录名称,检查级别) values('"+tbCGML.Text.Trim()+"',";
sql+="'"+"省级质检"+"')";//后期修改
}
else//修改
{
sql = "update Mulu set 目录名称='"+tbCGML.Text.Trim()+"',";
sql+="检查级别='"+"省级质检"+"' where ID=" + MLID;//后期修改
}
if(ah.ExecuteSQLNonquery(sql))
{
this.DialogResult = DialogResult.OK;
MessageBox.Show("保存成功");
this.Close();
}
else
{
MessageBox.Show("保存失败");
}
ah.Close();
}
}
示例11: UDTTimeListSelectAll
/// <summary>
/// 取得所以有重補修期間
/// </summary>
/// <returns></returns>
public static List<UDTTimeListDef> UDTTimeListSelectAll()
{
List<UDTTimeListDef> retVal = new List<UDTTimeListDef>();
AccessHelper accessHelper = new AccessHelper();
retVal = accessHelper.Select<UDTTimeListDef>();
return retVal;
}
示例12: frmEvaluationConfiguration
public frmEvaluationConfiguration(bool QueryMode = true)
{
InitializeComponent();
this.dgvData.CurrentCellDirtyStateChanged += new EventHandler(dgvData_CurrentCellDirtyStateChanged);
this.dgvData.CellEnter += new DataGridViewCellEventHandler(dgvData_CellEnter);
this.dgvData.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dgvData_EditingControlShowing);
this.dgvData.DataError += new DataGridViewDataErrorEventHandler(dgvData_DataError);
this.dgvData.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvData_ColumnHeaderMouseClick);
this.dgvData.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvData_RowHeaderMouseClick);
this.dgvData.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dgvData_MouseClick);
this.Load += new EventHandler(frmTeachingEvaluation_Load);
dgvData.SortCompare += new DataGridViewSortCompareEventHandler(
this.DataGridView_SortCompare);
this.dicTeachersCases = new Dictionary<string, List<string>>();
this.dicReplys = new Dictionary<string, UDT.Reply>();
this.dicCourses = new Dictionary<string, CourseRecord>();
this.dicCourseInstructors = new Dictionary<string, KeyValuePair<string, string>>();
this.dicCases = new Dictionary<string, List<string>>();
this.dicSurveys = new Dictionary<string, UDT.Survey>();
this.dicAssignedSurveys = new Dictionary<string, UDT.AssignedSurvey>();
this.QueryMode = QueryMode;
Access = new AccessHelper();
Query = new QueryHelper();
}
示例13: UDTSuggestListSelectByTimeListID
/// <summary>
/// 透過期間ID取得該期間建議重補修清單
/// </summary>
/// <param name="ID"></param>
/// <returns></returns>
public static List<UDTSuggestListDef> UDTSuggestListSelectByTimeListID(string UID)
{
List<UDTSuggestListDef> retVal = new List<UDTSuggestListDef>();
AccessHelper accessHelper = new AccessHelper();
string qry = "ref_time_list_id="+UID;
retVal = accessHelper.Select<UDTSuggestListDef>(qry);
return retVal;
}
示例14: ScoreDegreeMapping
public ScoreDegreeMapping()
{
InitializeComponent();
__Access = new AccessHelper();
this.Load += new EventHandler(ScoreDegreeMapping_Load);
}
示例15: ABUDTMultipleRecordUpdate
/// <summary>
/// 更新綜合紀錄表 複選記錄
/// </summary>
/// <param name="dataList"></param>
public static void ABUDTMultipleRecordUpdate(List<UDTMultipleRecordDef> dataList)
{
if (dataList.Count > 0)
{
AccessHelper accHelper = new AccessHelper();
accHelper.UpdateValues(dataList);
}
}