| | |
| | | public string ViewName = "h_v_KF_ICInventoryList_WMS"; |
| | | public string ModCaption = "æ¡ç åºåæ¥è¯¢"; |
| | | public const string ModName = "3302"; |
| | | public const string ModRightName = "Gy_BarCodeBillList"; |
| | | //public const string ModRightNameEdit = ModRightName + "_Edit"; |
| | | //public const string ModRightNameCheck = ModRightName + "_Check"; |
| | | //public const string ModRightNameClose = ModRightName + "_Close"; |
| | | public const string ModRightNameDelete = ModRightName + "_Delete"; |
| | | public const string ModRightNamePrint = ModRightName + "_Print"; |
| | | //DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //public Gy_ICBomBill oFrm; |
| | | public string sDlgWhere = ""; //å¤çªä½éå
¥ |
| | | public int selectRow = 0; |
| | | Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum(); |
| | | // |
| | | |
| | | |
| | | #region åºå®ä»£ç |
| | | |
| | | private void Kf_ICInventory_BarCode_Load(object sender, EventArgs e) |
| | | { |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | this.Text = ModCaption; |
| | | oSumGrid.ogrdMain = grdMain; //åå§å new |
| | | oSumGrid.oGridsum = grdSum; |
| | | lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | | } |
| | | |
| | | private void initGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain,this.Name); |
| | | |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name); |
| | | grdMain.ReadOnly = false; |
| | | } |
| | | // |
| | | |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled = false; |
| | | initGrid(); |
| | | } |
| | | |
| | | private void timer2_Tick(object sender, EventArgs e) |
| | | { |
| | | timer2.Enabled = false; |
| | | if (sDlgWhere == "") |
| | | { |
| | | } |
| | | else |
| | | { |
| | | timer1.Enabled = true; |
| | | } |
| | | } |
| | | |
| | | private void grdMain_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void GraphicsGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain); |
| | | } |
| | | |
| | | //å计 new |
| | | private void grdMain_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e) |
| | | { |
| | | Total(); |
| | | } |
| | | |
| | | //å计 new |
| | | private void grdMain_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e) |
| | | { |
| | | Total(); |
| | | } |
| | | |
| | | //å计 new |
| | | private void Total() |
| | | { |
| | | if (grdMain.Rows.Count > 0 && grdMain.ColumnCount > 0) |
| | | { |
| | | oSumGrid.SetGridsum(); |
| | | oSumGrid.Total(); |
| | | } |
| | | } |
| | | |
| | | private void GraphLine() |
| | | { |
| | | //int MainIDCol = Fun_GetCol("hmainid"); |
| | | //int SubIDCol = Fun_GetCol("hsubid"); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //long n=0; |
| | | //DBUtility.Xt_BaseBillFun.GraphLine(grdMain, MainIDCol, SubIDCol, s,ref n); |
| | | ////æ¾ç¤º |
| | | //lbldj.Text = "æ¥è¯¢åº " + n.ToString() + " å¼ åæ®"; |
| | | //lbljl.Text = "å
±æ " + grdMain.RowCount.ToString() + " æ¡è®°å½"; |
| | | } |
| | | |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain); |
| | | } |
| | | |
| | | private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) |
| | | { |
| | | int sHQtyCol = Fun_GetCol("æ°é"); |
| | | int i = grdMain.CurrentCell.ColumnIndex; |
| | | if (i != sHQtyCol) |
| | | { |
| | | e.Cancel = true; |
| | | } |
| | | } |
| | | |
| | | //ä¿åå宽 |
| | | 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); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æ¥è¯¢åè½ |
| | | |
| | | //æ¥è¯¢ |
| | | private void cx_Click(object sender, EventArgs e) |
| | | { |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | SetCondition(frmCondition, ViewName, this.Name); |
| | | frmCondition.ShowDialog(); |
| | | if (frmCondition.Tag.ToString() == "OK") |
| | | { |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name) |
| | | { |
| | | frmCondition.Tag = ""; |
| | | frmCondition.ViewName = ViewName; |
| | | frmCondition.ModName = Name; |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol); |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | |
| | | |
| | | Total(); |
| | | // |
| | | } |
| | | // |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled = false; |
| | | initGrid(); |
| | | //Sub_FastQuery(); |
| | | } |
| | | |
| | | private void tc_Click(object sender, EventArgs e) |
| | | { |
| | | this.Close(); |
| | | } |
| | | |
| | | private void sx_Click(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled = true; |
| | | } |
| | | |
| | | private void dj_Click(object sender, EventArgs e) |
| | | { |
| | | Sub_ShowBill(); |
| | | } |
| | | //æ¾ç¤ºåæ® |
| | | private void Sub_ShowBill() |
| | | { |
| | | //Int64 lngBillKey = 0; |
| | | //if (grdMain.CurrentRow == null) |
| | | // return; |
| | | //lngBillKey =DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | //if (lngBillKey == 0) |
| | | // return; |
| | | //DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | //{ |
| | | // oFrm = new Gy_ICBomBill(); |
| | | // oFrm.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | // oFrm.BillOld = oBill; |
| | | // oFrm.ShowDialog(); |
| | | // if (oFrm.BillChange) |
| | | // { |
| | | // if (MessageBox.Show("åæ®å表已ç»åçåå,æ¯å¦å·æ°", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | // { |
| | | // timer1.Enabled = true; |
| | | // } |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // MessageBox.Show("åæ®æªæ¾å°", "æç¤º"); |
| | | //} |
| | | //oBill = null; |
| | | } |
| | | // |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain); |
| | | } |
| | | // |
| | | private void Kf_ICInventory_BarCode_Load(object sender, EventArgs e) |
| | | { |
| | | // |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | this.Text = ModCaption; |
| | | oSumGrid.ogrdMain = grdMain; //åå§å new |
| | | oSumGrid.oGridsum = grdSum; |
| | | lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | | //åå§åå¿«éè¿æ»¤ |
| | | //dtpHBDate.Checked = false; |
| | | //dtpHEDate.Checked = false; |
| | | cmbHStatus.SelectedIndex = 0; |
| | | } |
| | | |
| | | private void grdMain_DblClick(object sender, EventArgs e) |
| | | { |
| | | Sub_ShowBill(); |
| | | } |
| | | |
| | | private void cx_Click(object sender, EventArgs e) |
| | | { |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | SetCondition(frmCondition, ViewName, this.Name); |
| | | frmCondition.ShowDialog(); |
| | | if (frmCondition.Tag.ToString() == "OK") |
| | | { |
| | | Display(); |
| | | //Sub_FastQuery(); |
| | | } |
| | | } |
| | | |
| | | public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name) |
| | | { |
| | | frmCondition.Tag = ""; |
| | | frmCondition.ViewName = ViewName; |
| | | frmCondition.ModName = Name; |
| | | } |
| | | |
| | | private void xz_Click(object sender, EventArgs e) |
| | | { |
| | | // |
| | | //oFrm = new Gy_ICBomBill(); |
| | | //oFrm.ShowDialog(); |
| | | } |
| | | |
| | | private void sc_Click(object sender, EventArgs e) |
| | | { |
| | | Sub_DeleteBill(); |
| | | } |
| | | //å é¤ |
| | | private void Sub_DeleteBill() |
| | | { |
| | | // //ç¼è¾æé |
| | | // if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, true,DBUtility.ClsPub.CurUserName)) |
| | | // { |
| | | // return; |
| | | // } |
| | | // // |
| | | // Int64 lngBillKey = 0; |
| | | // if (grdMain.CurrentRow == null) |
| | | // return; |
| | | // lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | // if (lngBillKey == 0) |
| | | // return; |
| | | // DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | // if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | // { |
| | | // if (MessageBox.Show("ç¡®å®è¦å é¤å½ååæ®ï¼", "æç¤º", MessageBoxButtons.OKCancel)==DialogResult.OK) |
| | | // { |
| | | // if (oBill.omodel.HChecker != "") |
| | | // { |
| | | // MessageBox.Show("忮已ç»å®¡æ ¸,ä¸è½å é¤ï¼", "æç¤º"); |
| | | // return; |
| | | // } |
| | | // if (!oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | // { |
| | | // MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | // return; |
| | | // } |
| | | // else |
| | | // { |
| | | // Display(); |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // MessageBox.Show("åæ®æªæ¾å°", "æç¤º"); |
| | | // } |
| | | } |
| | | |
| | | private void timer2_Tick(object sender, EventArgs e) |
| | | { |
| | | timer2.Enabled = false; |
| | | if (sDlgWhere == "") |
| | | { |
| | | //frmCondition = new frmBillQueryCondition_New(); |
| | | //SetCondition(frmCondition, ViewName, this.Name); |
| | | //frmCondition.ShowDialog(); |
| | | //if (frmCondition.Tag.ToString() == "OK") |
| | | //{ |
| | | // timer1.Enabled = true; |
| | | //} |
| | | //Sub_FastQuery(); |
| | | } |
| | | else |
| | | { |
| | | timer1.Enabled = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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() |
| | | { |
| | | //int MainIDCol = Fun_GetCol("hmainid"); |
| | | //int SubIDCol = Fun_GetCol("hsubid"); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //long n=0; |
| | | //DBUtility.Xt_BaseBillFun.GraphLine(grdMain, MainIDCol, SubIDCol, s,ref n); |
| | | ////æ¾ç¤º |
| | | //lbldj.Text = "æ¥è¯¢åº " + n.ToString() + " å¼ åæ®"; |
| | | //lbljl.Text = "å
±æ " + grdMain.RowCount.ToString() + " æ¡è®°å½"; |
| | | } |
| | | //å®¡æ ¸ |
| | | private void sh_Click(object sender, EventArgs e) |
| | | { |
| | | ////this.Sub_CheckBill(); |
| | | //if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //if (grdMain.CurrentRow == null) |
| | | // return; |
| | | //DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | //if (MessageBox.Show("ç¡®å®è¦åä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0) |
| | | // { |
| | | // if (!oBar.UnCancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value))) |
| | | // { |
| | | // MessageBox.Show("åä½åºå¤±è´¥ï¼", "æç¤º"); |
| | | // return; |
| | | // } |
| | | // } |
| | | //} |
| | | //MessageBox.Show("åä½åºæåï¼", "æç¤º"); |
| | | //Sub_FastQuery(); |
| | | } |
| | | |
| | | //å®¡æ ¸åæ® |
| | | private void Sub_CheckBill() |
| | | { |
| | | //å®¡æ ¸æé |
| | | //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true,DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return; |
| | | //} |
| | | // |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.CurrentRow == null) |
| | | return; |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | MessageBox.Show("åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //å®¡æ ¸ |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸æå!", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | //å审忮 |
| | | private void Sub_AbandonCheck() |
| | | { |
| | | //å®¡æ ¸æé |
| | | //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true,DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return; |
| | | //} |
| | | // |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.CurrentRow == null) |
| | | return; |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("hmainid")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | MessageBox.Show("åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //åå®¡æ ¸ |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("åå®¡æ ¸æå!", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | //ä½åº |
| | | private void qsh_Click(object sender, EventArgs e) |
| | | { |
| | | ////Sub_AbandonCheck(); |
| | | //if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //if (grdMain.CurrentRow == null) |
| | | // return; |
| | | //DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | //if (MessageBox.Show("ç¡®å®è¦ä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | //{ |
| | | // if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0) |
| | | // { |
| | | // if (!oBar.Cancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value))) |
| | | // { |
| | | // MessageBox.Show("ä½åºå¤±è´¥ï¼", "æç¤º"); |
| | | // return; |
| | | // } |
| | | // } |
| | | //} |
| | | //MessageBox.Show("ä½åºæåï¼", "æç¤º"); |
| | | //Sub_FastQuery(); |
| | | } |
| | | |
| | | private void GraphicsGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain); |
| | | } |
| | | |
| | | #region //æå°è®¾ç½® |
| | | |
| | | GridppReport Report; |
| | | //é¢è§ |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("æå°æ¬¡æ°")].Value) > 0) |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNamePrint, 1, false, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | MessageBox.Show("æéæ¡ç å·²ç»æå°ï¼æ¨æ²¡ææéï¼ä¸è½é夿å°ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | //éæ©æå°æ¨¡æ¿ |
| | | string sErr = ""; |
| | | 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) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | selectRow = i; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | //oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | // |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void Sub_SetReport(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | // |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨å¤´ä¿¡æ¯ |
| | | private void ReportBeforePostRecord()//your report?kao |
| | | { |
| | | Report.FieldByName("æ¡ç ç¼å·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | Report.FieldByName("æ°é").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ°é")].Value); |
| | | Report.FieldByName("åä½").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("计éåä½")].Value); |
| | | Report.FieldByName("å
¥åºæ¥æ").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ¥æ")].Value); |
| | | //æå |
| | | Report.FieldByName("客æ·åç§°").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("徿¥åä½")].Value); |
| | | Report.FieldByName("产å代ç ").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | Report.FieldByName("产åå¾å·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | Report.FieldByName("产ååç§°").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | Report.FieldByName("å
è£
æ¹å¼").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("å
è£
æ¹å¼")].Value); |
| | | Report.FieldByName("ç产计å").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æºååå·")].Value); |
| | | Report.FieldByName("æåæ¹æ¬¡").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ¹å·")].Value); |
| | | Report.FieldByName("ç产车é´").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("ç产车é´")].Value); |
| | | Report.FieldByName("çäº§å¨æ").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("çäº§å¨æ")].Value); |
| | | //åæ |
| | | Report.FieldByName("ä¾åºååç§°").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("徿¥åä½")].Value); |
| | | Report.FieldByName("ç©æä»£ç ").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("ç©æä»£ç ")].Value); |
| | | Report.FieldByName("çå·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("ç©æåç§°")].Value); |
| | | Report.FieldByName("åå·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("è§æ ¼åå·")].Value); |
| | | Report.FieldByName("çå·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("çå·")].Value); |
| | | Report.FieldByName("ç©ææ¹æ¬¡").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ¹å·")].Value); |
| | | if (DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("å°¾æ°")].Value) == "å°¾æ°") |
| | | { |
| | | Report.FieldByName("å°¾æ°").AsString = "/////////////////////////"; |
| | | } |
| | | else |
| | | { |
| | | Report.FieldByName("å°¾æ°").AsString = ""; |
| | | } |
| | | } |
| | | |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | BLL.Utility.FillRecordToReport(Report, grdMain, grdPrint, Fun_GetCol("æ¡ç ç¼å·")); |
| | | } |
| | | |
| | | #endregion |
| | | // |
| | | private void grdMain_Paint(object sender, PaintEventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | //å计 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 dy_Click(object sender, EventArgs e) |
| | | { |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | // |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | selectRow = i; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void dy2_Click(object sender, EventArgs e) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("æå°æ¬¡æ°")].Value) > 0) |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNamePrint, 1, false, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | MessageBox.Show("æéæ¡ç å·²ç»æå°ï¼æ¨æ²¡ææéï¼ä¸è½é夿å°ï¼"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | // |
| | | //éæ©æå°æ¨¡æ¿ |
| | | BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp(); |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | oFrm.sBillName = ModName; |
| | | oFrm.sBillModel = ModCaption; |
| | | oFrm.ShowDialog(); |
| | | if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK) |
| | | { |
| | | // |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | selectRow = i; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | // |
| | | //Thread.Sleep(300); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) |
| | | { |
| | | int sHQtyCol = Fun_GetCol("æ°é"); |
| | | int i = grdMain.CurrentCell.ColumnIndex; |
| | | if (i != sHQtyCol) |
| | | { |
| | | e.Cancel = true; |
| | | } |
| | | } |
| | | #region å¿«éæ¥è¯¢ |
| | | |
| | | //å¿«éè¿æ»¤ |
| | | private void btnOK_Click(object sender, EventArgs e) |
| | | { |
| | | Sub_FastQuery(); |
| | | } |
| | | |
| | | private void Sub_FastQuery() |
| | | { |
| | | string sFastSQL = ""; |
| | | //ç©æ |
| | | //if (cmbHStatus.Text.Trim() == "æ£å¸¸") |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and hstopflag=0 "; |
| | | //} |
| | | //else |
| | | //{ |
| | | // sFastSQL = sFastSQL + " and hstopflag=1 "; |
| | | //} |
| | | //ç©æ |
| | | if (txtHMater.Text.Trim() != "") |
| | | { |
| | |
| | | sDlgWhere = ""; |
| | | } |
| | | |
| | | private void btnOK_Click(object sender, EventArgs e) |
| | | { |
| | | Sub_FastQuery(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 导åºåè½ |
| | | |
| | | //å¼åº |
| | | private void yc_Click(object sender, EventArgs e) |
| | | { |
| | | //BLL.ClsPub_BLL.DataGridViewToExcel2(grdMain, this.Text); |
| | |
| | | } |
| | | } |
| | | |
| | | //å¯¼åº |
| | | private void dc_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region éåºåè½ |
| | | |
| | | //éåºåè½ |
| | | private void tc_Click(object sender, EventArgs e) |
| | | { |
| | | this.Close(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region æå°åè½ |
| | | |
| | | GridppReport Report; |
| | | |
| | | //é¢è§ |
| | | 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) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | selectRow = i; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.PrintPreview(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æå° |
| | | 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) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | selectRow = i; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void Sub_SetReport(string sOpenTmp) |
| | | { |
| | | //å¤æè¡æ° |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨å¤´ä¿¡æ¯ |
| | | private void ReportBeforePostRecord() |
| | | { |
| | | //Report.FieldByName("æ¡ç ç¼å·").AsString = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[selectRow].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | |
| | | private void ReportFetchRecordByDataTable() |
| | | { |
| | | BLL.Utility.FillRecordToReport(Report, grdMain, grdPrint, Fun_GetCol("æ¡ç ç¼å·")); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |