| | |
| | | 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 ModRightNameEdit = ModRightName + "_Edit"; //å é¤ |
| | | public const string ModRightNameDelete = ModRightName + "_Delete"; //ä½åº |
| | | public const string ModRightNamePrint = ModRightName + "_Print"; //æå° |
| | | //DAL.ClsGy_ICBomBill oBill = new DAL.ClsGy_ICBomBill(); |
| | | //public Gy_ICBomBill oFrm; |
| | | |
| | | DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | public int selectRow = 0; |
| | | public int selectRow2 = 0; |
| | | public long PrintQty = 0; //å
许æ¡ç æå°æ¬¡æ° |
| | | public string PrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ§å¶ |
| | | public string UpdatePrintQtyCtl = ""; //æ¡ç æå°æ¬¡æ°æ´æ° |
| | | // |
| | | private void initGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain,this.Name); |
| | | } |
| | | // |
| | | public string SourceQtyCtl = ""; //è¶
æºåæ°éæ§å¶ |
| | | |
| | | private void Display() |
| | | { |
| | | ClsCN SubCn = new ClsCN(); |
| | | DataSet DSet; |
| | | string sSql = ""; |
| | | string sWhere = ""; |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (frmCondition.SqlStr.Trim().Length == 0) |
| | | return; |
| | | sSql = frmCondition.SqlStr + sWhere + " order by æ¡ç ç¼å· "; |
| | | // |
| | | DSet = SubCn.RunProcReturn(sSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,请å¨è¿æ»¤æ¡ä¸ç¹å»ãæ¢å¤ãæé®,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | |
| | | |
| | | // |
| | | } |
| | | #region åºå®ä»£ç |
| | | |
| | | // |
| | | private void timer1_Tick(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled=false; |
| | | initGrid(); |
| | | Display(); |
| | | } |
| | | |
| | | 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 Gy_BarCodeBillList_Load(object sender, EventArgs e) |
| | | { |
| | | // |
| | | frmCondition = new frmBillQueryCondition_New(); |
| | | this.Text = ModCaption; |
| | | lblCaption.Text = ModCaption; |
| | | initGrid(); |
| | | Sub_GetSystemParameter(); |
| | | } |
| | | |
| | | private void initGrid() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name); |
| | | } |
| | | |
| | | //è·åç³»ç»åæ°ä¿¡æ¯ |
| | |
| | | PrintQty = oSystemParameter.omodel.BarCode_PrintQty; |
| | | PrintQtyCtl = oSystemParameter.omodel.BarCode_PrintQtyCtl; |
| | | UpdatePrintQtyCtl = oSystemParameter.omodel.BarCode_UpdatePrintQtyCtl; |
| | | SourceQtyCtl = oSystemParameter.omodel.BarCode_SourceQtyCtl; |
| | | } |
| | | } |
| | | |
| | | private void grdMain_DblClick(object sender, EventArgs e) |
| | | private void timer1_Tick(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(); |
| | | } |
| | | } |
| | | |
| | | 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_BarCodeBill_View oBill = new DAL.ClsGy_BarCodeBill_View(); |
| | | //DAL.ClsGy_BarCodeBill_Ctl oBillC = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | //if (oBill.GetInfoByID(lngBillKey)) |
| | | //{ |
| | | // if (MessageBox.Show("ç¡®å®è¦å é¤å½ååæ®ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.OK) |
| | | // { |
| | | // if (!oBillC.DeleteByID(lngBillKey)) |
| | | // { |
| | | // MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | // return; |
| | | // } |
| | | // else |
| | | // { |
| | | // Display(); |
| | | // } |
| | | |
| | | // } |
| | | //} |
| | | //else |
| | | //{ |
| | | // MessageBox.Show("åæ®æªæ¾å°", "æç¤º"); |
| | | //} |
| | | |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.CurrentRow == null) |
| | | return; |
| | | if (MessageBox.Show("ç¡®å®è¦å 餿éåæ®ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_BarCodeBill_View oBill = new DAL.ClsGy_BarCodeBill_View(); |
| | | DAL.ClsGy_BarCodeBill_Ctl oBillC = new DAL.ClsGy_BarCodeBill_Ctl(); |
| | | if (oBill.GetInfoByID(lngBillKey)) |
| | | { |
| | | try |
| | | { |
| | | oBillC.DeleteByID(lngBillKey); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show("å é¤å¤±è´¥ï¼æ¡ç " + grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value + "已被使ç¨", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | if (oBillC.DeleteByID(lngBillKey) != true) |
| | | { |
| | | MessageBox.Show("å é¤å¤±è´¥,åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("åæ®æªæ¾å°ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("å 餿åï¼", "æç¤º"); |
| | | timer1.Enabled = false; |
| | | initGrid(); |
| | | Display(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void bclk_Click(object sender, EventArgs e) |
| | | public void SetCondition(frmBillQueryCondition_New frmCondition, string ViewName, string Name) |
| | | { |
| | | //ä¿åå宽 |
| | | DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name); |
| | | frmCondition.Tag = ""; |
| | | frmCondition.ViewName = ViewName; |
| | | frmCondition.ModName = Name; |
| | | } |
| | | |
| | | private void mrlk_Click(object sender, EventArgs e) |
| | | private void grdMain_Paint(object sender, PaintEventArgs 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(); |
| | | } |
| | | |
| | | //å®¡æ ¸åæ® |
| | | 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(); |
| | | GraphicsGrid(); |
| | | } |
| | | |
| | | private void GraphicsGrid() |
| | |
| | | DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain); |
| | | } |
| | | |
| | | #region //æå°è®¾ç½® |
| | | private Int32 Fun_GetCol(string sCol) |
| | | { |
| | | return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain); |
| | | } |
| | | |
| | | //ä¿åå宽 |
| | | 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(); |
| | | } |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | | ClsCN SubCn = new ClsCN(); |
| | | DataSet DSet; |
| | | string sSql = ""; |
| | | string sWhere = ""; |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (frmCondition.SqlStr.Trim().Length == 0) |
| | | return; |
| | | sSql = frmCondition.SqlStr + sWhere + " order by HItemID desc "; |
| | | // |
| | | DSet = SubCn.RunProcReturn(sSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |
| | | { |
| | | MessageBox.Show("没æè¿åä»»ä½ç»æ,请å¨è¿æ»¤æ¡ä¸ç¹å»ãæ¢å¤ãæé®,å°è¯å次æ¥è¯¢ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | return; |
| | | } |
| | | // |
| | | grdMain.DataSource = DSet.Tables[0].DefaultView; |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | | GraphLine(); |
| | | } |
| | | |
| | | 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() + " æ¡è®°å½"; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region å·æ°åè½ |
| | | |
| | | private void sx_Click(object sender, EventArgs e) |
| | | { |
| | | timer1.Enabled = true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region å é¤åè½ |
| | | |
| | | //åæ¡å é¤ |
| | | 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; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦å é¤çæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | if (grdMain.SelectedRows.Count != 1) |
| | | { |
| | | MessageBox.Show("ä¸å
许å¤è¡å é¤ï¼è¯·éæ°éæ©è¦å é¤çæ¡ç ï¼"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦å 餿鿡ç ï¼å é¤åä¸è½æ¢å¤ï¼è¯·è°¨æ
æä½ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | Int64 HItemID = 0; |
| | | string HBarCode = ""; |
| | | HItemID = DBUtility.ClsPub.isLong(grdMain.SelectedRows[0].Cells[Fun_GetCol("hmainid")].Value); |
| | | HBarCode = DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[0].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | |
| | | if (!oBar.DeleteBill(HItemID, HBarCode, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å 餿åï¼", "æç¤º"); |
| | | Display(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | private void ps_Click(object sender, EventArgs e) |
| | | { |
| | | Sub_MulDeleteBill(); |
| | | } |
| | | |
| | | private void Sub_MulDeleteBill() |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦å é¤çæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | if (grdMain.SelectedRows.Count > 300) |
| | | { |
| | | MessageBox.Show("æ¹éå 餿¡ç éä¸è¡æ°ä¸è½è¶
è¿300è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦æ¹éå 餿鿡ç ï¼å é¤åä¸è½æ¢å¤ï¼è¯·è°¨æ
æä½ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | string HItemID = ""; |
| | | string HBarCode = ""; |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()); |
| | | if (i != 0 && i % 100 == 0) |
| | | { |
| | | HBarCode = HBarCode + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | else |
| | | { |
| | | HBarCode = HBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | } |
| | | |
| | | HItemID = HItemID.Remove(0, 1); //廿å符串第ä¸ä¸ªå符 |
| | | HBarCode = HBarCode.Remove(0, 1); |
| | | if (!oBar.MulDeleteBill(HItemID, HBarCode, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("æ¹éå 餿åï¼", "æç¤º"); |
| | | Display(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ä½åºåè½ |
| | | |
| | | private void zf_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦ä½åºçæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦ä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | string HItemID = ""; |
| | | string HBarCode = ""; |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()); |
| | | if (i != 0 && i % 100 == 0) |
| | | { |
| | | HBarCode = HBarCode + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | else |
| | | { |
| | | HBarCode = HBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | } |
| | | |
| | | HItemID = HItemID.Remove(0, 1); //廿å符串第ä¸ä¸ªå符 |
| | | HBarCode = HBarCode.Remove(0, 1); |
| | | if (!oBar.Cancelltion(HItemID, HBarCode, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | MessageBox.Show("ä½åºå¤±è´¥ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("ä½åºæåï¼", "æç¤º"); |
| | | Display(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region åä½åºåè½ |
| | | |
| | | private void fzf_Click(object sender, EventArgs e) |
| | | { |
| | | //夿æé |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | if (grdMain.CurrentRow == null) |
| | | { |
| | | MessageBox.Show("请å
éæ©éè¦åä½åºçæ¡ç ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | if (grdMain.SelectedRows.Count>300) |
| | | { |
| | | MessageBox.Show("åæ¶åä½åºæ¡ç éä¸è¡æ°ä¸è½è¶
è¿300è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦åä½åºæéæ¡ç ï¼", "æç¤º", MessageBoxButtons.OKCancel) == DialogResult.Cancel) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | string HItemID = ""; |
| | | string HBarCode = ""; |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | HItemID = HItemID + "," + DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("hmainid")].Value.ToString()); |
| | | if (i != 0 && i % 100 == 0) |
| | | { |
| | | HBarCode = HBarCode + "#" + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | else |
| | | { |
| | | HBarCode = HBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value); |
| | | } |
| | | } |
| | | |
| | | HItemID = HItemID.Remove(0, 1); //廿å符串第ä¸ä¸ªå符 |
| | | HBarCode = HBarCode.Remove(0, 1); |
| | | if (!oBar.UnCancelltion(HItemID, HBarCode, SourceQtyCtl, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("åä½åºæåï¼", "æç¤º"); |
| | | Display(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region æå°è®¾ç½® |
| | | |
| | | GridppReport Report; |
| | | int CurRows = 0; |
| | |
| | | } |
| | | sBarCodeItemID = sBarCodeItemID.Remove(0, 1); |
| | | |
| | | if (PrintQtyCtl=="Y") |
| | | if (PrintQtyCtl == "Y") |
| | | { |
| | | if (oBar.Set_CheckPrintQty(sBarCodeItemID, PrintQty, ref sHRemark)) |
| | | { |
| | |
| | | //Report.FieldByName("ç©æä»£ç ").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç©æä»£ç ")].Value.ToString(); |
| | | //Report.FieldByName("ç©æåç§°").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç©æåç§°")].Value.ToString(); |
| | | //Report.FieldByName("è§æ ¼åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("è§æ ¼åå·")].Value.ToString(); |
| | | ////Report.FieldByName("èªå®ä¹è§æ ¼").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("èªå®ä¹è§æ ¼")].Value.ToString(); |
| | | //Report.FieldByName("æ¡ç ç¼å·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value.ToString(); |
| | | //Report.FieldByName("æ°é").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ°é")].Value.ToString(); |
| | | //Report.FieldByName("æ¹æ¬¡").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ¹å·")].Value.ToString(); |
| | | //Report.FieldByName("æºååå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æºååå·")].Value.ToString(); |
| | | //Report.FieldByName("éå®è®¢åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("éå®è®¢åå·")].Value.ToString(); |
| | | //Report.FieldByName("éè´è®¢åå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("éè´è®¢åå·")].Value.ToString(); |
| | | //Report.FieldByName("ä¾åºå").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("徿¥åä½")].Value.ToString(); |
| | | //Report.FieldByName("ç产车é´").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("ç产车é´")].Value.ToString(); |
| | | //Report.FieldByName("夿³¨").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("夿³¨")].Value.ToString(); |
| | | //Report.FieldByName("æ»ææ°").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æ»ææ°")].Value.ToString(); |
| | | //Report.FieldByName("æå·").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("æå·")].Value.ToString(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æå°å¤±è´¥!表头ï¼" + e.Message); |
| | | } |
| | | //CurRows = CurRows + 1; |
| | | } |
| | | |
| | | //å¡«å
¥åæ®è¡¨ä½ä¿¡æ¯ |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //è¿æ |
| | | private void dy2_Click(object sender, EventArgs e) |
| | | #region å¼åºåè½ |
| | | |
| | | private void eXCELToolStripMenuItem_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; |
| | | selectRow2 = i + 1; |
| | | Sub_SetReport(oFrm.sOpenTmp); |
| | | Report.Print(false); |
| | | oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | // |
| | | if (selectRow2 > grdMain.SelectedRows.Count - 1) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i + 1].Cells[Fun_GetCol("æ¡ç ç¼å·")].Value)); |
| | | } |
| | | Thread.Sleep(1000); |
| | | i++; |
| | | } |
| | | } |
| | | DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain); |
| | | } |
| | | |
| | | private void cSVToolStripMenuItem_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Gy_BaseFun.DataGridViewToExcel2(grdMain, this.Text, this.Text); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | // |
| | | private void grdMain_Paint(object sender, PaintEventArgs e) |
| | | #region éåºåè½ |
| | | |
| | | private void tc_Click(object sender, EventArgs e) |
| | | { |
| | | GraphicsGrid(); |
| | | this.Close(); |
| | | } |
| | | |
| | | private void yc_Click(object sender, EventArgs e) |
| | | { |
| | | DataGridViewToExcel2(grdMain, this.Text, this.Text); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç½æ ¼ 导åºEXCEL ç½æ ¼ï¼æä»¶åï¼æ é¢å |
| | | /// </summary> |
| | | public static void DataGridViewToExcel2(DataGridView grdMain, string sText, string sBTText) |
| | | { |
| | | SaveFileDialog saveFileDialog = new SaveFileDialog(); |
| | | saveFileDialog.Filter = "Execlæä»¶(*.xls)|*.xls"; |
| | | saveFileDialog.FilterIndex = 0; |
| | | saveFileDialog.RestoreDirectory = true; |
| | | saveFileDialog.CreatePrompt = true; |
| | | saveFileDialog.Title = "æ°æ®è§å¾å¯¼åºEXCELæä»¶"; |
| | | saveFileDialog.FileName = sText; |
| | | //saveFileDialog.ShowDialog(); |
| | | if (saveFileDialog.ShowDialog() == DialogResult.OK) |
| | | { |
| | | Stream myStream; |
| | | myStream = saveFileDialog.OpenFile(); |
| | | StreamWriter sw = new StreamWriter(myStream, System.Text.Encoding.GetEncoding("gb2312")); |
| | | string str = ""; |
| | | DateTime start = DateTime.Now; |
| | | try |
| | | { |
| | | if (sBTText != "") |
| | | { |
| | | sw.WriteLine(sBTText); |
| | | } |
| | | //åæ é¢ |
| | | bool sFirstCol = true; |
| | | for (int i = 0; i < grdMain.ColumnCount; i++) |
| | | { |
| | | if (i > 0 && grdMain.Columns[i].HeaderText.Substring(0, 1) != "h" && grdMain.Columns[i].HeaderText.Substring(0, 1) != "H" && sFirstCol != true) |
| | | { |
| | | str += "\t"; |
| | | } |
| | | if (grdMain.Columns[i].HeaderText.Substring(0, 1) != "h" && grdMain.Columns[i].HeaderText.Substring(0, 1) != "H") |
| | | { |
| | | sFirstCol = false; |
| | | str += grdMain.Columns[i].HeaderText; |
| | | } |
| | | } |
| | | str = str.Replace("\n", ""); |
| | | sw.WriteLine(str); |
| | | |
| | | //åå
容 |
| | | for (int j = 0; j < grdMain.Rows.Count; j++) |
| | | { |
| | | string tempStr = ""; |
| | | sFirstCol = true; |
| | | for (int k = 0; k < grdMain.Columns.Count; k++) |
| | | { |
| | | if (k > 0 && grdMain.Columns[k].HeaderText.Substring(0, 1) != "h" && grdMain.Columns[k].HeaderText.Substring(0, 1) != "H" && sFirstCol != true) |
| | | { |
| | | tempStr += "\t"; |
| | | } |
| | | if (grdMain.Columns[k].HeaderText.Substring(0, 1) != "h" && grdMain.Columns[k].HeaderText.Substring(0, 1) != "H") |
| | | { |
| | | sFirstCol = false; |
| | | if (grdMain.Rows[j].Cells[k].Value == null) |
| | | { |
| | | tempStr += string.Empty; |
| | | } |
| | | else |
| | | { |
| | | tempStr += grdMain.Rows[j].Cells[k].Value.ToString(); |
| | | } |
| | | } |
| | | } |
| | | tempStr = tempStr.Replace("\n", ""); |
| | | sw.WriteLine(tempStr); |
| | | } |
| | | sw.Close(); |
| | | myStream.Close(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | sw.Close(); |
| | | myStream.Close(); |
| | | } |
| | | MessageBox.Show("å°æ¤å·¥ä½è¡¨å¯¼åºä¸ºexcelå
±èæ¶ï¼" + DateTime.Now.Subtract(start).TotalMilliseconds.ToString() + "毫ç§"); |
| | | } |
| | | } |
| | | |
| | | private void zf_Click(object sender, EventArgs e) |
| | | { |
| | | //Sub_AbandonCheck(); |
| | | if (!DBUtility.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("ä½åºæåï¼", "æç¤º"); |
| | | } |
| | | |
| | | private void fzf_Click(object sender, EventArgs e) |
| | | { |
| | | //this.Sub_CheckBill(); |
| | | if (!DBUtility.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("åä½åºæåï¼", "æç¤º"); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |