| | |
| | | using System.Text; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace BaseSet.å
¬ç¨èµæ.å
¶ä»åºç¡èµæ |
| | | namespace BaseSet |
| | | { |
| | | public partial class Gy_StdWorkTimesList : Form |
| | | { |
| | |
| | | //å é¤é¡¹ç® |
| | | public void Delete() |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.SelectedRows.Count == 0) |
| | | { |
| | | MessageBox.Show("请è³å°éæ©ä¸è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | // |
| | | if (AllowRow()) |
| | | { |
| | | if (MessageBox.Show("ç¡®å®è¦å é¤å½å项ç®ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | //å¾å°HITEMID |
| | | long sItemID; |
| | | sItemID = DBUtility.ClsPub.isLong(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[HItemIDCol].Value); |
| | | //夿å卿§ |
| | | if (oMatePrce.ShowBill(sItemID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | oCn.BeginTran(); |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | foreach (Model.ClsGy_StdWorkTimes_Model oSub in oMatePrce.DetailColl) |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HItemID")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_StdWorkTimes_Ctl oItem = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //å®¡æ ¸ |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from Gy_StdWorkTimes Where HitemID=" + lngBillKey.ToString(), "Gy_StdWorkTimes"); |
| | | if (!string.IsNullOrEmpty(DsSub.Tables[0].Rows[0]["HChecker"].ToString())) |
| | | { |
| | | if (oSub.HChecker.Trim() != "") |
| | | { |
| | | MessageBox.Show("åæ®å·²å®¡æ ¸!ä¸è½å é¤", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (oMatePrce.DeleteByID(sItemID)) |
| | | { |
| | | |
| | | MessageBox.Show("å é¤é¡¹ç®æåï¼", "æç¤º"); |
| | | Display(); |
| | | oCn.RollBack(); |
| | | MessageBox.Show("æ åå·¥æ¶ï¼"+ DsSub.Tables[0].Rows[0]["HStdWorkTimes"].ToString() + "çåæ®å·²å®¡æ ¸ï¼æ æ³å é¤", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | MessageBox.Show("å é¤é¡¹ç®æåï¼", "æç¤º"); |
| | | { |
| | | oCn.RunProc(" delete Gy_StdWorkTimes where HItemID=" + lngBillKey.ToString()); |
| | | } |
| | | } |
| | | oCn.Commit(); |
| | | MessageBox.Show("å 餿åï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | |
| | | } |
| | |
| | | if (oBillMain.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | oFrm = new Gy_StdWorkTimes(); |
| | | oFrm.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | foreach (Model.ClsGy_StdWorkTimes_Model oSub in oBillMain.DetailColl) |
| | | { |
| | | if (oSub.HChecker.Trim() != "") |
| | | { |
| | | oFrm.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_View; |
| | | } |
| | | } |
| | | |
| | | oBill.HItemID = lngBillKey; |
| | | oFrm.BillOld = oBill; |
| | | oFrm.BillNew = oBillMain; |
| | |
| | | sr = CurNode.Text.Split(c); |
| | | HParentID = sr[0].ToString(); |
| | | } |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (frmCondition.SqlStr.Trim().Length == 0) |
| | | if (frmCondition==null) |
| | | { |
| | | //è¿æ»¤æ¡ä»¶ |
| | | if (HParentID == "" || HParentID == "ç©æèµæ" || HParentID == "å·¥åºèµæ") |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " order by HItemID Desc"; |
| | |
| | | { |
| | | if (wl.Checked == false) |
| | | { |
| | | sSql = "Select top 10000 * from " + ViewName + " where å·¥åºä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc" ; |
| | | sSql = "Select top 10000 * from " + ViewName + " where å·¥åºä»£ç like '%" + HParentID.ToString() + "%' order by HItemID Desc"; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | sSql = frmCondition.SqlStr + sWhere + " order by HItemID Desc"; |
| | | } |
| | | sSql = frmCondition.SqlStr + sWhere + " order by " + ModName; |
| | | } |
| | | |
| | | //æ§è¡SQL |
| | | DSet = SubCn.RunProcReturn(sSql, ViewName); |
| | | |
| | |
| | | oSumGrid.BuildTotalCols(sT); |
| | | // |
| | | //å»ç» |
| | | int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | string s = frmCondition.cmbHComplete.Text; |
| | | DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol); |
| | | //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text); |
| | | //string s = frmCondition.cmbHComplete.Text; |
| | | //DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol); |
| | | //ç»çº¿ |
| | | // |
| | | Total(); |
| | | //Total(); |
| | | } |
| | | |
| | | //å计 new |
| | |
| | | DAL.ClsGy_StdWorkTimes_Ctl oItem = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //å®¡æ ¸ |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oItem.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from Gy_StdWorkTimes Where HitemID=" + lngBillKey.ToString(), "Gy_StdWorkTimes"); |
| | | if (!string.IsNullOrEmpty(DsSub.Tables[0].Rows[0]["HChecker"].ToString())) |
| | | { |
| | | |
| | | MessageBox.Show("åæ®å·²å®¡æ ¸ï¼æ éå®¡æ ¸", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("项ç®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //å®¡æ ¸ |
| | | if (oItem.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸æå!第"+i.ToString()+"è¡", "æç¤º"); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | //å®¡æ ¸ |
| | | if (oItem.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) != true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸å¤±è´¥!", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("å®¡æ ¸æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("å®¡æ ¸æå!", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | //åå®¡æ ¸ |
| | |
| | | DAL.ClsGy_StdWorkTimes_Ctl oItem = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //å®¡æ ¸ |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oItem.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from Gy_StdWorkTimes Where HitemID=" + lngBillKey.ToString(), "Gy_StdWorkTimes"); |
| | | if (string.IsNullOrEmpty(DsSub.Tables[0].Rows[0]["HChecker"].ToString())) |
| | | { |
| | | |
| | | MessageBox.Show("åæ®æªå®¡æ ¸ï¼æ éåå®¡æ ¸", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("项ç®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | } |
| | | //å®¡æ ¸ |
| | | if (oItem.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | MessageBox.Show("å®¡æ ¸æå!第"+i.ToString()+"è¡", "æç¤º"); |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo, "æç¤º"); |
| | | return; |
| | | //å®¡æ ¸ |
| | | if (oItem.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) != true) |
| | | { |
| | | MessageBox.Show("åå®¡æ ¸å¤±è´¥!", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | MessageBox.Show("å®¡æ ¸æåï¼è¯·å·æ°ï¼", "æç¤º"); |
| | | MessageBox.Show("åå®¡æ ¸æå!", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | |
| | | //èè´ |
| | | private void yl_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain); |
| | | } |
| | | |
| | | private void jy_Click(object sender, EventArgs e) |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.SelectedRows.Count == 0) |
| | | { |
| | | MessageBox.Show("请è³å°éæ©ä¸è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HItemID")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_StdWorkTimes_Ctl oItem = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //å®¡æ ¸ |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from Gy_StdWorkTimes Where HitemID=" + lngBillKey.ToString(), "Gy_StdWorkTimes"); |
| | | if (DsSub.Tables[0].Rows[0]["HStopflag"].ToString() == "1") |
| | | { |
| | | MessageBox.Show("忮已ç¦ç¨,æ éç¦ç¨" , "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | oCn.RunProc(" Update Gy_StdWorkTimes set HStopflag=1 Where HItemID=" + lngBillKey.ToString()); |
| | | |
| | | } |
| | | } |
| | | MessageBox.Show("ç¦ç¨æåï¼", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | |
| | | private void fjy_Click(object sender, EventArgs e) |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | if (grdMain.SelectedRows.Count == 0) |
| | | { |
| | | MessageBox.Show("请è³å°éæ©ä¸è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++) |
| | | { |
| | | lngBillKey = DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HItemID")].Value); |
| | | if (lngBillKey == 0) |
| | | return; |
| | | DAL.ClsGy_StdWorkTimes_Ctl oItem = new DAL.ClsGy_StdWorkTimes_Ctl(); |
| | | //å®¡æ ¸ |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | DataSet DsSub = oCn.RunProcReturn("Select * from Gy_StdWorkTimes Where HitemID=" + lngBillKey.ToString(), "Gy_StdWorkTimes"); |
| | | if (DsSub.Tables[0].Rows[0]["HStopflag"].ToString() == "0") |
| | | { |
| | | MessageBox.Show("åæ®ææªç¦ç¨ï¼æ éåç¦ç¨", "æç¤º"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | oCn.RunProc(" Update Gy_StdWorkTimes set HStopflag=0 Where HItemID=" + lngBillKey.ToString()); |
| | | |
| | | } |
| | | } |
| | | MessageBox.Show("åç¦ç¨æåï¼", "æç¤º"); |
| | | Display(); |
| | | return; |
| | | } |
| | | |
| | | //å¯¼åº |
| | | private void dc_Click(object sender, EventArgs e) |
| | | { |
| | | DBUtility.Gy_BaseFun.DataToExcel(this.Text, grdMain); |
| | | } |
| | | } |
| | | } |