using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
using System.Data.OleDb;
|
using System.Data.Sql;
|
using grproLib;
|
|
namespace NETERP
|
{
|
public partial class Gy_DataInTmp : Form
|
{
|
|
|
public Gy_DataInTmp()
|
{
|
InitializeComponent();
|
}
|
|
//
|
public string ModCaption = "Êý¾Ýµ¼ÈëÄ£¿é";
|
public string ModName = "9999";
|
public string ModRightName = "Gy_DataInTmp";
|
public string ModRightNameEdit = "_Edit";
|
public string ModRightNameCheck = "_Check";
|
public string ModRightNameClose = "_Close";
|
public string ModRightNameDelete = "_Delete";
|
public string ModRightNameMoney = "_Money";
|
public string ModRightNameQty = "_Qty";
|
Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
|
|
public string ExcelPath;
|
public string sSheetName;
|
|
#region ¹Ì¶¨´úÂë
|
|
//³õʼ»¯Íø¸ñ
|
private void initGrid()
|
{
|
DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
|
}
|
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled = false;
|
}
|
|
private void sx_Click(object sender, EventArgs e)
|
{
|
timer1.Enabled = true;
|
}
|
|
private void tc_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
private void Gy_DataInTmp_Load(object sender, EventArgs e)
|
{
|
//
|
this.Text = ModCaption;
|
lblCaption.Text = ModCaption;
|
oSumGrid.ogrdMain = grdMain; //³õʼ»¯ new
|
oSumGrid.oGridsum = grdSum;
|
initData();
|
initGrid();
|
}
|
|
private void bclk_Click(object sender, EventArgs e)
|
{
|
//±£´æÁпí
|
DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
|
}
|
|
private void mrlk_Click(object sender, EventArgs e)
|
{
|
DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
|
}
|
|
//
|
private void GraphLine()
|
{
|
long n = 0;
|
//ÏÔʾ
|
//lbldj.Text = "²éѯ³ö " + n.ToString() + " Õŵ¥¾Ý";
|
lbljl.Text = "¹²ÓÐ " + grdMain.RowCount.ToString() + " Ìõ¼Ç¼";
|
|
}
|
|
//ºÏ¼Æ new
|
private void Total()
|
{
|
if (grdMain.Rows.Count > 0 && grdMain.ColumnCount > 0)
|
{
|
oSumGrid.SetGridsum();
|
oSumGrid.Total();
|
}
|
}
|
|
//ºÏ¼Æ new
|
private void grdMain_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
|
{
|
Total();
|
}
|
//ºÏ¼Æ new
|
private void grdMain_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)
|
{
|
Total();
|
}
|
|
|
private void cmdHPath_Click(object sender, EventArgs e)
|
{
|
OpenExcelFile.Title = "Open Excel File ";
|
OpenExcelFile.FileName = "";
|
OpenExcelFile.Filter = "Microsoft Office Excel Files(*.xls)|*.xls";
|
OpenExcelFile.ShowDialog();
|
if (OpenExcelFile.FileName != "")
|
{
|
ExcelPath = OpenExcelFile.FileName;
|
OpenExcelData();
|
}
|
else
|
{
|
ExcelPath = "";
|
}
|
}
|
|
|
private void dc_Click(object sender, EventArgs e)
|
{
|
DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain);
|
}
|
|
//
|
public virtual bool OpenExcelData()
|
{
|
if (ExcelPath.Trim() == "")
|
{
|
MessageBox.Show("´íÎóµÄ·¾¶£¡");
|
return false;
|
}
|
if (sSheetName.Trim() == "")
|
{
|
MessageBox.Show("´íÎóµÄ¹¤×÷²¾£¡");
|
return false;
|
}
|
return DBUtility.Gy_BaseFun.OpenExcelData(ExcelPath, sSheetName, grdMain);
|
}
|
|
private void Out_Click(object sender, EventArgs e)
|
{
|
if (grdMain.Rows.Count == 0)
|
{
|
MessageBox.Show("ûÓпÉÒÔµ¼ÈëµÄÊý¾Ý£¡");
|
return;
|
}
|
Sub_DataIn();
|
}
|
#endregion
|
//
|
|
|
|
|
#region //´òÓ¡ÉèÖÃ
|
|
GridppReport Report;
|
|
private void set_Click(object sender, EventArgs e)
|
{
|
//Ñ¡Ôñ´òÓ¡Ä£°å
|
BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
|
oFrm.sBillName = ModName;
|
oFrm.sBillModel = ModCaption;
|
oFrm.ShowDialog();
|
}
|
|
private void dy_Click(object sender, EventArgs e)
|
{
|
//Ñ¡Ôñ´òÓ¡Ä£°å
|
BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
|
oFrm.sBillName = ModName;
|
oFrm.sBillModel = ModCaption;
|
oFrm.ShowDialog();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
//
|
Sub_SetReport(oFrm.sOpenTmp);
|
Report.Print(true);
|
}
|
}
|
|
//Ô¤ÀÀ
|
private void yl_Click(object sender, EventArgs e)
|
{
|
//Ñ¡Ôñ´òÓ¡Ä£°å
|
BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
|
oFrm.sBillName = ModName;
|
oFrm.sBillModel = ModCaption;
|
oFrm.ShowDialog();
|
if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
|
{
|
//
|
Sub_SetReport(oFrm.sOpenTmp);
|
Report.PrintPreview(true);
|
}
|
}
|
|
private void Sub_SetReport(string sOpenTmp)
|
{
|
//ÅжÏÐÐÊý
|
//
|
Report = new GridppReport();
|
Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here .
|
Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
|
}
|
|
private void ReportFetchRecordByDataTable()
|
{
|
BLL.Utility.FillRecordToReport(Report, grdMain, grdPrint, 0);
|
}
|
|
#endregion
|
|
|
|
public virtual void Sub_DataIn()
|
{
|
return;
|
}
|
|
|
public virtual void initData()
|
{
|
ExcelPath = "";
|
}
|
}
|
}
|