| | |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//开始事务 |
| | | string HNumber = ""; |
| | | string HName = ""; |
| | | ds = oCN.RunProcReturn("select * from Gy_Employee where HItemID=" + HItemID, "Gy_Employee"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | else |
| | | { |
| | | HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString(); |
| | | HName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | } |
| | | |
| | | |
| | | var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | if (HStopflag) |
| | | { |
| | |
| | | } |
| | | |
| | | oCN.RunProc("delete from Gy_Employee where HItemID=" + HItemID); |
| | | |
| | | |
| | | |
| | | //写入日志 |
| | | string Operation = "删除"; //操作 |
| | | string ComputerName = System.Net.Dns.GetHostName(); //设备名称 |
| | | string WorkList = Operation + "职员,职员代码:" + HNumber + ";职员名称:" + HName ; //操作详情 |
| | | string MvarReportTitle = "职员列表"; //操作模块 |
| | | string SystemName = "LMES-" + MvarReportTitle + "模块"; //操作模块 |
| | | string IPAddress = ""; |
| | | //string IPAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0].ToString(); //IP地址 |
| | | //string IPAddress = System.Web.HttpContext.Current.Request.UserHostAddress; |
| | | |
| | | oCN.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " + |
| | | "(getdate(),'" + user + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','" + IPAddress + "','" + Operation + "')" |
| | | ); |
| | | |
| | | |
| | | oCN.Commit();//提交事务 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | ,HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HGroupID,HUseFlag,HMakeTime,HCREATEORGID,HUSEORGID |
| | | ) |
| | | values |
| | | ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | ({jsonData.HItemID},{jsonData.HItemID},'{jsonData.HNumber}','{jsonData.HName}', |
| | | '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}',{jsonData.HDeptID},{jsonData.HGroupID},'{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HCREATEORGID},{jsonData.HUSEORGID})"; |
| | | |
| | | oCN.RunProc(sql); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 根据班组返回职员信息 |
| | | /// <summary> |
| | | /// 根据班组返回职员信息 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Gy_EmployeeController/GetEmpInfoByGroup_Json")] |
| | | [HttpGet] |
| | | public object GetEmpInfoByGroup_Json(Int64 HGroupID) |
| | | { |
| | | try |
| | | { |
| | | //返回列表信息 |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_EmployeeList where 禁用标记='' and HGroupID=" + HGroupID + " order by 职员代码", "h_v_IF_EmployeeList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "所选班组无对应职员信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //获取到DataColumn列对象的列名 |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "根据班组返回职员信息失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |