| | |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Gy_RoutingBillMain set " + |
| | | ",HPRDORGID=" + omodel.HPRDORGID.ToString() + |
| | | " HName='" + omodel.HName + "'" + |
| | | " HPRDORGID=" + omodel.HPRDORGID.ToString() + |
| | | ",HName='" + omodel.HName + "'" + |
| | | ",HBillNo='" + omodel.HBillNo + "'" + |
| | | ",HMaterTypeID=" + omodel.HMaterTypeID.ToString() + |
| | | ",HMaterID=" + omodel.HMaterID.ToString() + |
| | |
| | | { |
| | | try |
| | | { |
| | | string orgid = DBUtility.ClsPub.HOrgID.ToString(); |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | |
| | | ",HRoutingGroupID,HUnitID,HMaterNumber,HUnitNumber,HStandard" + |
| | | ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" + |
| | | ",HMainPrice,HStdSourceQty,HAddSourceRate,HDelSourceRate" + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HPRDORGID,HVerNum,HOrgID" + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HPRDORGID,HVerNum" + |
| | | ") " + |
| | | " values('" + this.BillType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()," + omodel.HMaterID.ToString() + ",'" + omodel.HName + "'," + omodel.HMaterTypeID.ToString() + |
| | | ",'" + omodel.HRoutingGroupID.ToString() + "'," + omodel.HUnitID.ToString() + ",'" + omodel.HMaterNumber + "','" + omodel.HUnitNumber + "'," + DBUtility.ClsPub.BoolToString(omodel.HStandard) + |
| | | "," + omodel.HMainGroupID.ToString() + "," + omodel.HMainProcID.ToString() + "," + omodel.HMainCenterID.ToString() + ",'" + omodel.HMainTimeUnit + "'," + omodel.HMainUnitTime.ToString() + "," + omodel.HMainWorkQty.ToString() + |
| | | "," + omodel.HMainPrice.ToString() + "," + omodel.HStdSourceQty.ToString() + "," + omodel.HAddSourceRate + "," + omodel.HDelSourceRate.ToString() + |
| | | ",'" + omodel.HPicNumVer.ToString() + "','" + omodel.HPicNumAssemble.ToString() + "','" + omodel.HMaterTexture.ToString() + "','" + omodel.HProductNum.ToString() + "','" + omodel.HPRDORGID.ToString() + "','" + omodel.HVerNum.ToString() + "'," + DBUtility.ClsPub.HOrgID + |
| | | ",'" + omodel.HPicNumVer.ToString() + "','" + omodel.HPicNumAssemble.ToString() + "','" + omodel.HMaterTexture.ToString() + "','" + omodel.HProductNum.ToString() + "','" + DBUtility.ClsPub.HOrgID + "','" + omodel.HVerNum.ToString() + "'" + |
| | | ") "); |
| | | //æå
¥å表 |
| | | foreach (Model.ClsGy_RoutingBillSub oSub in DetailColl) |
| | |
| | | omodel.HMaterTexture = Ds.Tables[0].Rows[0]["HMaterTexture"].ToString().Trim(); |
| | | omodel.HProductNum = Ds.Tables[0].Rows[0]["HProductNum"].ToString().Trim(); |
| | | omodel.HVerNum = Ds.Tables[0].Rows[0]["HVerNum"].ToString().Trim(); |
| | | |
| | | omodel.HPRDORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"].ToString()); |
| | | //å¾ªç¯ |
| | | DataSet DsSub ; |
| | | DsSub = oCn.RunProcReturn("Select * from Gy_RoutingBillSub Where HInterID=" + lngBillKey.ToString() + " Order by HEntryID ", "Gy_RoutingBillSub"); |
| | |
| | | } |
| | | } |
| | | |
| | | //æ¹æ¬¡æé® |
| | | private void BatchNo_Click(object sender, EventArgs e) |
| | | { |
| | | bool b = false; |
| | | for (int i = 0; i < grdMain.RowCount; i++) |
| | | { |
| | | long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value); // ç©æå
ç |
| | | string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HBatchNoCol].Value); // æ¹å· |
| | | |
| | | if (HMaterID != 0) |
| | | { |
| | | DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + dtpHDate.Value.ToShortDateString()+ "','" + CampanyName+"'", "h_p_Gy_BarCodeBill_GetBatchNo"); |
| | | // |
| | | if (oDs == null && oDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("çææ¹æ¬¡å¤±è´¥ï¼"); |
| | | return; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | grdMain.Rows[i].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]); |
| | | b = true; |
| | | } |
| | | } |
| | | } |
| | | //æç»è¡¨æ¯å¦ä¸ºé¶è¡ |
| | | if (b == false) |
| | | { |
| | | MessageBox.Show("没æéè¦çææ¹æ¬¡çæç»è¡ï¼", "æç¤º"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | private void InitializeComponent() |
| | | { |
| | | this.components = new System.ComponentModel.Container(); |
| | | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Gy_BarCodeBill)); |
| | | this.Tool = new System.Windows.Forms.ToolStrip(); |
| | | this.dy = new System.Windows.Forms.ToolStripButton(); |
| | |
| | | this.bclk = new System.Windows.Forms.ToolStripButton(); |
| | | this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); |
| | | this.tb = new System.Windows.Forms.ToolStripButton(); |
| | | this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); |
| | | this.gl = new System.Windows.Forms.ToolStripButton(); |
| | | this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); |
| | | this.tc = new System.Windows.Forms.ToolStripButton(); |
| | | this.lblCaption = new System.Windows.Forms.Label(); |
| | |
| | | this.label11 = new System.Windows.Forms.Label(); |
| | | this.txtHMaker = new System.Windows.Forms.Label(); |
| | | this.label8 = new System.Windows.Forms.Label(); |
| | | this.timer1 = new System.Windows.Forms.Timer(this.components); |
| | | this.timer1 = new System.Windows.Forms.Timer(); |
| | | this.panel1 = new System.Windows.Forms.Panel(); |
| | | this.panel3 = new System.Windows.Forms.Panel(); |
| | | this.grdMain = new System.Windows.Forms.DataGridView(); |
| | |
| | | this.tabPage1 = new System.Windows.Forms.TabPage(); |
| | | this.tabPage2 = new System.Windows.Forms.TabPage(); |
| | | this.grdSub = new System.Windows.Forms.DataGridView(); |
| | | this.gl = new System.Windows.Forms.ToolStripButton(); |
| | | this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); |
| | | this.tabPage3 = new System.Windows.Forms.TabPage(); |
| | | this.grdList = new System.Windows.Forms.DataGridView(); |
| | | this.BatchNo = new System.Windows.Forms.ToolStripButton(); |
| | | this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); |
| | | this.Tool.SuspendLayout(); |
| | | this.P1.SuspendLayout(); |
| | | ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit(); |
| | |
| | | this.tb, |
| | | this.toolStripSeparator6, |
| | | this.gl, |
| | | this.toolStripSeparator7, |
| | | this.BatchNo, |
| | | this.toolStripSeparator3, |
| | | this.tc}); |
| | | this.Tool.Location = new System.Drawing.Point(0, 0); |
| | |
| | | this.tb.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; |
| | | this.tb.ToolTipText = "忥åºç¡èµæ"; |
| | | this.tb.Click += new System.EventHandler(this.tb_Click); |
| | | // |
| | | // toolStripSeparator6 |
| | | // |
| | | this.toolStripSeparator6.Name = "toolStripSeparator6"; |
| | | this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50); |
| | | // |
| | | // gl |
| | | // |
| | | this.gl.AutoSize = false; |
| | | this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image"))); |
| | | this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; |
| | | this.gl.ImageTransparentColor = System.Drawing.Color.White; |
| | | this.gl.Name = "gl"; |
| | | this.gl.Size = new System.Drawing.Size(35, 47); |
| | | this.gl.Text = "å
³è"; |
| | | this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; |
| | | this.gl.Click += new System.EventHandler(this.gl_Click); |
| | | // |
| | | // toolStripSeparator3 |
| | | // |
| | |
| | | this.grdSub.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellContentClick); |
| | | this.grdSub.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellEndEdit); |
| | | // |
| | | // gl |
| | | // |
| | | this.gl.AutoSize = false; |
| | | this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image"))); |
| | | this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; |
| | | this.gl.ImageTransparentColor = System.Drawing.Color.White; |
| | | this.gl.Name = "gl"; |
| | | this.gl.Size = new System.Drawing.Size(35, 47); |
| | | this.gl.Text = "å
³è"; |
| | | this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; |
| | | this.gl.Click += new System.EventHandler(this.gl_Click); |
| | | // |
| | | // toolStripSeparator6 |
| | | // |
| | | this.toolStripSeparator6.Name = "toolStripSeparator6"; |
| | | this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50); |
| | | // |
| | | // tabPage3 |
| | | // |
| | | this.tabPage3.Controls.Add(this.grdList); |
| | |
| | | this.grdList.RowTemplate.Height = 23; |
| | | this.grdList.Size = new System.Drawing.Size(929, 288); |
| | | this.grdList.TabIndex = 46; |
| | | // |
| | | // BatchNo |
| | | // |
| | | this.BatchNo.AutoSize = false; |
| | | this.BatchNo.Image = ((System.Drawing.Image)(resources.GetObject("BatchNo.Image"))); |
| | | this.BatchNo.ImageAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.BatchNo.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; |
| | | this.BatchNo.ImageTransparentColor = System.Drawing.Color.White; |
| | | this.BatchNo.Name = "BatchNo"; |
| | | this.BatchNo.Size = new System.Drawing.Size(35, 47); |
| | | this.BatchNo.Text = "æ¹æ¬¡"; |
| | | this.BatchNo.TextAlign = System.Drawing.ContentAlignment.BottomCenter; |
| | | this.BatchNo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText; |
| | | this.BatchNo.Click += new System.EventHandler(this.BatchNo_Click); |
| | | // |
| | | // toolStripSeparator7 |
| | | // |
| | | this.toolStripSeparator7.Name = "toolStripSeparator7"; |
| | | this.toolStripSeparator7.Size = new System.Drawing.Size(6, 50); |
| | | // |
| | | // Gy_BarCodeBill |
| | | // |
| | |
| | | private System.Windows.Forms.ToolStripButton gl; |
| | | private System.Windows.Forms.TabPage tabPage3; |
| | | private System.Windows.Forms.DataGridView grdList; |
| | | private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; |
| | | private System.Windows.Forms.ToolStripButton BatchNo; |
| | | } |
| | | } |
| | |
| | | TkSuQmCC |
| | | </value> |
| | | </data> |
| | | <data name="BatchNo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value> |
| | | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 |
| | | YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD3SURBVDhPnZC9FYIwFEaZiQFkAB1ADzULZACGoJLKSio7 |
| | | BqCzorNiABgABnjme+GFBPlR3znfSUJy7yMJdorG0S2KY1r6/lE0PBMcdA8z3NZEd9VtSmiolU7iSjwY |
| | | CcNyUUL0UhzMIcK4An8IPFjGr2F0s3CTmrFOLbgN67vK79LQsOCqQhaIxIE9AfXVxT4Wwzp1NsGYQ4b9 |
| | | tjhSe4smiVKma19NL+4KBEQA85hH1OQH+T6T6MgagaArThys0V3g8ZwpgbryzBuIXAfB3iosZSUP3VEH |
| | | cx82d1+EpURiHmu8817neYkEHQH+BEtZSfYHLCWSdTgI3vBtcjUXOHiVAAAAAElFTkSuQmCC |
| | | </value> |
| | | </data> |
| | | <data name="tc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
| | | <value> |
| | | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 |
New file |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.BaseSet |
| | | { |
| | | public class Gy_OrderBackInfoController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region 订ååé¦ç¶æåè¡¨æ°æ® |
| | | /// <summary> |
| | | /// è¿å订ååé¦ç¶æå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_OrderBackInfoList " + sWhere, "h_v_Gy_OrderBackInfoList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_OrderBackInfoList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_OrderBackInfoList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订ååé¦ç¶ææ ¹æ®æ åIDæ¥è¯¢ææå±çº§åè¡¨æ°æ® |
| | | /// <summary> |
| | | /// æ ¹æ®æ åID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList"); |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_OrderBackInfoList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_OrderBackInfoList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_OrderBackInfoList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å é¤è®¢ååé¦ç¶æ |
| | | /// <summary> |
| | | /// 订ååé¦ç¶æå表å é¤æé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/Delete_Json")] |
| | | [HttpGet] |
| | | public object Delete_Json(long HItemID, string User, string ModRightNameDelete) |
| | | { |
| | | |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("delete from Gy_OrderBackInfo where HItemID = " + HItemID, "Gy_OrderBackInfo"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订ååé¦ç¶ææ°å¢ä¿å |
| | | /// <summary> |
| | | /// 订ååé¦ç¶æ-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | //ååºåå |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | |
| | | List<Gy_OrderBackInfo> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderBackInfo>>(msg1); |
| | | |
| | | long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HUseFlag = list[0].HUseFlag; |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_OrderBackInfo " + |
| | | "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag) " + |
| | | " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" + |
| | | ",'1',0,'" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','æªä½¿ç¨')"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | if (list[0].HItemID.ToString() != "") |
| | | { |
| | | oCN.RunProc("Update Gy_OrderBackInfo set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订ååé¦ç¶æä¿®æ¹ä¿å |
| | | /// <summary> |
| | | /// ä¿®æ¹åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_OrderBackInfo> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderBackInfo>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HUseFlag = list[0].HUseFlag; |
| | | |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(msg5, 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_OrderBackInfo set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HParentID=" + HParentID + |
| | | ",HStopflag='" + Convert.ToString(HStopflag ? 1 : 0) + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_OrderBackInfo set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹åæ®æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订ååé¦ç¶æä¿®æ¹è·åç»å®æ°æ® |
| | | /// <summary> |
| | | /// ç»´ä¿®åè¡¨ä¿®æ¹æé®æ¹æ³ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderBackInfo/xg")] |
| | | [HttpGet] |
| | | public object xg(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_OrderBackInfo where HItemID=" + HInterID, "Gy_OrderBackInfo"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订ååé¦ç¶æè·åæ ååè¡¨æ°æ® |
| | | [Route("Gy_OrderBackInfo/LoadTree")] |
| | | [HttpGet] |
| | | public object LoadTree_Json(string sWhere) |
| | | { |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_OrderBackInfoLoadTree", "h_v_Gy_OrderBackInfoLoadTree"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.BaseSet |
| | | { |
| | | public class Gy_OrderLevController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region 订åç级åè¡¨æ°æ® |
| | | /// <summary> |
| | | /// è¿å订åç级å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_OrderLevList " + sWhere, "h_v_Gy_OrderLevList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_OrderLevList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_OrderLevList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订åççº§æ ¹æ®æ åIDæ¥è¯¢ææå±çº§åè¡¨æ°æ® |
| | | /// <summary> |
| | | /// æ ¹æ®æ åID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList"); |
| | | ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_OrderLevList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_OrderLevList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_OrderLevList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å é¤è®¢åç级 |
| | | /// <summary> |
| | | /// 订åç级å表å é¤æé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/Delete_Json")] |
| | | [HttpGet] |
| | | public object Delete_Json(long HItemID, string User, string ModRightNameDelete) |
| | | { |
| | | DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl(); |
| | | DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå 餿é"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oDeptHlp.GetInfoByID(HItemID)) |
| | | { |
| | | if (oDept.HavChildCodes(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®,ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å é¤å夿æ¯å¦ å·²ä½¿ç¨ 20141020 |
| | | if (oDeptHlp.omodel.HUseFlag != "æªä½¿ç¨") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨æè
æªæ£æµï¼ä¸è½å é¤ï¼è¯·éæ°æ£æµåå é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | // |
| | | if (oDept.DeleteByID(HItemID)) |
| | | { |
| | | //åå
¥æ¥å¿ |
| | | ClsPub.Add_Log("", "å é¤é¡¹ç®ï¼ä»£ç ï¼" + oDeptHlp.omodel.HNumber + ",åç§°ï¼" + oDeptHlp.omodel.HName, ClsPub.CurUserName); |
| | | //æ´æ°ä¸çº§ä¸º æ«çº§ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订åç级æ°å¢ä¿å |
| | | /// <summary> |
| | | /// 订åç级-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | //ååºåå |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | |
| | | DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl(); |
| | | DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View(); |
| | | |
| | | |
| | | |
| | | List<Gy_OrderLevList> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderLevList>>(msg1); |
| | | |
| | | long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HRemark = list[0].HRemark; |
| | | string HYX = list[0].HYX; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HUseFlag = list[0].HUseFlag; |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert Into Gy_OrderLev " + |
| | | "(HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HYX) " + |
| | | " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" + |
| | | ",'1',0,'" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','æªä½¿ç¨','" + HYX + "')"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | if (list[0].HItemID.ToString() != "") |
| | | { |
| | | oCN.RunProc("Update Gy_OrderLev set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订åç级修æ¹ä¿å |
| | | /// <summary> |
| | | /// ä¿®æ¹åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/EditBill")] |
| | | [HttpPost] |
| | | public object EditBill([FromBody] JObject oMain) |
| | | { |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl(); |
| | | DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_OrderLevList> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderLevList>>(msg2); |
| | | |
| | | long HItemID = int.Parse(msg3); |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HYX = list[0].HYX; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HUseFlag = list[0].HUseFlag; |
| | | |
| | | |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(msg5, 1, true, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç éå¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_OrderLev set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HYX='" + HYX + "'" + |
| | | ",HParentID=" + HParentID + |
| | | ",HStopflag='" + Convert.ToString(HStopflag ? 1 : 0) + "'" + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_OrderLev set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿®æ¹åæ®æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订åç级修æ¹è·åç»å®æ°æ® |
| | | /// <summary> |
| | | /// ç»´ä¿®åè¡¨ä¿®æ¹æé®æ¹æ³ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_OrderLev/xg")] |
| | | [HttpGet] |
| | | public object xg(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from Gy_OrderLev where HItemID=" + HInterID, "Gy_OrderLev"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 订åç级è·åæ ååè¡¨æ°æ® |
| | | [Route("Gy_OrderLev/LoadTree")] |
| | | [HttpGet] |
| | | public object LoadTree_Json(string sWhere) |
| | | { |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList"); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_OrderLevLoadTree", "h_v_Gy_OrderLevLoadTree"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | string sql = sql1 + sWhere + "order by HItemID desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_WareHouseList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | //if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "falseï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
New file |
| | |
| | | using Model; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_WorkPayTypeController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥ä½ä¸å¿å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkPayType/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkPayTypeList " + sWhere, "h_v_Gy_WorkPayTypeList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_WorkPayTypeList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkPayTypeList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkPayType/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkPayTypeList where HitemID=" + HInterID, "h_v_Gy_WorkPayTypeList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// æ°å¢åæ®-ä¿åæé® |
| | | /////åæ°ï¼string sqlã |
| | | /////è¿åå¼ï¼objectã |
| | | ///// </summary> |
| | | //[Route("Gy_WorkType/AddBill")] |
| | | //[HttpPost] |
| | | //public object AddBill([FromBody] JObject oMain) |
| | | //{ |
| | | // try |
| | | // { |
| | | // var _value = oMain["oMain"].ToString(); |
| | | // string msg1 = _value.ToString(); |
| | | // //ååºåå |
| | | // msg1 = "[" + msg1.ToString() + "]"; |
| | | // DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl(); |
| | | // DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View(); |
| | | // List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg1); |
| | | // long HItemID = list[0].HItemID ; |
| | | // string HNumber = list[0].HNumber; |
| | | // string HName = list[0].HName; |
| | | // string HShortNumber = list[0].HShortNumber; |
| | | // long HParentID = list[0].HParentID; |
| | | // string HHelpCode = list[0].HHelpCode; |
| | | // string HRemark = list[0].HRemark; |
| | | // bool HStopflag = list[0].HStopflag; |
| | | // string HForEmp = list[0].HForEmp; |
| | | // //string HUseFlag = list[0].HUseFlag; |
| | | // var HPayMoney = list[0].HPayMoney; |
| | | // var HDayMoney = list[0].HDayMoney; |
| | | // var HEndFlag = 0; |
| | | // var HLevel = ""; |
| | | // if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // //è¥MAINDIéå¤åéæ°è·å |
| | | // oCN.BeginTran(); |
| | | // //主表 |
| | | // string sql = "Insert into Gy_WorkType " + |
| | | // " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" + |
| | | // ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " + |
| | | // " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" + |
| | | // "," + HLevel.ToString() + "," + HEndFlag + "," + HStopflag + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")"; |
| | | // oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | // if (list[0].HItemID.ToString() != "") |
| | | // { |
| | | // oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // } |
| | | // oCN.Commit(); |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "æ°å¢æåï¼"; |
| | | // //objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkPayType/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_WorkPayType_Ctl oDept = new DAL.ClsGy_WorkPayType_Ctl(); |
| | | DAL.ClsGy_WorkPayType_View oDeptHlp = new DAL.ClsGy_WorkPayType_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | //string msg3 = sArray[1].ToString(); |
| | | //string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_WorkPayType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkPayType>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HShortNumber = "0"; |
| | | long HParentID = list[0].HParentID; |
| | | var HLevel = list[0].HLevel; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | |
| | | |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_WorkPayType " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_WorkPayType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Update Gy_WorkPayType set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HLevel=" + HLevel.ToString() + |
| | | ",HParentID=" + HParentID.ToString() + |
| | | ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_WorkPayType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_WorkPayType")] |
| | | [HttpGet] |
| | | public object DeltetGy_WorkPayType(string HItemID) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | //string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_WorkPayType where HItemID=" + HItemID, "Gy_WorkPayType"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_WorkPayType Where HParentID='" + HItemID + "'", " Gy_WorkPayType"); |
| | | if (ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); |
| | | if (HUseFlag == "已使ç¨") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_WorkPayType where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Model; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_WorkTypeController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥ä½ä¸å¿å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkType/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkTypeList " + sWhere, "h_v_Gy_WorkTypeList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_WorkTypeList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkTypeList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkType/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_WorkTypeList where HitemID=" + HInterID, "h_v_Gy_WorkTypeList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// æ°å¢åæ®-ä¿åæé® |
| | | /////åæ°ï¼string sqlã |
| | | /////è¿åå¼ï¼objectã |
| | | ///// </summary> |
| | | //[Route("Gy_WorkType/AddBill")] |
| | | //[HttpPost] |
| | | //public object AddBill([FromBody] JObject oMain) |
| | | //{ |
| | | // try |
| | | // { |
| | | // var _value = oMain["oMain"].ToString(); |
| | | // string msg1 = _value.ToString(); |
| | | // //ååºåå |
| | | // msg1 = "[" + msg1.ToString() + "]"; |
| | | // DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl(); |
| | | // DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View(); |
| | | // List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg1); |
| | | // long HItemID = list[0].HItemID ; |
| | | // string HNumber = list[0].HNumber; |
| | | // string HName = list[0].HName; |
| | | // string HShortNumber = list[0].HShortNumber; |
| | | // long HParentID = list[0].HParentID; |
| | | // string HHelpCode = list[0].HHelpCode; |
| | | // string HRemark = list[0].HRemark; |
| | | // bool HStopflag = list[0].HStopflag; |
| | | // string HForEmp = list[0].HForEmp; |
| | | // //string HUseFlag = list[0].HUseFlag; |
| | | // var HPayMoney = list[0].HPayMoney; |
| | | // var HDayMoney = list[0].HDayMoney; |
| | | // var HEndFlag = 0; |
| | | // var HLevel = ""; |
| | | // if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // //è¥MAINDIéå¤åéæ°è·å |
| | | // oCN.BeginTran(); |
| | | // //主表 |
| | | // string sql = "Insert into Gy_WorkType " + |
| | | // " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" + |
| | | // ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " + |
| | | // " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" + |
| | | // "," + HLevel.ToString() + "," + HEndFlag + "," + HStopflag + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")"; |
| | | // oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | // if (list[0].HItemID.ToString() != "") |
| | | // { |
| | | // oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // } |
| | | // oCN.Commit(); |
| | | // objJsonResult.code = "1"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "æ°å¢æåï¼"; |
| | | // //objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_WorkType/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl(); |
| | | DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | //string msg3 = sArray[1].ToString(); |
| | | //string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HShortNumber = "0"; |
| | | long HParentID = list[0].HParentID; |
| | | var HLevel = list[0].HLevel; |
| | | string HRemark = list[0].HRemark; |
| | | bool HStopflag = list[0].HStopflag; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | var HDayMoney = list[0].HDayMoney; |
| | | var HPayMoney = list[0].HPayMoney; |
| | | string HForEmp = list[0].HForEmp; |
| | | |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_WorkType " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" + |
| | | "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Update Gy_WorkType set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HForEmp='" + HForEmp + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HLevel=" + HLevel.ToString() + |
| | | ",HParentID=" + HParentID.ToString() + |
| | | ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + |
| | | ",HPayMoney=" + HPayMoney.ToString() + |
| | | ",HDayMoney=" + HDayMoney.ToString() + |
| | | ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_WorkType")] |
| | | [HttpGet] |
| | | public object DeltetGy_WorkType(string HItemID) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | //string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_WorkType where HItemID=" + HItemID, "Gy_WorkType"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_WorkType Where HParentID='" + HItemID + "'", " Gy_WorkType"); |
| | | if (ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); |
| | | if (HUseFlag == "已使ç¨") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_WorkType where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Gy_OrderBackInfo |
| | | { |
| | | public long HItemID { get; set; } //ID |
| | | public string HNumber { get; set; } //代ç |
| | | public string HName { get; set; } //åç§° |
| | | public string HShortNumber { get; set; } //ç代ç |
| | | public long HParentID { get; set; } //ç¶çº§ID |
| | | public long HLevel { get; set; } //å±çº§ |
| | | public long HEndFlag { get; set; } // |
| | | |
| | | public string HHelpCode { get; set; } // å©è®°ç |
| | | |
| | | public string HRemark { get; set; } //夿³¨ |
| | | |
| | | public bool HStopflag { get; set; } //ç¦ç¨æ å¿ |
| | | |
| | | public bool HUseFlag { get; set; } //使ç¨ç¶æ |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Gy_OrderLevList |
| | | { |
| | | public long HItemID { get; set; } //ID |
| | | public string HNumber { get; set; } //代ç |
| | | public string HName { get; set; } //åç§° |
| | | public string HShortNumber { get; set; } //ç代ç |
| | | public long HParentID { get; set; } //ç¶çº§ID |
| | | public long HLevel { get; set; } //å±çº§ |
| | | public long HEndFlag { get; set; } // |
| | | |
| | | public string HHelpCode { get; set; } // å©è®°ç |
| | | |
| | | public string HRemark { get; set; } //夿³¨ |
| | | |
| | | public bool HStopflag { get; set; } //ç¦ç¨æ å¿ |
| | | |
| | | public bool HUseFlag { get; set; } //使ç¨ç¶æ |
| | | |
| | | public string HYX { get; set; }//ä¼å
级 |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Gy_WorkPayType |
| | | { |
| | | public long HItemID { get; set; } |
| | | public string HNumber { get; set; } // 代ç |
| | | public string HName { get; set; } // |
| | | public string HHelpCode { get; set; } //å©è®°ç |
| | | public string HShortNumber { get; set; } //ç代ç |
| | | public long HParentID { get; set; } //ç¶çº§ID |
| | | public long HLevel { get; set; } |
| | | public bool HEndFlag { get; set; } //æ«çº§æ å¿ |
| | | public bool HStopflag { get; set; } //ç¦ç¨æ å¿ |
| | | |
| | | public string HRemark { get; set; } //夿³¨ |
| | | public string HUseFlag { get; set; } //ä½¿ç¨æ å¿ |
| | | |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class Gy_WorkType |
| | | { |
| | | public long HItemID { get; set; } |
| | | public string HNumber { get; set; } // 代ç |
| | | public string HName { get; set; } // |
| | | public string HHelpCode { get; set; } //å©è®°ç |
| | | public string HShortNumber { get; set; } //ç代ç |
| | | public long HParentID { get; set; } //ç¶çº§ID |
| | | public long HLevel { get; set; } |
| | | public bool HEndFlag { get; set; } //æ«çº§æ å¿ |
| | | public bool HStopflag { get; set; } //ç¦ç¨æ å¿ |
| | | public long HPayMoney { get; set; } |
| | | public long HDayMoney { get; set; } |
| | | public string HForEmp { get; set; } //ç代ç |
| | | public string HRemark { get; set; } //夿³¨ |
| | | public string HUseFlag { get; set; } //ä½¿ç¨æ å¿ |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> |
| | | <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> |
| | | <UseIISExpress>false</UseIISExpress> |
| | | <Use64BitIISExpress /> |