protected override void ExecItemDelete() { base.ExecItemDelete(); List <string> sql = new List <string>(); string msg = ""; int RecNo = Report.DetailGrid.Recordset.RecordNo; Report.DetailGrid.Recordset.First(); while (!Report.DetailGrid.Recordset.Eof()) { if (Report.FieldByName("Checked").AsInteger == (int)GRSystemImage.grsi3DChecked) { GetDelSql(0, ref sql); msg = msg + GetDelMsg(0) + ";"; } Report.DetailGrid.Recordset.Next(); } Report.DetailGrid.Recordset.MoveTo(RecNo); if (sql.Count == 0) { Pub.MessageBoxShow(Pub.GetResText(formCode, "MsgNoSelectDelete", "")); return; } GetDelSqlExt(ref sql); if (db.ExecSQL(sql) != 0) { return; } db.WriteSYLog(this.Text, CurrentTool, msg); ExecItemRefresh(); Pub.MessageBoxShow(Pub.GetResText(formCode, "MsgDeleteSucceed", ""), MessageBoxIcon.Information); }
private void Report2FetchRecord()//生成自定义报表:第二步,载入数据 { for (int count = 0; count < table.Rows.Count; count++) { Report2.DetailGrid.Recordset.Append();//单行新增开始 Report2.FieldByName("Name").AsString = table.Rows[count]["Name"].ToString(); Report2.FieldByName("Title").AsString = table.Rows[count]["Title"].ToString(); Report2.FieldByName("TitleOfCourtesy").AsString = table.Rows[count]["TitleOfCourtesy"].ToString(); Report2.FieldByName("HomePhone").AsString = table.Rows[count]["HomePhone"].ToString(); Report2.FieldByName("PostalCode").AsString = table.Rows[count]["PostalCode"].ToString(); Report2.DetailGrid.Recordset.Post();//单行新增结束 } }
private void axGRDisplayViewer1_ContentCellDblClick(object sender, global::AxgrproLib._IGRDisplayViewerEvents_ContentCellDblClickEvent e) { //获取对应列的行头值 string ReceiptId = Report.FieldByName("单据号").AsString; string ReceiptTypeId = Report.FieldByName("单据类别").AsString; if (ReceiptId == "") { return; } ListModalForm listModalForm = new ListModalForm(ReceiptTypeId, "edit", ReceiptId, ""); listModalForm.MdiParent = this.MdiParent; listModalForm.Show(); }
private void ReportInitialize() { //在此记录下每个字段的接口指针 serial = Report.FieldByName("serial"); product = Report.FieldByName("product"); cnt_one_piece = Report.FieldByName("cnt_one_piece"); pieces = Report.FieldByName("pieces"); unit = Report.FieldByName("unit"); cnt = Report.FieldByName("cnt"); price = Report.FieldByName("price"); sum_price = Report.FieldByName("sum_price"); comment = Report.FieldByName("comment"); }
protected override void ExecItemDelete() { // if (Pub.MessageBoxShowQuestion(Pub.GetResText(formCode, "Msg002", ""))) return; SystemInfo.IsGetData = false; frmSFMacData frm1 = new frmSFMacData(1, CurrentTool); frm1.ShowDialog(); if (!db.IsGetDate()) { return; } string GUID = ""; if (CheckAllowanceStatus("Error111", ref GUID) != 0) { return; } string sql = Pub.GetSQL(DBCode.DB_004006, new string[] { "16", GUID }); string msg = Report.FieldByName("EmpNo").AsString + '[' + Report.FieldByName("AllowanceFlag").AsString + " " + Report.FieldByName("AllowanceAmountSum").AsString + "]"; try { db.ExecSQL(sql); } catch (Exception E) { Pub.ShowErrorMsg(E, sql); return; } db.WriteSYLog(this.Text, CurrentTool, msg + "[" + sql + "]"); dispView.Refresh(); //dispView1.Refresh(); dispView1.Stop(); dispView1.Start(); RefreshForm(true); Pub.MessageBoxShow(Pub.GetResText(formCode, "MsgDeleteSucceed", ""), MessageBoxIcon.Information); }
void SubReport_Initialize() { //此处相当于重新绑定了SQL查询语句(可为另一个不同的SQL) string ReceiptId = Report.FieldByName("单据号").AsString; string strSql = "select T_Receipts_Det.ReceiptId as 单据号,T_Receipts_Det.MatId 商品编号, T_MatInf.matname 商品名称," + "T_Receipts_Det.num 数量,T_MatInf.Units 单位, T_Receipts_Det.price 单价,T_Receipts_Det.Amount 金额," + "T_Receipts_Det.BoxNo 箱号, T_Receipts_Det.lotCode 批号 from T_Receipts_Det, " + "T_MatInf where T_Receipts_Det.MatId= T_MatInf.MatId " + "and ReceiptID='{0}'"; strSql = string.Format(strSql, ReceiptId); SubReport.DetailGrid.Recordset.QuerySQL = strSql; }
private void ReportViewer_ContentCellDblClick(object sender, AxgrproLib._IGRDisplayViewerEvents_ContentCellDblClickEvent e) { if (!IsSupportChildReport) { return; } try { int billID = _Report.FieldByName("ID").AsInteger; FrmChildReport rpt = new FrmChildReport(billID); rpt.ShowDialog(this); } catch (Exception ex) { ErrorHandler.OnError(ex); } }
/// <summary> /// 初始化报表列字段对象 /// </summary> private void ReportInitialize() { _billCode = _report.FieldByName("单号"); _senderName = _report.FieldByName("寄件人姓名"); _departure = _report.FieldByName("始发地"); _senderAddress = _report.FieldByName("寄件人详址"); _senderCompany = _report.FieldByName("寄件人公司"); _senderPhone = _report.FieldByName("寄件人电话"); _receiverName = _report.FieldByName("收件人姓名"); _destination = _report.FieldByName("目的地"); _receiverAddress = _report.FieldByName("收件人详址"); _receiverCompany = _report.FieldByName("收件人公司"); _receiverPhone = _report.FieldByName("收件人电话"); _description = _report.FieldByName("品名"); _amount = _report.FieldByName("数量"); _remarks = _report.FieldByName("备注"); _sendTime = _report.FieldByName("寄件时间"); _weight = _report.FieldByName("重量"); _totalMoney = _report.FieldByName("费用总计"); _bigPen = _report.FieldByName("大头笔"); _pageField = _report.FieldByName("Page"); _countField = _report.FieldByName("Count"); _qRCodeField = _report.FieldByName("二维码"); _orderNumberField = _report.FieldByName("订单号"); _toPayMentField = _report.FieldByName("到付款"); _goodsPayMentField = _report.FieldByName("代收货款"); _sendSiteField = _report.FieldByName("发件网点"); }
/// <summary> /// 初始化报表列字段对象 /// </summary> private void ReportInitialize() { billCode = _report.FieldByName("单号"); senderName = _report.FieldByName("寄件人姓名"); departure = _report.FieldByName("始发地"); senderAddress = _report.FieldByName("寄件人详址"); senderCompany = _report.FieldByName("寄件人公司"); senderPhone = _report.FieldByName("寄件人电话"); receiverName = _report.FieldByName("收件人姓名"); destination = _report.FieldByName("目的地"); receiverAddress = _report.FieldByName("收件人详址"); receiverCompany = _report.FieldByName("收件人公司"); receiverPhone = _report.FieldByName("收件人电话"); description = _report.FieldByName("品名"); amount = _report.FieldByName("数量"); remarks = _report.FieldByName("备注"); sendTime = _report.FieldByName("寄件时间"); weight = _report.FieldByName("重量"); totalMoney = _report.FieldByName("费用总计"); bigPen = _report.FieldByName("大头笔"); _sendSiteField = _report.FieldByName("发件网点"); }
protected override void ExecItemDelete() { base.ExecItemDelete(); List <string> sql = new List <string>(); List <string> sqlThread = new List <string>(); string msg = ""; string info = ""; int count = 0; int maxWorkerThreads = 0; int workerThreads = 0; int portThreads = 0; progBar.ProgressType = eProgressItemType.Marquee; int RecNo = Report.DetailGrid.Recordset.RecordNo; Report.DetailGrid.Recordset.First(); while (!Report.DetailGrid.Recordset.Eof()) { if (Report.FieldByName("Checked").AsInteger == (int)GRSystemImage.grsiChecked) { count++; info = GetDelMsg(0); lblMsg.Text = Pub.GetResText(formCode, "ItemDelete", "") + " " + info + "..." + count + "/" + count; GetDelSql(0, ref sql); msg = msg + info + ";"; if (sql.Count >= 2000) { GetDelSqlExt(ref sql); sqlThread = new List <string>(sql); ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessFile), sqlThread); sql.Clear(); } } Report.DetailGrid.Recordset.Next(); } Report.DetailGrid.Recordset.MoveTo(RecNo); if (sql.Count == 0 && sqlThread.Count == 0) { Pub.MessageBoxShow(Pub.GetResText(formCode, "MsgNoSelectDelete", "")); { return; } } while (true) { Thread.Sleep(1000); ThreadPool.GetMaxThreads(out maxWorkerThreads, out portThreads); ThreadPool.GetAvailableThreads(out workerThreads, out portThreads); if (maxWorkerThreads - workerThreads <= 1) { break; } Application.DoEvents(); } if (sql.Count > 0) { GetDelSqlExt(ref sql); if (SystemInfo.db.ExecSQL(sql) != 0) { return; } } progBar.ProgressType = eProgressItemType.Standard; SystemInfo.db.WriteSYLog(this.Text, CurrentTool, msg); Pub.MessageBoxShow(Pub.GetResText(formCode, "MsgDeleteSucceed", ""), MessageBoxIcon.Information); ExecItemRefresh(); }
protected override void ExecItemSearch() { List <string> FieldText = new List <string>(); List <string> FieldName = new List <string>(); List <GRFieldType> FieldType = new List <GRFieldType>(); string s = ""; string FindKeyWord = formCode; if (tabControl1.SelectedIndex == 0) { for (int i = 1; i <= Report.DetailGrid.Columns.Count; i++) { if (Report.DetailGrid.Columns[i].TitleCell.FreeCell) { continue; } s = Report.DetailGrid.Columns[i].TitleCell.Text; if (Report.DetailGrid.Columns[i].TitleCell.SupCell != null) { s = Report.DetailGrid.Columns[i].TitleCell.SupCell.Text + s; } FieldText.Add(s); s = Report.DetailGrid.Columns[i].ContentCell.DataField; FieldName.Add(s); FieldType.Add(Report.FieldByName(s).FieldType); } frmPubFind frm = new frmPubFind(this.Text + "[" + CurrentTool + "]", FindSQL, FindOrderBy, FindKeyWord, FieldText, FieldName, FieldType, false); if (frm.ShowDialog() == DialogResult.OK) { QuerySQL = frm.QuerySQL; ExecItemRefresh(); } } else { FindKeyWord += "History"; for (int i = 1; i <= Report1.DetailGrid.Columns.Count - 1; i++) { if (Report1.DetailGrid.Columns[i].TitleCell.FreeCell) { continue; } s = Report1.DetailGrid.Columns[i].TitleCell.Text; if (Report1.DetailGrid.Columns[i].TitleCell.SupCell != null) { s = Report1.DetailGrid.Columns[i].TitleCell.SupCell.Text + s; } FieldText.Add(s); s = Report1.DetailGrid.Columns[i].ContentCell.DataField; FieldName.Add(s); FieldType.Add(Report1.FieldByName(s).FieldType); } frmPubFind frm = new frmPubFind(this.Text + "[" + CurrentTool + "]", FindSQL1, FindOrderBy, FindKeyWord, FieldText, FieldName, FieldType, false); if (frm.ShowDialog() == DialogResult.OK) { QuerySQL1 = frm.QuerySQL; ExecItemRefresh(); } } }