/// <summary> /// 反结帐操作 /// </summary> private void UnCheckOut() { string strSQL = ""; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs("select * from t_Period where F_Year = " + intYear.ToString() + " and F_Month = " + intMonth.ToString()); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show(this, "本期还没结帐,不能进行此操作!", "提示"); return; } if (MessageBox.Show(this, "真的要对当前月份进行会计反结帐吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } ds = myHelper.GetDs("select isnull(max(Aid),0) + 1 as F_MaxID from t_Period"); decimal decID = Convert.ToDecimal(ds.Tables[0].Rows[0][0]); if (myHelper.ExecuteSQL("delete from t_Period where F_Year = " + intYear.ToString() + " and F_Month = " + intMonth.ToString()) == 0) { strSQL = "delete from t_cwCheckOut where F_Year = " + intYear.ToString() + " and F_Month = " + intMonth.ToString(); if (myHelper.ExecuteSQL(strSQL) == 0) { MessageBox.Show(this, "本期反结帐帐成功!!", "提示"); Close(); } } }
protected override void DataDel() { base.DataDel(); frmDelLog myDelLog = new frmDelLog(); if (myDelLog.ShowDialog() == DialogResult.OK) { DataLib.DataHelper myHeler = new DataLib.DataHelper(); if (myDelLog.ckAll.Checked == true) { if (myHeler.ExecuteSQL("truncate table t_UserLog") == 0) { BindData(); } } else { string strStart = myDelLog.deStart.EditValue.ToString() + " 00:00:00"; string strEnd = myDelLog.deEnd.EditValue.ToString() + " 23:59:59"; if (myHeler.ExecuteSQL("delete from t_UserLog where F_Time >= '" + strStart + "' and F_Time <='" + strEnd + "'") == 0) { BindData(); } } } myDelLog.Dispose(); }
private void sbOK_Click(object sender, EventArgs e) { if (txtID.Text.Length == 0) { MessageBox.Show(this, "编码不能为空!!", "提示"); txtID.Focus(); return; } if (txtName.Text.Length == 0) { MessageBox.Show(this, "名称不能为空!!", "提示"); txtName.Focus(); return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (strID == "") { myHelper.ExecuteSQL("insert into t_Assist values('" + strType + "','" + txtID.Text + "','" + txtName.Text + "')"); } else { myHelper.ExecuteSQL("update t_Assist set F_Name = '" + txtName.Text + "' where F_Type = '" + strType + "' and F_ID = '" + strID + "'"); } this.DialogResult = DialogResult.OK; }
/// <summary> /// 结帐操作 /// </summary> private void CheckOut() { if (MessageBox.Show(this, "真的要对当前月份进行会计结帐吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } string strSQL = ""; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs("select top 1 * from t_Certificate where isnull(F_Record,0) = 0 and Year(F_Date) = " + intYear.ToString() + " and Month(F_Date) = " + intMonth.ToString()); if (ds.Tables[0].Rows.Count > 0) { MessageBox.Show(this, "本期存在未登帐的凭证,请先登帐,再进行此操作!", "提示"); return; } ds = myHelper.GetDs("select isnull(max(Aid),0) + 1 as F_MaxID from t_Period"); decimal decID = Convert.ToDecimal(ds.Tables[0].Rows[0][0]); if (myHelper.ExecuteSQL("insert into t_Period(Aid,F_Year,F_Month) values(" + decID.ToString() + "," + intYear.ToString() + "," + intMonth.ToString() + ")") == 0) { strSQL = "insert into t_cwCheckOut(F_Year,F_Month,F_Subject,F_Debit,F_Credit) select " + intYear.ToString() + "," + intMonth.ToString() + ",b.F_Subject,sum(b.F_Debit),sum(b.F_Credit)"; strSQL = strSQL + " from t_Certificate a,t_CertificateDetail b where a.F_ID = b.F_ID and Year(a.F_Date) = " + intYear.ToString() + " and Month(a.F_Date) = " + intMonth.ToString(); strSQL = strSQL + " group by b.F_Subject"; if (myHelper.ExecuteSQL(strSQL) == 0) { MessageBox.Show(this, "本月结帐帐成功!!", "提示"); Close(); } } }
/// <summary> /// 库存反结帐 /// </summary> private void UnStoreCheck() { string strSQL = ""; DateTime dtValue = Convert.ToDateTime(dtMonth.EditValue); string strYear = dtValue.Year.ToString(); string strMonth = dtValue.Month.ToString().PadLeft(2, '0'); string strValue = strYear + strMonth; strSQL = "select top 1 * from t_StorageCheck where F_Month = '" + strValue + "'"; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs(strSQL); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show("本月还没进行库存结帐,不能反结帐!!"); return; } if (MessageBox.Show(this, "真的要对本月进行库存反结帐吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } strSQL = "delete from t_StorageCheck where F_Month = '" + strValue + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { strSQL = "delete from t_CheckMonth where F_Month = '" + strValue + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { MessageBox.Show("反结帐成功!!"); } } }
private void AutoGenClass() { if (lupClass.GetValue() == null) { MessageBox.Show(this, "请先选择班次!", "提示"); lupClass.Focus(); return; } if (MessageBox.Show(this, "真的要重新生成排班吗,这将覆盖现在的结果,真的要这样做吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataTable dt = (DataTable)gridEmp.DataSource; DataLib.DataHelper myHelper = new DataLib.DataHelper(); foreach (DataRow dr in dt.Rows) { int iDays = DateTime.DaysInMonth(mkMonth.Value.Year, mkMonth.Value.Month); for (int i = 1; i <= iDays; i++) { DateTime dtDate = new DateTime(mkMonth.Value.Year, mkMonth.Value.Month, i); string strSQL = "insert into t_ArrangeClass(F_Month,F_ID,F_Day,F_Class) values('" + mkMonth.Text + "','" + dr["F_ID"].ToString() + "','" + dtDate.ToString() + "','" + lupClass.GetValue().ToString() + "')"; myHelper.ExecuteSQL(strSQL); } } DataRow drm = viewEmp.GetDataRow(viewEmp.FocusedRowHandle); DataBind(drm["F_ID"].ToString()); }
/* * private void BindFactory() * { * DataLib.DataHelper myHelper = new DataLib.DataHelper(); * DataSet ds = myHelper.GetDs("select F_ID,F_Name from t_Factory"); * lupFactory.Properties.DataSource = ds.Tables[0].DefaultView; * lupFactory.Properties.DisplayMember = "F_Name"; * lupFactory.Properties.ValueMember = "F_ID"; * } */ private void BtnOK_Click(object sender, EventArgs e) { SetInfo(); DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs("select a.*,b.F_View,isnull(b.F_Salesman,0) as F_Salesman from t_User a,t_UserGroup b where a.F_Group = b.F_Group and a.F_ID = '" + txtUID.Text + "' and a.F_Psw = '" + txtPsw.Text + "'"); if (ds.Tables[0].Rows.Count == 0) { MessageBox.Show(this, "密码错误,请查证!!", "提示"); txtPsw.SelectAll(); txtPsw.Focus(); base.DialogResult = DialogResult.None; return; } myHelper.ExecuteSQL("update t_User set F_Login = 1 where F_ID = '" + txtUID.Text + "'"); DataLib.SysVar.IniWriteValue("Database", "Account", lupAccount.EditValue.ToString(), "C:\\Set.ini"); DataSet dsTmp = myHelper.GetDs("select * from t_CompanyInfo"); DataLib.SysVar.strUID = txtUID.Text; DataLib.SysVar.strUName = txtUName.Text; DataLib.SysVar.strUGroup = ds.Tables[0].Rows[0]["F_Group"].ToString(); DataLib.SysVar.blnSaleMan = Convert.ToBoolean(ds.Tables[0].Rows[0]["F_Salesman"]); DataLib.SysVar.blnInit = Convert.ToBoolean(dsTmp.Tables[0].Rows[0]["F_Use"]); DataLib.SysVar.strCompany = dsTmp.Tables[0].Rows[0]["F_Company"].ToString(); DataLib.SysVar.blnView = Convert.ToBoolean(ds.Tables[0].Rows[0]["F_View"]); DataLib.SysVar.blnStorageFlag = DataLib.SysVar.GetParmValue("F_N10"); DataLib.SysVar.strAccount = lupAccount.Text; }
private void sbOK_Click(object sender, EventArgs e) { if (textEdit1.Text.Length == 0) { MessageBox.Show(this, "用户组不能为空!!"); return; } int iFlag = 0; if (checkEdit1.Checked == true) { iFlag = 1; } string strSQL = ""; if (strGroup == "") { strSQL = string.Format("insert into t_UserGroup(F_Group,F_View,F_Salesman) values('{0}',{1},{2})", textEdit1.Text, 0, iFlag); } else { strSQL = string.Format("update t_UserGroup set F_Group = '{0}',F_Salesman = {1} where F_Group = '{2}'", textEdit1.Text, iFlag, strGroup); } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL(strSQL) == 0) { this.DialogResult = DialogResult.OK; } }
/// <summary> /// 删除 /// </summary> protected override void Del() { base.Del(); if (gvList.FocusedRowHandle < 0) { return; } DataRow dr = gvList.GetDataRow(gvList.FocusedRowHandle); /* * if (Convert.ToBoolean(dr["F_Check"]) == true) * { * MessageBox.Show(this, "不能删除已审核的记录!!", "提示"); * return; * } */ if (MessageBox.Show(this, "真的要删除选定记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("delete from t_AssetReduce where Aid = '" + dr["Aid"].ToString() + "'") == 0) { gvList.DeleteRow(gvList.FocusedRowHandle); } }
private void btnSQL_Click(object sender, EventArgs e) { if (gridView1.RowCount == 0) { return; } DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle); string sSQL = "select isnull(F_SQL,'') as F_SQL from t_ReportFormat where F_FormName = '" + sFormName + "' and F_ReportName = '" + dr["F_ReportName"].ToString() + "'"; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs(sSQL); string sPrintSQL = ""; if (ds.Tables[0].Rows.Count > 0) { sPrintSQL = ds.Tables[0].Rows[0][0].ToString(); } frmPrintSQL F = new frmPrintSQL(); F.sBillID = this.sBillID; F.meSQL.Text = sPrintSQL; if (F.ShowDialog() == DialogResult.OK) { sSQL = string.Format("update t_ReportFormat set F_SQL = '{0}' where F_FormName = '{1}' and F_ReportName = '{2}'", F.meSQL.Text, sFormName, dr["F_ReportName"].ToString()); myHelper.ExecuteSQL(sSQL); } F.Dispose(); }
private void sbOK_Click(object sender, EventArgs e) { if (textEdit2.Text.Length == 0) { MessageBox.Show("请输入类别编码!!", "揭示"); textEdit2.Focus(); return; } if (textEdit3.Text.Length == 0) { MessageBox.Show("请输入类别名称!!", "揭示"); textEdit3.Focus(); return; } string strID = textEdit1.Text + textEdit2.Text; string strSQL = ""; if (strCID == "") { strSQL = "insert into t_Class(F_UPID,F_ID,F_Name,F_Tag,F_Table,F_Key) values('" + strPID + "','" + strID + "','" + textEdit3.Text + "','0','" + strTable + "','" + strKey + "')"; } else { strSQL = "update t_Class set F_Name = '" + textEdit3.Text + "' where F_ID = '" + strCID + "'"; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL(strSQL) == 0) { this.DialogResult = DialogResult.OK; } }
/// <summary> /// 删除 /// </summary> protected override void Del() { if (gvList.FocusedRowHandle < 0) { return; } DataRow dr = gvList.GetDataRow(gvList.FocusedRowHandle); if (Convert.ToBoolean(dr["F_Check"]) == true) { MessageBox.Show(this, "不能删除已审核的单据!!", "提示"); return; } if (MessageBox.Show(this, "真的要删除选定单据吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("delete from t_Certificate where F_ID = " + dr["F_ID"].ToString()) == 0) { BindData(); } base.Del(); }
private void sbOK_Click(object sender, EventArgs e) { if (textEdit1.Text != textEdit2.Text) { MessageBox.Show("校验新密码错!!", "提示"); textEdit2.Focus(); return; } if (textEdit1.Text.Length == 0) { if (MessageBox.Show(this, "你要将本用户密码设为空吗!!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { textEdit1.Focus(); return; } } string strSQL = "update t_User set F_Psw = '" + textEdit1.Text + "' where F_ID = '" + strID + "'"; DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL(strSQL) == 0) { Close(); } }
private void btnOK_Click(object sender, EventArgs e) { if (txtReport.txtEdit.Text == "") { MessageBox.Show("报表名称不能为空!!", "提示"); txtReport.Focus(); return; } string sSQL = ""; if (sReportName == "") { sSQL = string.Format("insert into t_ReportFormat(F_FormName,F_ReportName) values('{0}','{1}')", sFormName, txtReport.txtEdit.Text); } else { sSQL = string.Format("update t_ReportFormat set F_ReportName = '{0}' where F_FormName = '{1}' and F_ReportName = {2}", txtReport.txtEdit.Text, sFormName, sReportName); } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL(sSQL) == 0) { this.DialogResult = DialogResult.OK; } }
private void Add(object sender, EventArgs e) { if (comboBoxEdit1.SelectedIndex < 0) { MessageBox.Show(this, "请选择审核步骤!", "提示"); return; } if (lookUpEdit2.EditValue == DBNull.Value) { MessageBox.Show(this, "请选择审核人!", "提示"); return; } if (comboBoxEdit3.SelectedIndex < 0) { MessageBox.Show(this, "请选择下一步!", "提示"); return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); string sSQL = string.Format("insert into t_MultCheck(F_BillType,F_CheckLevel,F_CheckMan,F_NextLevel) values('{0}',{1},'{2}',{3})", comboBoxEdit2.Text, comboBoxEdit1.Text, lookUpEdit2.EditValue, comboBoxEdit3.Text); if (myHelper.ExecuteSQL(sSQL) == 0) { DataBind(comboBoxEdit2.Text); } }
private void sbOK_Click(object sender, EventArgs e) { string strSQL = ""; if (txtName.Text.Length == 0) { MessageBox.Show("报表名称不能为空!!", "提示"); txtName.Focus(); return; } if (cbType.Text.Length == 0) { MessageBox.Show("报表名称不能为空!!", "提示"); cbType.Focus(); return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (pFlag == false) { strSQL = "insert into t_UserReport(F_Name,F_Type) values('" + txtName.Text + "','" + cbType.Text + "')"; } else { strSQL = "update t_UserReport set F_Name = '" + txtName.Text + "',F_Type = '" + cbType.Text + "' where F_Name = '" + strName + "'"; } if (myHelper.ExecuteSQL(strSQL) == 0) { this.DialogResult = DialogResult.OK; } }
private void DoKQ(DataRow dr, string dField, string tField) { DateTime dtTime = Convert.ToDateTime(dr["F_Time"]); string strSQL = @" if not Exists (select * from t_CardRecord where YEAR(F_Date) = " + dtTime.Year.ToString() + @" and MONTH(F_Date) = " + dtTime.Month.ToString() + @" and DAY(F_Date) = " + dtTime.Day.ToString() + @" and F_ID = '" + dr["F_EmpID"].ToString() + @"') begin insert into t_CardRecord(F_Date,F_ID," + dField + ") values('" + dtTime.ToString() + "','" + dr["F_EmpID"].ToString() + "','" + dr[tField].ToString() + @"') end else begin update t_CardRecord set " + dField + " = '" + dr[tField].ToString() + "' where YEAR(F_Date) = " + dtTime.Year.ToString() + @" and MONTH(F_Date) = " + dtTime.Month.ToString() + @" and DAY(F_Date) = " + dtTime.Day.ToString() + @" and F_ID = '" + dr["F_EmpID"].ToString() + @"' end update t_RealCard set F_Flag = 1 where Aid = " + dr["Aid"].ToString(); DataLib.DataHelper myHelper = new DataLib.DataHelper(); myHelper.ExecuteSQL(strSQL); }
private void DelRow(object sender, EventArgs e) { if (viewField.FocusedRowHandle < 0) { return; } DataRow dr = viewField.GetDataRow(viewField.FocusedRowHandle); if (Convert.ToBoolean(dr["F_Sys"]) == true) { MessageBox.Show(this, "不能删除系统预设字段!", "提示"); return; } if (MessageBox.Show(this, "真的要删除选定的数据列吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } string strSQL = ""; DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (dr["F_Type"].ToString() == "计算字段") { strSQL = "delete from t_SysField where F_TableName = '" + dr["F_TableName"].ToString() + "' and F_FieldName = '" + dr["F_FieldName"].ToString() + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { viewField.DeleteRow(viewField.FocusedRowHandle); RefreshField(tvTable.SelectedNode.Tag.ToString()); } } else { strSQL = "exec sp_uDropColumn '" + dr["F_TableName"].ToString() + "','" + dr["F_FieldName"].ToString() + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { strSQL = "delete from t_SysField where F_TableName = '" + dr["F_TableName"].ToString() + "' and F_FieldName = '" + dr["F_FieldName"].ToString() + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { viewField.DeleteRow(viewField.FocusedRowHandle); RefreshField(tvTable.SelectedNode.Tag.ToString()); } } } }
/// <summary> /// 应收款结帐 /// </summary> private void AcceptCheck() { string strSQL = ""; DateTime dtValue = Convert.ToDateTime("1900-1-1"); //DateTime dtValue = Convert.ToDateTime(deAccept.EditValue); string strYear = dtValue.Year.ToString(); string strMonth = dtValue.Month.ToString().PadLeft(2, '0'); string strValue = strYear + strMonth; strSQL = "select top 1 * from t_AcceptCheck where F_Month = '" + strValue + "'"; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs(strSQL); if (ds.Tables[0].Rows.Count > 0) { MessageBox.Show("本月已结过帐!!"); return; } ds.Dispose(); if (MessageBox.Show(this, "真的要对本月进行收款结帐吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } //deAccept.Enabled = false; //lbAccept.Visible = true; //groupBox3.Update(); try { /* * ds = myHelper.GetDs("sp_noAcceptCheck '" + dtValue.ToString() + "'"); * * if (ds.Tables[0].Rows.Count > 0) * { * MessageBox.Show("本月存在未审核的单据"); * frmNoCheck myNoCheck = new frmNoCheck(); * myNoCheck.dtValue = dtValue; * myNoCheck.ShowDialog(); * myNoCheck.Dispose(); * return; * } * ds.Dispose(); */ //strSQL = "sp_AcceptCheck '" + dePay.EditValue.ToString() + "'"; strSQL = ""; if (myHelper.ExecuteSQL(strSQL) == 0) { MessageBox.Show("结帐操作成功!!"); } } finally { //deAccept.Enabled = true; //lbAccept.Visible = false; } }
/// <summary> /// 删除原数据 /// </summary> /// <returns></returns> private int DelData() { DataLib.DataHelper myHelper = new DataLib.DataHelper(); StreamReader sr = File.OpenText(strPath + "t_SQL.txt"); string strSQL = sr.ReadToEnd(); sr.Dispose(); return(myHelper.ExecuteSQL(strSQL)); }
/// <summary> /// 库存结帐 /// </summary> private void StoreCheck() { string strSQL = ""; DateTime dtValue = Convert.ToDateTime(dtMonth.EditValue); string strYear = dtValue.Year.ToString(); string strMonth = dtValue.Month.ToString().PadLeft(2, '0'); string strValue = strYear + strMonth; strSQL = "select top 1 * from t_StorageCheck where F_Month = '" + strValue + "'"; DataLib.DataHelper myHelper = new DataLib.DataHelper(); DataSet ds = myHelper.GetDs(strSQL); if (ds.Tables[0].Rows.Count > 0) { MessageBox.Show("本月已结过帐!!"); return; } ds.Dispose(); if (MessageBox.Show(this, "真的要对本月进行库存结帐吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } dtMonth.Enabled = false; lbFlag.Visible = true; groupBox1.Update(); try { ds = myHelper.GetDs("sp_noCheck '" + dtValue.ToString() + "'"); if (ds.Tables[0].Rows.Count > 0) { MessageBox.Show("本月存在未审核的单据"); frmNoCheck myNoCheck = new frmNoCheck(); myNoCheck.dtValue = dtValue; myNoCheck.ShowDialog(); myNoCheck.Dispose(); return; } ds.Dispose(); strSQL = "sp_StorageCheck '" + dtMonth.EditValue.ToString() + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { MessageBox.Show("结帐操作成功!!"); } } finally { dtMonth.Enabled = true; lbFlag.Visible = false; } }
private void AddOtherField() { int iCheck = 0; if (ckNull.Checked == true) { iCheck = 1; } string strSQL = string.Format("insert into t_SysField values('{0}','{1}','{2}','{3}','{4}','{5}',{6},'{7}','{8}','{9}',{10},{11},'{12}','{13}','{14}')", strModuleName, strTableText, strTableName, txtFielText.Text, txtField.Text, cbType.Text, msLength.Text, txtDefault.Text, richTextBox1.Text, strExpress, iCheck.ToString(), 0, richTextBox2.Text, txtDispField.Text, txtValueField.Text); DataLib.DataHelper myHelper = new DataLib.DataHelper(); myHelper.ExecuteSQL(strSQL); }
private void btnOK_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "真的要启用财务系统吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("update t_CompanyInfo set F_cwInit = 1,F_cwInitDate = '" + DateTime.Now + "'") == 0) { MessageBox.Show(this, "财务系统启用成功!!", "提示"); } btnOK.Enabled = false; }
protected override void CheckBill() { //base.CheckBill(); if (MessageBox.Show(this, "真的要审核本单吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("update " + strMTable + " set F_ReCheck = 1,F_ReCheckMan = '" + DataLib.SysVar.strUName + "',F_ReCheckDate = '" + DataLib.SysVar.GetDate().ToString() + "' where F_BillID = '" + editControl1.GetValue().ToString() + "'") == 0) { SetStatus(3); } }
/// <summary> /// 生成当月工资 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void sbGen_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "真的要生成本月工资吗,这将刷新当前结果,慎用!!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { DataLib.DataHelper myHelper = new DataLib.DataHelper(); string strSQL = ""; strSQL = "sp_GenGroupWage '" + GetDate() + "'"; if (myHelper.ExecuteSQL(strSQL) == 0) { DataBind(); } } }
private void BankIni() { if (MessageBox.Show(this, "启用期初后将不能再修改,真的要启用银行期初吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("update t_CashInit set F_BankIni = " + spinEdit1.Value.ToString() + ",F_Bank = 1") == 0) { spinEdit1.Enabled = false; sbOK.Enabled = false; MessageBox.Show(this, "银行期初启用成功!!", "提示"); } }
/// <summary> /// 生成当月工资 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void sbGen_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "真的要生成本月工资吗,这将刷新当前结果,慎用!!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { DataLib.DataHelper myHelper = new DataLib.DataHelper(); string strSQL = ""; int intMonth = cbMonth.SelectedIndex + 1; strSQL = "s_CalWage " + spYear.Text + "," + intMonth.ToString(); if (myHelper.ExecuteSQL(strSQL) == 0) { DataBind(); } } }
private void btnAdd_Click(object sender, EventArgs e) { frmAddTime F = new frmAddTime(); if (F.ShowDialog() == DialogResult.OK) { DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("insert into t_SetTime(F_Time) values('" + F.meTime.Text + "')") == 0) { DataBind(); } } F.Dispose(); }
private void sbDel_Click(object sender, EventArgs e) { if (gvMain.FocusedRowHandle < 0) { return; } if (MessageBox.Show(this, "真的要删除选定用户吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("delete from t_AddType where F_Name = '" + gvMain.GetRowCellValue(gvMain.FocusedRowHandle, "F_Name").ToString() + "'") == 0) { gvMain.DeleteRow(gvMain.FocusedRowHandle); } }
private void Del() { if (lvModule.SelectedItems.Count == 0) { return; } if (MessageBox.Show(this, "真的要删选定模块吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } DataLib.DataHelper myHelper = new DataLib.DataHelper(); if (myHelper.ExecuteSQL("delete from t_UserModule where F_Parent = '" + tvParent.SelectedNode.Text + "' and F_ModuleName = '" + lvModule.SelectedItems[0].Text + "'") != -1) { lvModule.SelectedItems[0].Remove(); } }