public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string FaultReturn = HttpContext.Current.Request.Params["faultReturn"]; DataSet dsuserinfo = new DataSet(); string sqlrole = string.Format("update FaultNotice set FaultReturn=N'{0}' where ID={1};", FaultReturn, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "执行故障通知单成功:" + FaultReturn); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public Form1() { InitializeComponent(); try { SignalRTimer = new Timer(); SignalRTimer.Interval = 1500; SignalRTimer.Tick += SignalRTimer_Tick; SignalRTimer.Enabled = true; OPCconnectTimer = new Timer(); OPCconnectTimer.Interval = 1000; OPCconnectTimer.Tick += OPCconnectTimer_Tick; OPCconnectTimer.Enabled = true; //初始化链接状态定时器 tim = new Timer(); //定义一个1S的定时器; tim.Interval = 1500; tim.Tick += theout; //定时时间到后执行theout事件; tim.Enabled = true;; //是否执行System.Timers.Timer.Elapsed事件; //(1)创建opc server对象 objServer = new OPCServer(); //objChangeItem = new OPCItem[4]; } catch (Exception ex) { SystemLogs.InsertPLCLog("AndonResult", ex.Message); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; //string DEPT = HttpContext.Current.Request.Params["dept"]; DataSet dsuserinfo = new DataSet(); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; } if (ID.Trim() != "") { string sql = string.Format(@"update ProductPLCTraceabilityInfo set LastStatus=N'OK',Updator=N'{1}' where ID in ({0})", ID.TrimStart('|').Replace("|", ","), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString()); SQLHelper.ExcuteSQL(sql); } if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "PLC过程质量问题关闭成功:" + ID); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public SystemLogs UpdateSystemLogs(SystemLogs model) { _unitOfWork.Repository <SystemLogs>().Update(model); _unitOfWork.Save(); return(model); }
public ActionResult Index(string?userName, string?password) { try { if (!String.IsNullOrEmpty(userName)) { LoginModel loginModel = new LoginModel(); loginModel = _iLoginService.GetLogin(userName, password); if (loginModel != null) { List <UserPageRolePermissionModel> userPageRolePermissionModels = _iLoginService.GetUserPageRolePermission(loginModel.WebRoleId); if (userPageRolePermissionModels.Count > 0) { MergeRolePermission(userPageRolePermissionModels); } MergeLogin(loginModel); return(RedirectToAction("Index", "Home")); } else { ViewBag.Message = ""; ViewBag.Validate = "Invalid Username or Password!!!"; } } SystemLogs.Register("Login.Index method called!!!"); } catch (Exception ex) { SystemLogs.Register(ex.Message); } return(View()); }
public SystemLogs InsertSystemLogs(SystemLogs model) { _unitOfWork.Repository <SystemLogs>().Add(model); _unitOfWork.Save(); return(model); }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string WarehouseNo = HttpContext.Current.Request.Params["warehouseNo"]; string WarehouseType = HttpContext.Current.Request.Params["warehouseType"]; string WarehouseName = HttpContext.Current.Request.Params["warehouseName"]; //string DesignCycle = HttpContext.Current.Request.Params["designCycle"]; //string PlanCycle = HttpContext.Current.Request.Params["planCycle"]; //string IsEnable = HttpContext.Current.Request.Params["isEnable"]; //string PhoneNumber = HttpContext.Current.Request.Params["phoneNumber"]; //string UserImagic = HttpContext.Current.Request.Params["userImagic"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into Warehouse(WarehouseType,WarehouseName) values(N'{0}',N'{1}');select SCOPE_IDENTITY();", WarehouseType, WarehouseName); object o = SQLHelper.GetObject(sqlrole); if (o != null) { string sqlx = @"update Warehouse set WarehouseNo='" + o.ToString().PadLeft(3, '0') + "' where ID=" + o.ToString(); SQLHelper.ExcuteSQL(sqlx); ID = o.ToString(); } if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增仓储区域成功:" + o.ToString().PadLeft(3, '0') + "/" + WarehouseName); } } else { string sqlrole = string.Format("update Warehouse set WarehouseType=N'{0}',WarehouseName=N'{1}' where ID={2};", WarehouseType, WarehouseName, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑仓储区域成功:" + WarehouseNo + "/" + WarehouseName); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string TicketReturn = HttpContext.Current.Request.Params["ticketReturn"]; string ExecuteStatus = HttpContext.Current.Request.Params["executeStatus"]; string sqlrole = string.Format("update AMTicketSplit set SplitReturn=N'{0}',Stratus=N'{1}' where ID=N'{2}';", TicketReturn, ExecuteStatus, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑维护任务内容信息成功:" + TicketReturn); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
protected override void OnStart(string[] args) { try { OPCconnectTimer = new Timer(); OPCconnectTimer.Interval = 1000; OPCconnectTimer.Elapsed += new ElapsedEventHandler(OPCconnectTimer_Tick); OPCconnectTimer.Enabled = true; //初始化链接状态定时器 tim = new Timer(); //定义一个1S的定时器; tim.Interval = 1500; tim.Elapsed += new ElapsedEventHandler(theout); //定时时间到后执行theout事件; tim.Enabled = true;; //是否执行System.Timers.Timer.Elapsed事件; //(1)创建opc server对象 objServer = new OPCServer(); //objChangeItem = new OPCItem[4]; } catch (Exception ex) { SystemLogs.InsertPLCLog("Order2PLC", ex.Message); } }
private void btn_EmergSupplyOK_Click(object sender, EventArgs e) { if (this.comboMaterialNo.Text.Trim().Length > 0 && RegularHelper.isNumericString(this.txtMaterialCount.Text.Trim())) { try { //调用tcp/ip 协议,发送紧急备料请求到库房App //Server. MainForm.CheckConnectionWithServer(); Program.S.SendMessageToWS(Login.CurrentProductionLineNumber.ToString(), this.comboMaterialNo.Text.Trim(), AH.Network.MsgType.Emerg); } catch (Exception excpt) { SpMessageBox.Show("告警:" + excpt.Message, "通信-库房"); } SystemLogs.WriteSystemLog(Login.UserName, "Sending urgent request for material " + this.comboMaterialNo.Text.Trim() + " at " + Login.CurrentProductionLine, DateTime.Now); ShowLoginTip("紧急Call料请求已发送."); } else { SpMessageBox.Show("请检查订单号,产品号,和订单数量的输入", "订单查询"); } }
protected override void OnStop() { try { //释放所有组资源 if (null != objGroup) { objGroup.DataChange -= new DIOPCGroupEvent_DataChangeEventHandler(KepGroup_DataChange); objGroup.AsyncWriteComplete -= new DIOPCGroupEvent_AsyncWriteCompleteEventHandler(AsyncWriteComplete); objGroup = null; objServer.OPCGroups.RemoveAll(); SystemLogs.InsertPLCLog("Order2PLC", "释放所有组资源!"); } if (null != objServer) { objServer.Disconnect(); objServer = null; objItems = null; GC.Collect(); SystemLogs.InsertPLCLog("Order2PLC", "断开连接OPC释放所有组资源!"); } } catch (Exception ex) { SystemLogs.InsertPLCLog("Order2PLC", ex.Message); } }
private void btn_AddOrder_Click(object sender, EventArgs e) { if ((this.txtAddOrderNo.Text.Trim().Length > 0) && (this.txtAddProdNo.Text.Trim().Length > 0) && (RegularHelper.isNumericString(this.txtAddOrderCount.Text.Trim()))) { DialogResult diaresult = SpMessageBox.Show("确定要补充该订单吗?", "订单补充", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (diaresult == DialogResult.OK) { if (OrderInfoBLL.OrderAlreadyExsit(this.txtAddOrderNo.Text.Trim())) { if (OrderInfo.UpdateOrderCount(this.txtAddOrderNo.Text.Trim(), this.txtAddProdNo.Text.Trim(), int.Parse(this.txtAddOrderCount.Text.Trim()))) { SpMessageBox.Show("该订单数量补充完成", "订单补充"); } } else { SpMessageBox.Show("该订单号不存在,请检查该订单号是否生效", "订单补充"); } SystemLogs.WriteSystemLog(Login.UserName, "add order count:" + this.txtAddOrderCount.Text.Trim() + " for order " + this.txtAddOrderNo.Text.Trim() + " at " + Login.CurrentProductionLine, DateTime.Now); } } else { SpMessageBox.Show("请检查订单号,产品号,和订单数量的输入", "订单补充"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string ProcessName = HttpContext.Current.Request.Params["processName"]; string sql = ""; if (ID.Trim() != "") { sql += string.Format(@"delete from PCStationProcessSheet where ProcessId =N'{0}';", ID); SQLHelper.ExcuteSQL(sql); } SQLHelper.ExcuteSQL(sql); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "删除站点工艺信息:" + ID + "/" + ProcessName); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string CutterCode = HttpContext.Current.Request.Params["cutterCode"]; string CutterName = HttpContext.Current.Request.Params["cutterName"]; string CutterSupplier = HttpContext.Current.Request.Params["cutterSupplier"]; string CutterDesc = HttpContext.Current.Request.Params["cutterDesc"]; string CutterImg = HttpContext.Current.Request.Params["cutterImg"]; string StoreId = HttpContext.Current.Request.Params["storeId"]; string Speed = HttpContext.Current.Request.Params["speed"]; string LimitTime = HttpContext.Current.Request.Params["limitTime"]; string AlarmTime = HttpContext.Current.Request.Params["alarmTime"]; string StationId = HttpContext.Current.Request.Params["stationId"]; string SingleTime = HttpContext.Current.Request.Params["singleTime"]; string UsedTime = HttpContext.Current.Request.Params["usedTime"]; string Status = HttpContext.Current.Request.Params["status"]; DataSet dsuserinfo = new DataSet(); if (ID.Trim() == "") { string sqlrole = string.Format("insert into CuttorInfo(CutterCode,CutterName,CutterSupplier,CutterDesc,CutterImg,StoreId,Speed,LimitTime,AlarmTime,StationId,SingleTime,UsedTime,Status) " + "values(N'{0}',N'{1}',N'{2}',N'{3}',N'{4}',N'{5}',N'{6}',N'{7}',N'{8}',N'{9}',N'{10}',N'{11}',N'{12}') ;", CutterCode, CutterName, CutterSupplier, CutterDesc, CutterImg, StoreId, Speed, LimitTime, AlarmTime, StationId, SingleTime, UsedTime, Status); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增刀具成功:" + CutterName); } } else { string sqlrole = string.Format("update CuttorInfo set CutterCode=N'{0}',CutterName=N'{1}',CutterSupplier=N'{2}',CutterDesc=N'{3}',CutterImg=N'{4}',StoreId=N'{5}',Speed=N'{6}',LimitTime=N'{7}',AlarmTime=N'{8}',StationId=N'{9}',SingleTime=N'{10}',UsedTime=N'{11}',Status=N'{12}' where ID={13};", CutterCode, CutterName, CutterSupplier, CutterDesc, CutterImg, StoreId, Speed, LimitTime, AlarmTime, StationId, SingleTime, UsedTime, Status, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑刀具成功:" + CutterName); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string EquipmentId = HttpContext.Current.Request.Params["id"]; string EquipmentName = HttpContext.Current.Request.Params["ename"]; string sql = ""; sql += string.Format(@"delete from FaultUserInfo where EquipmentId =N'{0}';", EquipmentId); SQLHelper.ExcuteSQL(sql); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "删除设备故障提醒设置成功:" + EquipmentId + "/" + EquipmentName); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
private void btnLogin_Click(object sender, EventArgs e) { if (this.comboProductionLine.Text.Trim() == string.Empty) { SpMessageBox.Show("请选择产线编号.", "用户登录"); return; } else { CurrentProductionLine = this.comboProductionLine.Text.Trim(); CurrentProductionLineNumber = byte.Parse(System.Text.RegularExpressions.Regex.Replace(Login.CurrentProductionLine, @"[^0-9]+", "")); } if (this.cmbUser.Text.Trim() != string.Empty) { UserName = this.cmbUser.Text.Trim(); if (!CheckUserandPswd(UserName, txtLoginPwd.Text.Trim())) { ShowLoginTip("用户名或密码错误,请重新输入."); return; } this.DialogResult = DialogResult.OK; this.Close(); } //string loginTrace = string.Format("{0}: User {1} Login", DateTime.Now, UserName); //LogerHelper.ToAutoTestLogFile(loginTrace); SystemLogs.WriteSystemLog(UserName, "Login to " + CurrentProductionLine, DateTime.Now); Login.Authority = (LoginAuthority)UserInfos.GetRoleByUser(Login.UserName); this.DialogResult = DialogResult.OK; this.Close(); }
public async Task <SystemLogs> InsertSystemLogsAsync(SystemLogs model) { await _unitOfWork.Repository <SystemLogs>().AddAsync(model); _unitOfWork.Save(); return(model); }
public JsonResult GetInfo(string ID) { var mql2 = SystemLogsSet.SelectAll().Where(SystemLogsSet.Id.Equal(ID)); SystemLogs Rmodel = OPBiz.GetEntity(mql2); // groupsBiz.Add(rol); return(Json(Rmodel, JsonRequestBehavior.AllowGet)); }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string MaterialCallCode = HttpContext.Current.Request.Params["materialCallCode"]; string MaterialId = HttpContext.Current.Request.Params["materialId"]; string StoreId = HttpContext.Current.Request.Params["storeId"]; string CallType = HttpContext.Current.Request.Params["callType"]; string DeductionCountor = HttpContext.Current.Request.Params["deductionCountor"]; string DeliverType = HttpContext.Current.Request.Params["deliverType"]; string SaveNumber = HttpContext.Current.Request.Params["saveNumber"]; string DelayTime = HttpContext.Current.Request.Params["delayTime"]; string DeliverWay = HttpContext.Current.Request.Params["deliverWay"]; string StationId = HttpContext.Current.Request.Params["stationId"]; DataSet dsuserinfo = new DataSet(); if (ID.Trim() == "") { string sqlrole = string.Format("insert into MaterialCallPoint(MaterialCallCode,MaterialId,StoreId,CallType,DeductionCountor,DeliverType,SaveNumber,DelayTime,DeliverWay,StationId,WHCount) " + "values(N'{0}',N'{1}',N'{2}',N'{3}',N'{4}',N'{5}',N'{6}',N'{7}',N'{8}',N'{9}',0) ;", MaterialCallCode, MaterialId, StoreId, CallType, DeductionCountor, DeliverType, SaveNumber, DelayTime, DeliverWay, StationId); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增零件落点成功:" + MaterialCallCode); } } else { string sqlrole = string.Format("update MaterialCallPoint set MaterialCallCode=N'{0}',MaterialId=N'{1}',StoreId=N'{2}',CallType=N'{3}',DeductionCountor=N'{4}',DeliverType=N'{5}',SaveNumber=N'{6}',DelayTime=N'{7}',DeliverWay=N'{8}',StationId=N'{9}' where ID={10};", MaterialCallCode, MaterialId, StoreId, CallType, DeductionCountor, DeliverType, SaveNumber, DelayTime, DeliverWay, StationId, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑零件落点成功:" + MaterialCallCode); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string ShiftCode = HttpContext.Current.Request.Params["shiftCode"]; string ShiftName = HttpContext.Current.Request.Params["shiftName"]; string BeginTime = HttpContext.Current.Request.Params["beginTime"]; string EndTime = HttpContext.Current.Request.Params["endTime"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into Rest(ShiftCode,ShiftName,BeginTime,EndTime) " + "values(N'{0}',N'{1}',N'{2}',N'{3}') ;select SCOPE_IDENTITY();", ShiftCode, ShiftName, BeginTime, EndTime); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增小休成功:" + ShiftName); } } else { string sqlrole = string.Format("update Rest set ShiftCode=N'{0}',ShiftName=N'{1}',BeginTime=N'{2}',EndTime=N'{3}' where ID={4};", ShiftCode, ShiftName, BeginTime, EndTime, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑小休成功:" + ShiftName); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string EquipmentId = HttpContext.Current.Request.Params["equipmentId"]; string FaultCode = HttpContext.Current.Request.Params["faultCode"]; string FaultType = HttpContext.Current.Request.Params["faultType"]; string FaultDesc = HttpContext.Current.Request.Params["faultDesc"]; string PLCDB = HttpContext.Current.Request.Params["plcDB"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into FaultCodeInfo(EquipmentId,FaultCode,FaultType,FaultDesc,PLCDB) " + "values(N'{0}',N'{1}',N'{2}',N'{3}',N'{4}') ;select SCOPE_IDENTITY();", EquipmentId, FaultCode, FaultType, FaultDesc, PLCDB); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增故障代码信息成功:" + FaultCode); } } else { string sqlrole = string.Format("update FaultCodeInfo set EquipmentId=N'{0}',FaultCode=N'{1}',FaultType=N'{2}',FaultDesc=N'{3}',PLCDB=N'{4}' where ID={5};", EquipmentId, FaultCode, FaultType, FaultDesc, PLCDB, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑故障代码信息成功:" + FaultCode); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string PLCStationId = HttpContext.Current.Request.Params["plcStationId"]; string PLCAPDBAddress = HttpContext.Current.Request.Params["plcAPDBAddress"]; string APDataLength = HttpContext.Current.Request.Params["apDataLength"]; string APDataDesc = HttpContext.Current.Request.Params["apDataDesc"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into PLCAPInfo(PLCStationId,PLCAPDBAddress,APDataLength,APDataDesc) " + "values(N'{0}',N'{1}',N'{2}',N'{3}') ;select SCOPE_IDENTITY();", PLCStationId, PLCAPDBAddress, 1, APDataDesc); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增站点PLCAP信息成功:" + APDataDesc); } } else { string sqlrole = string.Format("update PLCAPInfo set PLCStationId=N'{0}',PLCAPDBAddress=N'{1}',APDataLength=N'{2}',APDataDesc=N'{3}' where PLCAPId=N'{4}';", PLCStationId, PLCAPDBAddress, 1, APDataDesc, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑站点PLCAP信息成功:" + APDataDesc); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string ProductionId = HttpContext.Current.Request.Params["productionId"]; string ProductionName = HttpContext.Current.Request.Params["productionName"]; string ProductionType = HttpContext.Current.Request.Params["productionType"]; string ProductionSheet = HttpContext.Current.Request.Params["productionSheet"]; string LineId = HttpContext.Current.Request.Params["lineId"]; string Batch = HttpContext.Current.Request.Params["batch"]; string StoreId = HttpContext.Current.Request.Params["storeId"]; string ProductionImg = HttpContext.Current.Request.Params["productionImg"]; string ProductionDesc = HttpContext.Current.Request.Params["productionDesc"]; string IsEnable = HttpContext.Current.Request.Params["isEnable"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into ProductionInfo(ProductionId,ProductionName,ProductionType,ProductionSheet,LineId,Batch,StoreId,ProductionImg,ProductionDesc) " + "values(N'{0}',N'{1}',N'{2}',N'{3}',N'{4}',N'{5}',N'{6}',N'{7}',N'{8}') ;", ProductionId, ProductionName, ProductionType, ProductionSheet, LineId, Batch, StoreId, ProductionImg, ProductionDesc); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增产品成功:" + ProductionId + "/" + ProductionName); } } else { string sqlrole = string.Format("update ProductionInfo set ProductionId=N'{0}',ProductionName=N'{1}',ProductionType=N'{2}',ProductionSheet=N'{3}',LineId=N'{4}',Batch=N'{5}',StoreId=N'{6}',ProductionImg=N'{7}',ProductionDesc=N'{8}' where ID={9};", ProductionId, ProductionName, ProductionType, ProductionSheet, LineId, Batch, StoreId, ProductionImg, ProductionDesc, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑产品成功:" + ProductionId + "/" + ProductionName); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string PCStationId = HttpContext.Current.Request.Params["pcStationId"]; string QualityDesc = HttpContext.Current.Request.Params["qualityDesc"]; string QualityStandard = HttpContext.Current.Request.Params["qualityStandard"]; //string ProcessType = HttpContext.Current.Request.Params["processType"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into PCStationQuality(PCStationId,QualityDesc,QualityStandard) " + "values(N'{0}',N'{1}',N'{2}') ;select SCOPE_IDENTITY();", PCStationId, QualityDesc, QualityStandard); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增站点过程质量信息成功:" + QualityDesc); } } else { string sqlrole = string.Format("update PCStationQuality set PCStationId=N'{0}',QualityDesc=N'{1}',QualityStandard=N'{2}' where QualityId={3};", PCStationId, QualityDesc, QualityStandard, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑站点过程质量信息成功:" + QualityDesc); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string ProductionId = HttpContext.Current.Request.Params["productionId"]; string MaterialId = HttpContext.Current.Request.Params["materialId"]; string MaterialCode = HttpContext.Current.Request.Params["materialCode"]; string UseCount = HttpContext.Current.Request.Params["useCount"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into PBOM(ProductionId,MaterialId,MaterialCode,UseCount) " + "values(N'{0}',N'{1}',N'{2}',N'{3}') ;select SCOPE_IDENTITY();", ProductionId, MaterialId, MaterialCode, UseCount); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增BOM信息成功:" + ProductionId + "/" + MaterialCode); } } else { string sqlrole = string.Format("update PBOM set ProductionId=N'{0}',MaterialId=N'{1}',MaterialCode=N'{2}',UseCount=N'{3}' where QualityId={4};", ProductionId, MaterialId, MaterialCode, UseCount, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑BOM信息成功:" + ProductionId + "/" + MaterialCode); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
/// <summary> /// RecordSystemLogs /// </summary> /// <param name="data"></param> public static void RecordSystemLogs(SystemLogs data) { data.SystemID = data.SystemID ?? EnvironmentConfig.SystemID; data.SystemName = data.SystemName ?? EnvironmentConfig.SystemName; data.Environment = data.Environment ?? EnvironmentConfig.Environment; data.TraceId = data.TraceId ?? TraceId; ServiceContainer.Resolve<ITracingRecord>().RecordSystemLogs(data); }
/// <summary> /// RecordSystemLogs /// </summary> /// <param name="data"></param> public static void RecordSystemLogs(SystemLogs data) { data.SystemID = data.SystemID ?? EnvironmentConfig.SystemID; data.SystemName = data.SystemName ?? EnvironmentConfig.SystemName; data.Environment = data.Environment ?? EnvironmentConfig.Environment; data.TraceId = data.TraceId ?? TraceId; ServiceContainer.Resolve <ITracingRecord>().RecordSystemLogs(data); }
private void btn_SwitchLine_Click(object sender, EventArgs e) { DialogResult diaresult = SpMessageBox.Show("确定要切线吗?", "切线操作", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (diaresult == DialogResult.OK) { if (UserInfos.GetRoleByUser(Login.UserName) == (byte)LoginAuthority.SuperAdmin || UserInfos.GetRoleByUser(Login.UserName) == (byte)LoginAuthority.Administrator) { try { if (ProductionLineMaterial.GetMaterialsTotalRemainConsump(Login.CurrentProductionLineNumber, this.txtOrderNo.Text.Trim()) > 0) //切线前,先判断是否已经扣料了 { SpMessageBox.Show("该订单生产还没有进行扣料,请先进行扣料然后再切线.", "生产切线"); try { Program.S.SendMessageToWS(Login.CurrentProductionLineNumber.ToString(), this.txtOrderNo.Text.Trim() + "|" + this.textProdNo.Text.Trim() + "|" + this.textOrderCount.Text.Trim(), AH.Network.MsgType.Deduct); } catch (Exception excpt) { SpMessageBox.Show("告警:" + excpt.Message, "通信-库房"); } return; } } catch (Exception excpt) { SpMessageBox.Show("告警:" + excpt.Message, "生产切线"); return; } SystemLogs.WriteSystemLog(Login.UserName, "Switch order from " + this.txtOrderNo.Text.Trim() + "to other order at " + Login.CurrentProductionLine, DateTime.Now); ProductionLine.RemoveOrderAndProductionLineInfo(Login.CurrentProductionLineNumber, this.txtOrderNo.Text.Trim()); //切线时,没有必要删除database里这个order..... this.listView_CurrentOrder.Items.Clear(); this.txtOrderNo.Clear(); this.textOrderCount.Clear(); this.textProdNo.Clear(); CurrentOrderMaterialsList.Clear(); // stop the timer when switch orders/producitonline MainForm.timer_ReadSensors.Enabled = false; } else { SpMessageBox.Show("当前用户没有权限执行切线操作,请联系 Administrator.", "切线操作"); } } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string wmscount = HttpContext.Current.Request.Params["wmscount"]; //string WarehouseNo = HttpContext.Current.Request.Params["warehouseNo"]; //string WarehouseType = HttpContext.Current.Request.Params["warehouseType"]; //string WarehouseName = HttpContext.Current.Request.Params["warehouseName"]; //string DesignCycle = HttpContext.Current.Request.Params["designCycle"]; //string PlanCycle = HttpContext.Current.Request.Params["planCycle"]; //string IsEnable = HttpContext.Current.Request.Params["isEnable"]; //string PhoneNumber = HttpContext.Current.Request.Params["phoneNumber"]; //string UserImagic = HttpContext.Current.Request.Params["userImagic"]; string sqlwms = ""; if (wmscount.Trim() != "") { string[] list = wmscount.Split('|'); if (list.Length > 0) { for (int i = 0; i < list.Length; i++) { if (list[i].Trim() != "") { string[] list2 = list[i].Split('_'); sqlwms += string.Format(@"update Material_W_S set MTotal=N'{0}' where ID=N'{1}' ;", list2[1], list2[0]); } } } } if (sqlwms != "") { SQLHelper.ExcuteSQL(sqlwms); } if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "更新库存成功:" + wmscount); } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void ProcessRequest(HttpContext context) { try { context.Response.ContentType = "text/plain"; string ID = HttpContext.Current.Request.Params["id"]; string TicketId = HttpContext.Current.Request.Params["ticketId"]; string AlarmContent = HttpContext.Current.Request.Params["alarmContent"]; string Xdate = HttpContext.Current.Request.Params["xdate"]; string AlarmTime = HttpContext.Current.Request.Params["alarmTime"]; if (ID.Trim() == "") { string sqlrole = string.Format("insert into AMCommentAlarm(TicketId,AlarmContent,Xdate,AlarmTime) " + "values(N'{0}',N'{1}',N'{2}',N'{3}') ;select SCOPE_IDENTITY();", TicketId, AlarmContent, Xdate, AlarmTime); object o = SQLHelper.GetObject(sqlrole); //if (o != null) //{ // string sqlx = @"update StationInfo set StationCode='FANUC-S-C-" + o.ToString().PadLeft(5, '0') + "' where ID=" + o.ToString(); // SQLHelper.ExcuteSQL(sqlx); // ID = o.ToString(); //} if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["UserId"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "新增维护任务提醒内容信息成功:" + AlarmContent); } } else { string sqlrole = string.Format("update AMCommentAlarm set TicketId=N'{0}',AlarmContent=N'{1}',Xdate=N'{2}',AlarmTime=N'{3}' where ID=N'{4}';", TicketId, AlarmContent, Xdate, AlarmTime, ID); SQLHelper.ExcuteSQL(sqlrole); if (context.Session["_dsuserinfo"] != null) { DataSet dsuserinfo = context.Session["_dsuserinfo"] as DataSet; SystemLogs.InsertSystemLog(dsuserinfo.Tables[0].Rows[0]["ID"].ToString(), dsuserinfo.Tables[0].Rows[0]["LastName"].ToString() + dsuserinfo.Tables[0].Rows[0]["FirstName"].ToString(), dsuserinfo.Tables[0].Rows[0]["RoleName"].ToString(), "编辑维护任务提醒内容信息成功:" + AlarmContent); } } HttpContext.Current.Response.Write("1"); } catch (Exception ex) { HttpContext.Current.Response.Write("0"); } }
public void RefreshSystemLog() { SystemLogs.Clear(); foreach (LogModel.SystemLog log in LogDb.Table <LogModel.SystemLog>()) { log.Time = log.Time.ToLocalTime(); SystemLogs.Add(log); } SystemLogsSelectedIndex = SystemLogs.Count - 1; }
/// <summary> /// 记录系统日志 /// </summary> /// <param name="data"></param> public void RecordSystemLogs(SystemLogs data) { rabbitMQClient.Send(Config.SystemLogsQueueName, data, false, true); }