public ActionResult Upload(UploadSvcArg arg) { if (Request.Files != null && Request.Files.Count == 1) { HttpPostedFileBase fileUplaod = Request.Files[0]; if (fileUplaod != null && fileUplaod.ContentLength > 0) { arg.FileName = fileUplaod.FileName; arg.Stream = fileUplaod.InputStream; string url = this.uploadSvc.Upload(arg); ResultMessage<string> message = new ResultMessage<string>(); message.Data = url; return JsonView(message); } } return new EmptyResult(); }
public DataProviderVoidModel(ResultMessage resultMessage) { ResultMessage = resultMessage; }
/// <summary> /// Called, when the button Yes is pressed. /// </summary> protected void ButtonYesPressed() { this.resultMessage = ResultMessage.ButtonYes; }
/// <summary> /// Called, when the button OK is pressed. /// </summary> protected void ButtonOkPressed() { this.resultMessage = ResultMessage.ButtonOk; }
/// <summary> /// Called, when the button Cancel is pressed. /// </summary> protected void ButtonCancelPressed() { this.resultMessage = ResultMessage.ButtonCancel; }
/// <summary> /// This event is raised when the game sends a debugging message to the IDE. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The event information.</param> private void m_Communicator_MessageArrived(object sender, MessageEventArgs e) { // Invoke the message handling on the IDE's thread. Central.Manager.IDE.Invoke(new Action(() => { if (e.Message is WaitMessage) { // This is the game signalling that it is ready to receive // message requests such as setting breakpoints before the // game starts executing. foreach (IBreakpoint b in this.Breakpoints) { BreakpointSetAlwaysMessage bm = new BreakpointSetAlwaysMessage(); bm.FileName = b.SourceFile; bm.LineNumber = b.SourceLine; this.m_Communicator.Send(bm); Thread.Sleep(10); // Give the game a little bit of time to receive the message. } // After we have set breakpoints, we must tell the game to // continue executing. this.m_Communicator.Send(new ContinueMessage()); } else if (e.Message is BreakMessage) { // This is the game signalling that it has hit a breakpoint // and is now paused. // Open the designer window for the specified file. Moai.Platform.Management.File f = Central.Manager.ActiveProject.GetByPath((e.Message as BreakMessage).FileName); IDesigner d = Central.Manager.DesignersManager.OpenDesigner(f); if (d is IDebuggable) { // We can only go to a specific line in the file if the // designer supports it. (d as IDebuggable).Debug(f, (e.Message as BreakMessage).LineNumber); // Set current active line information so when we resume we can // send the EndDebug call. this.m_ActiveDesigner = d as IDebuggable; } // Inform the IDE that the game is now paused. this.p_Paused = true; if (this.DebugPause != null) { this.DebugPause(this, new EventArgs()); } } else if (e.Message is ExcpInternalMessage) { /* FIXME: Implement this. * ExcpInternalMessage m = e.Message as ExcpInternalMessage; * ExceptionDialog d = new ExceptionDialog(); * d.IDEWindow = this.p_Parent.IDEWindow; * d.MessageInternal = m; * d.Show(); */ // TODO: Indicate to the UI that the game is now paused. } else if (e.Message is ExcpUserMessage) { /* FIXME: Implement this. * ExcpUserMessage m = e.Message as ExcpUserMessage; * ExceptionDialog d = new ExceptionDialog(); * d.IDEWindow = this.p_Parent.IDEWindow; * d.MessageUser = m; * d.Show(); */ // TODO: Indicate to the UI that the game is now paused. } else if (e.Message is ResultMessage) { ResultMessage m = e.Message as ResultMessage; // TODO: Use a queue to track messages sent to the engine and match them up with the result messages. } else { // Unknown message! // TODO: Handle this properly? Central.Platform.UI.ShowMessage(e.Message.ID); } })); }
protected override void OnActionExecuted(ActionExecutedContext filterContext) //protected virtual void OnResultExecuted(ResultExecutedContext filterContext) { //得到url //得到post params //得到返回值 try { WMSDcDataContext wmsdc1 = new WMSDcDataContext(); string sUrl = filterContext.HttpContext.Request.Url.PathAndQuery; string sParamters = "?"; Dictionary <string, object> dicForm = new Dictionary <string, object>(); filterContext.HttpContext.Request.Form.CopyTo(dicForm); string[] arr = (from e in dicForm select e.Key + "=" + e.Value).ToArray(); sUrl += "&" + string.Join("&", arr); if (!string.IsNullOrEmpty(sLogReqAndRespFile)) { /*foreach (string s in filterContext.HttpContext.Request.Form.Keys) * { * sParamters += s + "=" + dicForm[s] + "&"; * }*/ if (!string.IsNullOrEmpty(sParamters)) { JavaScriptSerializer jss = new JavaScriptSerializer(); ResultMessage rmnew = new ResultMessage(); ResultMessage rmold = (ResultMessage)((JsonResult)filterContext.Result).Data; rmnew.ResultCode = rmold.ResultCode; rmnew.ResultDesc = rmold.ResultDesc; String sResult = jss.Serialize(rmnew); String sReqTime = DateTime.Now.ToString("yyyyMMddHHmmss.fff"); String sReqResp = "===============================================\r\n"; string sColSplitChars = "||||"; sReqResp += sReqTime + sColSplitChars + sUrl + sColSplitChars + sParamters + sColSplitChars + sResult + "\r\n"; sReqResp += "===============================================\r\n"; //System.IO.File.AppendAllText(sLogReqAndRespFile, sReqResp, Encoding.UTF8); dtReqEnd = DateTime.Now; iElapse = ((TimeSpan)(dtReqEnd - dtReqStart)).Milliseconds; wms_file_log flog = new wms_file_log(); flog.actdat = sReqTime; flog.fname = sLogReqAndRespFile; flog.logUsr = UsrId; flog.elapse = iElapse; flog.result = sReqResp; flog.url = sUrl; flog.@params = sParamters; flog.uptdtm = DateTime.Now; wmsdc1.wms_file_log.InsertOnSubmit(flog); wmsdc1.SubmitChanges(); } } //得到执行的sql语句,写入随机数文件中 if (WmsDc.Log != null) { WmsDc.Log.Flush(); msLogSql.Position = 0; StreamReader sr = new StreamReader(msLogSql); String slogSql = sr.ReadToEnd(); //System.IO.File.AppendAllText(sLogSqlFile, slogSql, Encoding.UTF8); //WmsDc.Log.Close(); wms_file_log flog = new wms_file_log(); flog.actdat = DateTime.Now.ToString("yyyyMMddHHmmss.fff"); flog.fname = sLogSqlFile; flog.logUsr = UsrId; flog.result = slogSql; flog.url = sUrl; flog.@params = sParamters; flog.uptdtm = DateTime.Now; wmsdc1.wms_file_log.InsertOnSubmit(flog); wmsdc1.SubmitChanges(); } } catch (Exception ex) { } }
public ActionResult InstInvCkBll(String wmsno, String barcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys) { //拆分参数 //检查并创建明细 JsonResult jr = (JsonResult)_MakeParam(wmsno, barcodes, gdsids, gdstypes, bthnos, vlddats, qtys); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(jr); } //检查单号是否存在 var qrymst = from e in WmsDc.wms_cang_105 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK && e.times == "2" select e; var arrqrymst = qrymst.ToArray(); var qrydtl = from e in WmsDc.wms_cangdtl_105 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK select e; var arrqrydtl = qrydtl.ToArray(); //单据是否找到 if (arrqrymst.Length <= 0) { return(RNoData("N0095")); } //检查是否有数据权限 wms_cang_105 mst = arrqrymst[0]; ////正在生成拣货单,请稍候重试 //string quRetrv = mst.qu; //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) //{ // return RInfo( "I0152" ); //} if (!qus.Contains(mst.qu.Trim())) { return(RInfo("I0153")); } //检查单号是否已经审核 if (mst != null && mst.chkflg == GetY()) { return(RInfo("I0154")); } //删除单据明细 //WmsDc.wms_cangdtl_105.DeleteAllOnSubmit(arrqrydtl); //增加单据明细 wms_cangdtl_105[] newdtl = (wms_cangdtl_105[])rm.ResultObject; //判断newdtl里面有没有重复录入的数据 var qrygrp = newdtl.GroupBy(e => new { e.barcode, e.gdsid, e.gdstype }).Where(e => e.Count() > 1); var arrqrygrp = qrygrp.Select(e => e.Key).ToArray(); if (arrqrygrp.Length > 0) { var g = arrqrygrp[0]; return(RInfo("I0155", g.gdsid, g.gdstype)); } //检查是否已经盘过点了 foreach (wms_cangdtl_105 d in newdtl) { //判断是否该商品是否在该区 if (!dtqus.Contains(mst.qu) && d.gdsid.Trim() != "1") { var hasPwrInQu = (from e in WmsDc.wms_set join e1 in WmsDc.gds on e.val2 equals e1.dptid where e.setid == "001" && e.val3 == mst.savdptid && e1.gdsid == d.gdsid.Trim() && e.val1 == GetQuByBarcode(d.barcode.Trim()) select e.val1.Trim()).FirstOrDefault(); if (hasPwrInQu == null || hasPwrInQu != mst.qu) { return(RInfo("I0488")); } } String boci = GetBociByWmsno(d.wmsno); d.oldbarcode = boci; if (HasChecked(d)) { return(RInfo("I0156", d.gdsid, d.gdstype)); } d.oldbarcode = ""; } WmsDc.wms_cangdtl_105.InsertAllOnSubmit(newdtl); try { WmsDc.SubmitChanges(); return(RSucc("成功", newdtl, "S0083")); } catch (Exception ex) { return(RErr(ex.Message, "E0019")); } }
private void OnDynamicTask_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) { dynamicTaskResult = string.Format("The dynamic task! {0}", result.ReturnValue); }
public void OnLongRunningJob_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) { longRunningJobStatus = result.ReturnValue.ToString(); MultipleCalls(); }
private static void IntegracionServicio() { DTE objDTE = null; SAPbobsCOM.Documents oDoc = null; try { ResultMessage rslt = FuncionesComunes.ValidacionDTEIntegrado(RutEmisor, Int32.Parse(Tipo), Folio);// Int64.Parse(Folio)); if (rslt.Success) { objDTE = ListaDTEMatrix.ListaDTE.Where(i => i.FebosID == FebId).Select(i => i.objDTE).SingleOrDefault(); if (objDTE != null) { switch (Tipo) { case "33": oDoc = (SAPbobsCOM.Documents)Conexion_SBO.m_oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices); break; case "34": oDoc = (SAPbobsCOM.Documents)Conexion_SBO.m_oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices); break; case "56": oDoc = (SAPbobsCOM.Documents)Conexion_SBO.m_oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices); break; case "61": oDoc = (SAPbobsCOM.Documents)Conexion_SBO.m_oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes); break; } oDoc.CardCode = CardCode; //oDoc.CardName = FuncionesComunes.ObtenerCardName(RutEmisor, oDoc.CardCode); switch (Tipo) { case "33": oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseInvoices; break; case "34": oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseInvoices; break; case "52": oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes; break; case "56": oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseInvoices; break; case "61": oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseCreditNotes; break; default: oDoc.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseInvoices; break; } oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service; oDoc.DocDate = Convert.ToDateTime(objDTE.IdDoc.FchEmis); oDoc.DocDueDate = Convert.ToDateTime(objDTE.IdDoc.FchVenc); oDoc.DocTotal = objDTE.Totales.MntTotal; oDoc.FolioNumber = Convert.ToInt32(Folio); oDoc.FolioPrefixString = Tipo; oDoc.Indicator = Tipo; oDoc.UserFields.Fields.Item("U_SEI_FEBOSID").Value = FebId; oDoc.Lines.ItemDescription = Descripcion; oDoc.Lines.AccountCode = Cuenta; oDoc.Lines.LineTotal = (objDTE.Totales.MntTotal - objDTE.Totales.IVA); switch (Tipo) { case "34": oDoc.Lines.TaxCode = "IVA_EXE"; break; default: break; } if (!string.IsNullOrEmpty(Dim1)) { oDoc.Lines.CostingCode = Dim1; } if (!string.IsNullOrEmpty(Dim2)) { oDoc.Lines.CostingCode2 = Dim2; } if (!string.IsNullOrEmpty(Dim3)) { oDoc.Lines.CostingCode3 = Dim3; } if (!string.IsNullOrEmpty(Dim4)) { oDoc.Lines.CostingCode4 = Dim4; } if (!string.IsNullOrEmpty(Dim5)) { oDoc.Lines.CostingCode5 = Dim5; } Int32 RetVal = oDoc.Add(); String Mensaje = String.Empty; if (RetVal.Equals(0)) { rslt = FuncionesComunes.EnviarRespuestaComercial(FebId, "ACD", String.Empty, String.Empty); if (rslt.Success) { Conexion_SBO.m_SBO_Appl.StatusBar.SetText(String.Format("Exito: El DTE {0} Tipo {1} de {2}-{3} Se integro.", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor), SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Success); //file.WriteLine(String.Format("Exito: El DTE {0} Tipo {1} de {2}-{3} Se integro.", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor)); } else { Conexion_SBO.m_SBO_Appl.StatusBar.SetText(String.Format("Reparo: El DTE {0} Tipo {1} de {2}-{3} Se integro, pero no se completo proceso de intercambio.", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor), SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Warning); //file.WriteLine(String.Format("Reparo: El DTE {0} Tipo {1} de {2}-{3} Se integro, pero no se completo proceso de intercambio.", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor)); } } else { Int32 ErrCode = 0; String ErrMsj = String.Empty; Conexion_SBO.m_oCompany.GetLastError(out ErrCode, out ErrMsj); Conexion_SBO.m_SBO_Appl.StatusBar.SetText(String.Format("Error: El DTE {0} Tipo {1} de {2}-{3} No se integro. {4}", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor, ErrMsj), SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error); //file.WriteLine(String.Format("Error: El DTE {0} Tipo {1} de {2}-{3} No se integro. {4}", objDTE.IdDoc.Folio, objDTE.IdDoc.TipoDTE, objDTE.Emisor.RznSoc, objDTE.Emisor.RUTEmisor, ErrMsj)); } } } } catch (Exception ex) { Conexion_SBO.m_SBO_Appl.StatusBar.SetText("Error: " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Long, SAPbouiCOM.BoStatusBarMessageType.smt_Error); } finally { FuncionesComunes.LiberarObjetoGenerico(objDTE); FuncionesComunes.LiberarObjetoGenerico(oDoc); } }
/// <summary> /// Sends the recognition result to the engine service user. /// </summary> /// <feature> /// http://tizen.org/feature/speech.recognition /// http://tizen.org/feature/microphone /// </feature> /// <remarks> /// This API is used in SetRecordingData() and Stop(), when the STT engine sends the recognition result to the engine service user. /// This function is called in the following situations: 1) After Stop() is called, 2) The end point of speech is detected from recording, or 3) Partial result is occurred. /// The recognition result must be transferred to the engine service user through this function. Also, the timeInfo must be transferred to ForEachResultTime(). /// The type of timeInfo is up to the STT engine developer. /// </remarks> /// <param name="resultEvent">The result event.</param> /// <param name="type">The recognition type, "stt.recognition.type.FREE", or "stt.recognition.type.FREE.PARTIAL".</param> /// <param name="result">Result texts.</param> /// <param name="resultCount">Result text count.</param> /// <param name="msg">Engine message.</param> /// <param name="timeInfo">The time information.</param> /// <exception cref="UnauthorizedAccessException">Thrown in case of permission denied.</exception> /// <exception cref="NotSupportedException">Thrown in case of not supported.</exception> /// <exception cref="InvalidOperationException">Thrown in case of an operation failure.</exception> /// <precondition> /// The EngineMain function should be invoked before this function is called. Stop will invoke this function. /// </precondition> /// <postcondition> /// This function invokes ForEachResultTime /// </postcondition> /// <since_tizen> 4 </since_tizen> public void SendResult(ResultEvent resultEvent, string type, string[] result, int resultCount, ResultMessage msg, IntPtr timeInfo) { if ((result != null) && (result.Length != 0)) { string message = "stt.result.message.none"; switch (msg) { case ResultMessage.None: message = "stt.result.message.none"; break; case ResultMessage.TooFast: message = "stt.result.message.error.too.fast"; break; case ResultMessage.TooLong: message = "stt.result.message.error.too.long"; break; case ResultMessage.TooLoud: message = "stt.result.message.error.too.loud"; break; case ResultMessage.TooQuiet: message = "stt.result.message.error.too.quiet"; break; case ResultMessage.TooShort: message = "stt.result.message.error.too.short"; break; case ResultMessage.TooSoon: message = "stt.result.message.error.too.soon"; break; } Error error = STTESendResult(resultEvent, type, result, resultCount, message, timeInfo, IntPtr.Zero); if (error != Error.None) { Log.Error(LogTag, "STTESendResult Failed with error " + error); throw ExceptionFactory.CreateException((ErrorCode)error); } } else { throw new ArgumentNullException("result", "is null or empty"); } }
/// <summary> /// Gets the suite executable data by test case identifier. /// </summary> /// <param name="testQueueId">The test queue identifier.</param> /// <returns>GetTestQueueExecutableData object</returns> public ResultMessage <TestQueue_FullTestData> GetTestQueueExecutableData(long testQueueId) { var resultMessage = new ResultMessage <TestQueue_FullTestData>(); this.ExecutionSequence = 1; var testQueue = this.testQueueService.GetById(testQueueId); if (testQueue.Item != null) { bool isCancelled = false; if (testQueue.Item.SchedulerId.HasValue) { var schedulerHistory = this.schedulerHistoryService.GetByGroupName(testQueue.Item.GroupName); if (!schedulerHistory.IsError) { isCancelled = schedulerHistory.Item.IsCancelled; } } if (testQueue.Item.SuiteId.HasValue) { var testSuite = this.suiteService.GetById(testQueue.Item.SuiteId.Value); resultMessage.Messages.AddRange(testSuite.Messages); if (!resultMessage.IsError) { this.autoGenArray = new List <AutoGenModel>(); resultMessage.Item = new TestQueue_FullTestData { Suite = testSuite.Item, IsCancelled = isCancelled }; var testData = this.table.Find(x => x.TestId == testQueue.Item.TestId && !x.IsDeleted).OrderBy(x => x.ExecutionSequence).ToList(); var mapper = this.mapperFactory.GetMapper <TblTestData, TblTestDataDto>(); var testDataDto = testData.Select(mapper.Map).OrderBy(x => x.ExecutionSequence).ToList(); this.ProcessTestQueueExecutableData(testDataDto, testQueue.Item); var mapperExecutableTestData = this.mapperFactory.GetMapper <TblTestDataDto, ExecutableTestData>(); List <ExecutableTestData> exeTestData = this.testPlan.Select(mapperExecutableTestData.Map).OrderBy(x => x.ExecutionSequence).ToList(); resultMessage.Item.TestData = exeTestData; if (resultMessage.Item.TestData.Count > 0) { var webSiteData = testData[0].Test.Website; if (testQueue.Item.SchedulerId.HasValue) { var schedular = this.schedulerService.GetById(testQueue.Item.SchedulerId.Value); if (!schedular.IsError) { if (schedular.Item.Settings.TakeScreenShotOnUrlChangedTestId == testData[0].Test.Id) { resultMessage.Item.TakeScreenShot = true; ResultMessage <TblBrowsersDto> browser = this.browserService.GetById(schedular.Item.Settings.TakeScreenShotOnUrlChanged); resultMessage.Item.TakeScreenShotBrowser = browser.Item; } resultMessage.Item.UrlToTest = schedular.Item.Url; if (resultMessage.Item.UrlToTest.IsBlank()) { resultMessage.Item.UrlToTest = (schedular.Item.Settings.CustomUrlToTest + string.Empty) .Replace("{target}", schedular.Item.Settings.Target); } } } else { resultMessage.Item.UrlToTest = testQueue.Item.Settings.CustomUrlToTest; if (resultMessage.Item.UrlToTest.IsBlank() && webSiteData.Settings.BuildUrlTemplate.IsNotBlank()) { resultMessage.Item.UrlToTest = webSiteData.Settings.BuildUrlTemplate .Replace("{target}", testQueue.Item.Settings.Target) .Replace("{port}", testQueue.Item.Settings.Port + string.Empty); } } resultMessage.Item.TestCase = this.mapperFactory.GetMapper <TblTest, TblTestDto>().Map(testData[0].Test); resultMessage.Item.Website = this.mapperFactory.GetMapper <TblWebsite, TblWebsiteDto>().Map(webSiteData); } resultMessage.Item.TestData.ForEach(x => x.Value = this.IsAutoGenField(x.Value)); this.ResolveLocatorText(resultMessage.Item.TestData); } } else { var testData = this.table.Find(x => x.TestId == testQueue.Item.TestId && !x.IsDeleted).OrderBy(x => x.ExecutionSequence).ToList(); var mapper = this.mapperFactory.GetMapper <TblTestData, TblTestDataDto>(); var testDataDto = testData.Select(mapper.Map).OrderBy(x => x.ExecutionSequence).ToList(); this.ProcessTestQueueExecutableData(testDataDto, testQueue.Item); var mapperExecutableTestData = this.mapperFactory.GetMapper <TblTestDataDto, ExecutableTestData>(); this.autoGenArray = new List <AutoGenModel>(); List <ExecutableTestData> exeTestData = this.testPlan.Select(mapperExecutableTestData.Map).OrderBy(x => x.ExecutionSequence).ToList(); resultMessage.Item = new TestQueue_FullTestData { TestData = exeTestData }; if (testQueue.Item.Settings.TakeScreenShotOnUrlChanged > 0) { resultMessage.Item.TakeScreenShot = true; ResultMessage <TblBrowsersDto> browser = this.browserService.GetById(testQueue.Item.Settings.TakeScreenShotOnUrlChanged.Value); resultMessage.Item.TakeScreenShotBrowser = !browser.IsError ? browser.Item : null; } if (resultMessage.Item.TestData.Count > 0) { resultMessage.Item.TestCase = this.mapperFactory.GetMapper <TblTest, TblTestDto>().Map(testData[0].Test); resultMessage.Item.Website = this.mapperFactory.GetMapper <TblWebsite, TblWebsiteDto>().Map(testData[0].Test.Website); } resultMessage.Item.TestData.ForEach(x => x.Value = this.IsAutoGenField(x.Value)); resultMessage.Item.UrlToTest = testQueue.Item.Settings.CustomUrlToTest; this.ResolveLocatorText(resultMessage.Item.TestData); } if (resultMessage.Item != null && resultMessage.Item.Website != null && resultMessage.Item.UrlToTest.IsBlank()) { var urlData = resultMessage.Item.Website.WebsiteUrlList.FirstOrDefault(x => x.Id == testQueue.Item.Settings.UrlId); if (urlData != null) { resultMessage.Item.UrlToTest = urlData.Url; } } } return(resultMessage); }
public static ResultMessage HttpUploadFile(string url, string file, string paramName, string contentType, NameValueCollection nvc) { string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x"); byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n"); HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url); wr.ContentType = "multipart/form-data; boundary=" + boundary; wr.Method = "POST"; wr.KeepAlive = true; wr.Credentials = System.Net.CredentialCache.DefaultCredentials; Stream rs = wr.GetRequestStream(); string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}"; foreach (string key in nvc.Keys) { rs.Write(boundarybytes, 0, boundarybytes.Length); string formitem = string.Format(formdataTemplate, key, nvc[key]); byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem); rs.Write(formitembytes, 0, formitembytes.Length); } rs.Write(boundarybytes, 0, boundarybytes.Length); string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n"; string header = string.Format(headerTemplate, paramName, file, contentType); byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header); rs.Write(headerbytes, 0, headerbytes.Length); FileStream fileStream = new FileStream(file, FileMode.Open, FileAccess.Read); byte[] buffer = new byte[4096]; int bytesRead = 0; while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0) { rs.Write(buffer, 0, bytesRead); } fileStream.Close(); byte[] trailer = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n"); rs.Write(trailer, 0, trailer.Length); rs.Close(); ResultMessage result = new ResultMessage(); result.msg = "fail"; result.data = "Please try again later :)"; WebResponse wresp = null; try { wresp = wr.GetResponse(); Stream stream2 = wresp.GetResponseStream(); StreamReader reader2 = new StreamReader(stream2); String fromServer = reader2.ReadToEnd(); Console.WriteLine(string.Format("File uploaded, server response is: {0}", fromServer)); JsonReader r = new JsonReader(); result = r.Read(fromServer, System.Type.GetType("ResultMessage")) as ResultMessage; } catch (Exception ex) { Console.WriteLine("Error uploading file", ex); if (wresp != null) { wresp.Close(); wresp = null; } } finally { wr = null; } return result; }
public ActionResult MkPrftOLssBll(String barcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys, String rsns) { using (TransactionScope scop = new TransactionScope(TransactionScopeOption.Required, options)) { String[] barcode = barcodes.Split(','); String qu = barcode[0].Substring(0, 2); String savdptid = GetSavdptidByQu(qu); //正在生成拣货单,请稍候重试 string quRetrv = qu; if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) { return(RInfo("I0182")); } return(MakeNewBllNo(savdptid, qu, WMSConst.BLL_TYPE_PROFITORLOSS, (bllno) => { //检查并创建明细 JsonResult jr = (JsonResult)_MakeParam(bllno, barcodes, gdsids, gdstypes, bthnos, vlddats, qtys, rsns); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return rm; } //创建主表 wms_cangdtl_111[] dtls = (wms_cangdtl_111[])rm.ResultObject; wms_cang_111 mst = new wms_cang_111(); mst.wmsno = bllno; mst.bllid = WMSConst.BLL_TYPE_PROFITORLOSS; mst.savdptid = savdptid; mst.prvid = ""; //String qu = dtls[0].barcode.Substring(0,2) ; //GetQuByGdsid(dtls[0].gdsid, LoginInfo.DefStoreid); mst.qu = qu; mst.rcvdptid = ""; String symbol = "+"; //symbol="+"报溢,symbol="-"报损 if (dtls.Length > 0) { double?dqty = dtls[0].qty; symbol = dqty != null && dqty >= 0 ? "+" : "-"; } /*if (HasCkBll(qu, LoginInfo.Usrid, savdptid, symbol)) * { * return RRInfo("I0441"); * * }*/ mst.times = symbol; mst.lnkbocino = ""; mst.lnkbocidat = ""; mst.mkr = LoginInfo.Usrid; mst.mkedat = GetCurrentDay(); mst.mkedat2 = GetCurrentDate(); mst.ckr = ""; mst.chkflg = GetN(); mst.chkdat = ""; mst.opr = LoginInfo.Usrid; mst.brief = ""; mst.lnkbllid = ""; mst.lnkno = ""; mst.lnkbrief = ""; //如果是报损,判断是否有库存 foreach (wms_cangdtl_111 d in dtls) { if (mst.times.Trim() == "-") { if (d.brfdtl.Trim() == "") { return RRInfo("I0442", d.gdsid); } //得到一个商品的库存数量 GdsInBarcode[] gb = GetAGdsQtyInBarcode(d.barcode, d.gdsid, d.gdstype) .Where(e => e.vlddat == d.vlddat.Trim() && e.bthno == d.bthno.Trim()) .ToArray(); double bqty = (gb == null || gb.Length <= 0) ? 0 : gb[0].sqty; double ktqty = bqty; //可调数量 = 库存数量 //如果 需调整数量 > 可调数量 if (d.qty > ktqty) { return RRNoData("N0238", d.gdsid, d.barcode); } } } try { WmsDc.wms_cang_111.InsertOnSubmit(mst); WmsDc.SubmitChanges(); WmsDc.wms_cangdtl_111.InsertAllOnSubmit(dtls); WmsDc.SubmitChanges(); scop.Complete(); return RRSucc("成功", mst, "S0217"); } catch (Exception ex) { return RRErr(ex.Message, "E0064"); rm.ResultObject = null; return rm; } })); } }
private void OnVoidOverload_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) { voidOverloadResult = "Void Overload called"; Overload(101); }
private void OnIntOverload_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) { intOverloadResult = string.Format("Overload with return value called => {0}", result.ReturnValue.ToString()); }
private ActionResult _MakeParam(String wmsno, String oldbarcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys) { String[] oldbarcode = oldbarcodes.Split(','); String[] gdsid = gdsids.Split(','); String[] qty = qtys.Split(','); String[] gdstype = gdstypes.Split(','); String[] bthno = bthnos.Split(','); String[] vlddat = vlddats.Split(','); //String[] newsbarcode = newbarcodes.Split(','); List <wms_cangdtl_105> lstDtl = new List <wms_cangdtl_105>(); if ((oldbarcode.Length != gdsid.Length) && (oldbarcode.Length != qty.Length) && (oldbarcode.Length != gdstype.Length)) { return(RInfo("I0131")); } //检查盘点抄账单是否有单据 var qrycz = from e in WmsDc.wms_cang_105 where e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK && e.wmsno == wmsno && e.times == "2" select e; var arrqrycz = qrycz.ToArray(); if (arrqrycz.Length <= 0) { return(RNoData("N0087")); } //判断盘点是否结束,结束不允许制单 wms_cang_105 czmst = arrqrycz[0]; if (czmst.chkflg == GetY()) { return(RInfo("I0132")); } //盘点传来的参数是否有barcode的权限 String[] pwdBarcodes = GetBarcodesByBoci(czmst.lnkbocino); if (pwdBarcodes == null) { return(RInfo("I0133")); } var qryPdcang = from e in oldbarcode where pwdBarcodes.Contains(e.Trim()) select e; if (qryPdcang.Count() <= 0) { return(RNoData("N0088")); } //查询idx最大值 var qrymx = from e in WmsDc.wms_cangdtl_105 where e.bllid == WMSConst.BLL_TYPE_INVENTORY_CHECK && e.wmsno == wmsno orderby e.rcdidx descending select e; var arrqrymx = qrymx.ToArray(); int i = 0, ii = 0; if (arrqrymx.Length > 0) { i = arrqrymx[0].rcdidx; } foreach (String s in oldbarcode) { if (!String.IsNullOrEmpty(s)) { //判断分区是否有效 if (!IsExistBarcode(s)) { return(RInfo("I0134", s.Trim())); } wms_cangdtl_105 dtl = new wms_cangdtl_105(); dtl.wmsno = wmsno; dtl.bllid = WMSConst.BLL_TYPE_INVENTORY_CHECK; dtl.rcdidx = i + 1; dtl.barcode = s; dtl.gdsid = gdsid[ii]; dtl.gdstype = gdstype[ii]; dtl.pkgid = "01"; double fQty = 0; if (!double.TryParse(qty[ii], out fQty)) { return(RInfo("I0135", gdsid[i], qty[ii])); } dtl.qty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.preqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.pkgqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.gdstype = gdstype[ii]; dtl.bthno = string.IsNullOrEmpty(bthno[ii]) ? "1" : bthno[ii]; dtl.vlddat = string.IsNullOrEmpty(vlddat[ii]) ? GetCurrentDay() : vlddat[ii]; if (gdsid[ii] != "1") { JsonResult jr = (JsonResult)GetBcdByGdsid(gdsid[ii]); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(RInfo("I0136", gdsid[ii])); } bcd[] b = (bcd[])rm.ResultObject; dtl.bcd = b[0].bcd1; } else { dtl.bcd = ""; } dtl.bkr = ""; dtl.bokflg = GetN(); dtl.bokdat = GetCurrentDate(); lstDtl.Add(dtl); i++; ii++; } } return(RSucc("成功", lstDtl.ToArray(), "S0077")); }
public IResult Delete(Company entity) { entity.IsActive = false; companyDAL.Update(entity); return(new SuccessResult(ResultMessage <Company> .Delete(entity.CompanyName))); }
// Token: 0x060025FC RID: 9724 RVA: 0x000BB5C8 File Offset: 0x000B99C8 private void OnEcho_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) { this.typedEchoResult = "TypedDemoHub.Echo(string message) invoked!"; }
public ActionResult MkRetPrvBll(String prvid, String barcodes, String gdsids, String gdstypes, String qtys) { //检查并创建明细 JsonResult jr = (JsonResult)_MakeParam("", barcodes, gdsids, gdstypes, qtys); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(jr); } wms_cangdtl_110[] dtls1 = (wms_cangdtl_110[])rm.ResultObject; string qu = dtls1[0].barcode.Substring(0, 2); return(MakeNewBllNo(LoginInfo.DefCsSavdptid, qu, WMSConst.BLL_TYPE_RETPRV, (bllno) => { //检查并创建明细 jr = (JsonResult)_MakeParam(bllno, barcodes, gdsids, gdstypes, qtys); rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return rm; } //判断供应商编号是否正确 var qryprv = from e in WmsDc.prv where e.prvid == prvid select e; var arrqryprv = qryprv.ToArray(); if (arrqryprv.Length <= 0) { rm.ResultObject = null; return RRNoData("N0241"); } //创建主表 wms_cangdtl_110[] dtls = (wms_cangdtl_110[])rm.ResultObject; wms_cang_110 mst = new wms_cang_110(); mst.wmsno = bllno; mst.bllid = WMSConst.BLL_TYPE_RETPRV; mst.savdptid = LoginInfo.DefCsSavdptid; mst.prvid = prvid; mst.qu = dtls[0].barcode.Substring(0, 2); ////正在生成拣货单,请稍候重试 //string quRetrv = mst.qu; //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) //{ // return RRInfo( "I0335" ); //} mst.rcvdptid = ""; mst.times = "1"; mst.lnkbocino = ""; mst.lnkbocidat = ""; mst.mkr = LoginInfo.Usrid; mst.mkedat = GetCurrentDay(); mst.mkedat2 = GetCurrentDate(); mst.ckr = ""; mst.chkflg = GetN(); mst.chkdat = ""; mst.opr = LoginInfo.Usrid; mst.brief = ""; mst.lnkbllid = ""; mst.lnkno = ""; mst.lnkbrief = ""; //如果是报损,判断是否有库存 foreach (wms_cangdtl_110 d in dtls) { //得到一个商品的库存数量 GdsInBarcode[] gb = GetAGdsQtyInBarcode(d.barcode, d.gdsid, d.gdstype); double bqty = (gb == null || gb.Length <= 0) ? 0 : gb[0].sqty; double ktqty = bqty; //可调数量 = 库存数量 //如果 需调整数量 > 可调数量 if (d.qty > ktqty) { return RRNoData("N0242", d.qty.ToString(), ktqty.ToString()); } } WmsDc.wms_cang_110.InsertOnSubmit(mst); WmsDc.wms_cangdtl_110.InsertAllOnSubmit(dtls); try { WmsDc.SubmitChanges(); return RRSucc("成功", mst, "S0221"); } catch (Exception ex) { return RRErr(ex.Message, "E0069"); rm.ResultObject = null; return rm; } })); }
/// <summary> /// Called, when the button Abort is pressed. /// </summary> protected void ButtonAbortPressed() { this.resultMessage = ResultMessage.ButtonAbort; }
private ActionResult _MakeParam(String wmsno, String oldbarcodes, String gdsids, String gdstypes, String qtys) { if (gdsids == null) { return(RInfo("I0324")); } if (qtys == null) { return(RInfo("I0325")); } if (gdstypes == null) { return(RInfo("I0326")); } if (oldbarcodes == null) { return(RInfo("I0327")); } String[] oldbarcode = oldbarcodes.Split(','); String[] gdsid = gdsids.Split(','); String[] qty = qtys.Split(','); String[] gdstype = gdstypes.Split(','); //String[] newsbarcode = newbarcodes.Split(','); List <wms_cangdtl_110> lstDtl = new List <wms_cangdtl_110>(); if ((oldbarcode.Length != gdsid.Length) && (oldbarcode.Length != qty.Length) && (oldbarcode.Length != gdstype.Length)) { return(RInfo("I0328")); } int i = 0; foreach (String s in oldbarcode) { if (!String.IsNullOrEmpty(s)) { //判断分区是否有效 if (!IsExistBarcode(s)) { return(RInfo("I0329", s.Trim())); } //判断gdsid和barcode是不是在一个区 String[] qu = GetQuByGdsid(gdsid[i], LoginInfo.DefStoreid); if (qu == null) { return(RInfo("I0330")); //return RInfo("商品" + gdsid[i] + "不在区[" + String.Join(",", s.Substring(0, 2)) + "]内", "I0331"); } if (!qu.Contains(s.Substring(0, 2))) { return(RInfo("I0332", gdsid[i], String.Join(",", qu))); } wms_cangdtl_110 dtl = new wms_cangdtl_110(); dtl.wmsno = wmsno; dtl.bllid = WMSConst.BLL_TYPE_RETPRV; dtl.rcdidx = i + 1; dtl.barcode = s; dtl.gdsid = gdsid[i]; dtl.gdstype = gdstype[i]; dtl.pkgid = "01"; double fQty = 0; if (!double.TryParse(qty[i], out fQty)) { return(RInfo("I0333", gdsid[i], qty[i])); } dtl.qty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.preqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.pkgqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.bthno = ""; dtl.vlddat = ""; JsonResult jr = (JsonResult)GetBcdByGdsid(gdsid[i]); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(RInfo("I0334", gdsid[i])); } bcd[] b = (bcd[])rm.ResultObject; dtl.bcd = b[0].bcd1; dtl.bkr = ""; dtl.bokflg = GetN(); dtl.bokdat = ""; lstDtl.Add(dtl); i++; } } return(RSucc("成功", lstDtl.ToArray(), "S0148")); }
/// <summary> /// Called, when the button Ignore is pressed. /// </summary> protected void ButtonIgnorePressed() { this.resultMessage = ResultMessage.ButtonIgnore; }
public ActionResult AdRetPrv(String wmsno, String barcode, String gdsid, String gdstype, double qty) { //判断分区是否有效 if (!IsExistBarcode(barcode)) { return(RInfo("I0351", barcode.Trim())); } //检查单号是否存在 var qrymst = from e in WmsDc.wms_cang_110 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_RETPRV select e; var arrqrymst = qrymst.ToArray(); var qrydtl = from e in WmsDc.wms_cangdtl_110 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_RETPRV orderby e.rcdidx descending select e; var arrqrydtl = qrydtl.ToArray(); //单据是否找到 if (arrqrymst.Length <= 0) { return(RNoData("N0163")); } //检查是否有数据权限 wms_cang_110 mst = arrqrymst[0]; ////正在生成拣货单,请稍候重试 //string quRetrv = mst.qu; //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) //{ // return RInfo( "I0352" ); //} if (!qus.Contains(mst.qu.Trim())) { return(RInfo("I0353")); } //检查单号是否已经审核 if (mst.chkflg == GetY()) { return(RInfo("I0354")); } //判断gdsid和barcode是不是在一个区 String[] qu = GetQuByGdsid(gdsid, LoginInfo.DefStoreid); if (!qu.Contains(barcode.Substring(0, 2))) { return(RInfo("I0355", gdsid, String.Join(",", qu))); } //如果是报损,判断是否有库存 if (!HasQtyInBarcode(barcode, gdsid, gdstype)) { return(RInfo("I0356", gdsid, barcode)); } if (mst.times.Trim() == "-") { //如果是报损,判断是否有库存 //得到一个商品的库存数量 GdsInBarcode[] gb = GetAGdsQtyInBarcode(barcode, gdsid, gdstype); double bqty = (gb == null || gb.Length <= 0) ? 0 : gb[0].sqty; double ktqty = bqty; //可调数量 = 库存数量+本单该商品的数量 //如果 需调整数量 > 可调数量 if (qty > ktqty) { return(RInfo("I0357", qty, ktqty)); } } //判断商品是否已经再单据里面 int iHasIn = arrqrydtl.Where(e => e.gdsid == gdsid && e.gdstype == gdstype && e.barcode == barcode).Count(); if (iHasIn > 0) { return(RInfo("I0358", gdsid)); } wms_cangdtl_110 dtl = new wms_cangdtl_110(); dtl.wmsno = wmsno; dtl.bllid = WMSConst.BLL_TYPE_RETPRV; dtl.rcdidx = arrqrydtl[0].rcdidx + 1; dtl.barcode = barcode; dtl.gdsid = gdsid; dtl.gdstype = gdstype; dtl.pkgid = "01"; double fQty = qty; dtl.qty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.preqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.pkgqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.gdstype = gdstype; dtl.bthno = ""; dtl.vlddat = ""; JsonResult jr = (JsonResult)GetBcdByGdsid(gdsid); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(RInfo("I0359", gdsid)); } bcd[] b = (bcd[])rm.ResultObject; dtl.bcd = b[0].bcd1; dtl.bkr = ""; dtl.bokflg = GetN(); dtl.bokdat = ""; WmsDc.wms_cangdtl_110.InsertOnSubmit(dtl); try { WmsDc.SubmitChanges(); return(RSucc("成功", dtl, "S0154")); } catch (Exception ex) { return(RErr(ex.Message, "E0047")); } }
/// <summary> /// Called, when the button Retry is pressed. /// </summary> protected void ButtonRetryPressed() { this.resultMessage = ResultMessage.ButtonRetry; }
public ActionResult MdRetPrvBll(String wmsno, String barcodes, String gdsids, String gdstypes, String qtys) { //拆分参数 //检查并创建明细 JsonResult jr = (JsonResult)_MakeParam(wmsno, barcodes, gdsids, gdstypes, qtys); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(jr); } //检查单号是否存在 var qrymst = from e in WmsDc.wms_cang_110 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_RETPRV select e; var arrqrymst = qrymst.ToArray(); var qrydtl = from e in WmsDc.wms_cangdtl_110 where e.wmsno == wmsno && e.bllid == WMSConst.BLL_TYPE_RETPRV select e; var arrqrydtl = qrydtl.ToArray(); //单据是否找到 if (arrqrymst.Length <= 0) { return(RNoData("N0164")); } //检查是否有数据权限 wms_cang_110 mst = arrqrymst[0]; ////正在生成拣货单,请稍候重试 //string quRetrv = mst.qu; //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) //{ // return RInfo( "I0360" ); //} if (!qus.Contains(mst.qu.Trim())) { return(RInfo("I0361")); } //检查单号是否已经审核 if (mst.chkflg == GetY()) { return(RInfo("I0362")); } //是否是同一个人制单 if (!IsSameLogin(mst.mkr)) { return(RInfo("I0363", mst.mkr, LoginInfo.Usrid)); } wms_cangdtl_110[] newdtl = (wms_cangdtl_110[])rm.ResultObject; if (mst.times.Trim() == "-") { int i = 0; //如果是报损,判断是否有库存 foreach (wms_cangdtl_110 d in newdtl) { //得到一个商品的库存数量 GdsInBarcode[] gb = GetAGdsQtyInBarcode(arrqrydtl[i].barcode, arrqrydtl[i].gdsid, arrqrydtl[i].gdstype); double bqty = (gb == null || gb.Length <= 0) ? 0 : gb[0].sqty; double ktqty = bqty + arrqrydtl[i].qty; //可调数量 = 库存数量+本单该商品的数量 //如果 需调整数量 > 可调数量 if (d.qty > ktqty) { return(RInfo("I0364", d.qty, ktqty)); } i++; } } //删除单据明细 WmsDc.wms_cangdtl_110.DeleteAllOnSubmit(arrqrydtl); iDelCangDtl110(arrqrydtl, mst); //增加单据明细 WmsDc.wms_cangdtl_110.InsertAllOnSubmit(newdtl); try { WmsDc.SubmitChanges(); return(RSucc("成功", newdtl, "S0155")); } catch (Exception ex) { return(RErr(ex.Message, "E0048")); } }
public IResult Delete(Comment entity) { entity.IsActive = false; commentDAL.Update(entity); return(new SuccessResult(ResultMessage <Comment> .Delete(entity.CommentText))); }
private void OnDeviceConnected(ResultMessage <IDevice> obj) { DeviceName = obj.Data.Name; OnPropertyChanged("DeviceName"); }
/// <summary> /// calls while authorizing the user /// </summary> /// <param name="filterContext">The filter context</param> /// <returns>returns the Authorization status</returns> protected override bool IsAuthorized(HttpActionContext filterContext) { if (base.IsAuthorized(filterContext)) { var principal = filterContext.RequestContext.Principal as ClaimsPrincipal; string userRole = principal.FindFirst("role").Value; if (userRole == FrameworkRoles.TestAdmin.ToString() || userRole == FrameworkRoles.WindowService.ToString()) { return(true); } if (userRole == FrameworkRoles.TestUser.ToString()) { var controller = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; if (controller.ToLower() == "website" && this.ActionType == ActionTypes.Read) { return(true); } if (controller.ToLower() == "userprofile") { return(true); } long userId = long.Parse(principal.FindFirst(ClaimTypes.NameIdentifier).Value); var moduleAccessService = StructuremapMvc.StructureMapDependencyScope.Container.GetInstance <IGroupModuleAccessService>(); var testService = StructuremapMvc.StructureMapDependencyScope.Container.GetInstance <ITestService>(); ResultMessage <IEnumerable <ModuleAuthenticationModel> > authenticatedModules = moduleAccessService.GetModuleAuthenticatedToUser(userId); List <ModuleAuthenticationModel> modules = authenticatedModules.Item.ToList(); if (modules.Any()) { object website_Id; object test_Id; filterContext.RequestContext.RouteData.Values.TryGetValue("websiteId", out website_Id); filterContext.RequestContext.RouteData.Values.TryGetValue("testId", out test_Id); if (website_Id != null) { int websiteId = website_Id.ToString().ToInt32(); int testId = 0; if (test_Id != null) { testId = test_Id.ToString().ToInt32(); } if (websiteId > 0) { switch (this.ActionType) { case ActionTypes.Read: { if (testId > 0) { var test = testService.GetById(testId).Item; return(modules.Any(x => x.WebsiteId == websiteId) && (test.TestCaseAccessStatus != (int)TestCaseAccessStatus.Private || test.CreatedBy == userId)); } else { return(modules.Any(x => x.WebsiteId == websiteId)); } } case ActionTypes.Write: { if (testId > 0) { var test = testService.GetById(testId).Item; return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanWrite) && (test.TestCaseAccessStatus == (int)TestCaseAccessStatus.Public || test.CreatedBy == userId)); } else { return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanWrite)); } } case ActionTypes.Execute: { if (testId > 0) { var test = testService.GetById(testId, userId).Item; return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanExecute) && (test.TestCaseAccessStatus == (int)TestCaseAccessStatus.Public || test.CreatedBy == userId)); } else { return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanExecute)); } } case ActionTypes.Delete: { if (testId > 0) { var test = testService.GetById(testId, userId).Item; return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanDelete) && (test.TestCaseAccessStatus == (int)TestCaseAccessStatus.Public || test.CreatedBy == userId)); } else { return(modules.Any(x => x.ModuleId == this.ModuleType && x.WebsiteId == websiteId && x.CanDelete)); } } } } } } } } return(false); }
public ActionResult MkInvCkBll(String boci, String qu) { String savdptid = GetSavdptidByQu(qu); ////正在生成拣货单,请稍候重试 //string quRetrv = qu; //if (DoingRetrieve(LoginInfo.DefStoreid, quRetrv)) //{ // return RInfo( "I0137" ); //} //盘点区在不在设置区内 if (!IsInSetQu(boci, qu)) { return(RInfo("I0138")); } return(MakeNewBllNo(savdptid, qu, WMSConst.BLL_TYPE_INVENTORY_CHECK, (bllno) => { //检查并创建明细 /*JsonResult jr = (JsonResult)_MakeParam(bllno, barcodes, gdsids, gdstypes, qtys); * ResultMessage rm = (ResultMessage)jr.Data; * if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) * { * return rm; * } * wms_cangdtl_105[] dtls = (wms_cangdtl_105[])rm.ResultObject;*/ ResultMessage rm = new ResultMessage(); wms_cang_105 mst = new wms_cang_105(); //创建主表 mst.wmsno = bllno; mst.bllid = WMSConst.BLL_TYPE_INVENTORY_CHECK; mst.savdptid = savdptid; mst.prvid = ""; //String qu = GetQuByGdsid(dtls[0].gdsid, LoginInfo.DefSavdptid); mst.qu = qu; mst.rcvdptid = ""; mst.times = "2"; mst.lnkbocino = boci; mst.lnkbocidat = ""; mst.mkr = LoginInfo.Usrid; mst.mkedat = GetCurrentDay(); mst.mkedat2 = GetCurrentDate(); mst.ckr = ""; mst.chkflg = GetN(); mst.chkdat = ""; mst.opr = LoginInfo.Usrid; mst.brief = ""; mst.lnkbllid = ""; mst.lnkno = ""; mst.lnkbrief = ""; if (HasCkBll(boci, qu, LoginInfo.Usrid)) { return RRInfo("I0440", boci, qu); } WmsDc.wms_cang_105.InsertOnSubmit(mst); //WmsDc.wms_cangdtl_105.InsertAllOnSubmit(dtls); try { WmsDc.SubmitChanges(); return RRSucc("成功", mst, "S0216"); } catch (Exception ex) { return RRErr(ex.Message, "E0063"); } })); }
private ActionResult _MakeParam(String wmsno, String oldbarcodes, String gdsids, String gdstypes, String bthnos, String vlddats, String qtys, String rsns) { String[] oldbarcode = oldbarcodes.Split(','); String[] gdsid = gdsids.Split(','); String[] qty = qtys.Split(','); String[] gdstype = gdstypes.Split(','); String[] vlddat = vlddats.Split(','); String[] bthno = bthnos.Split(','); String[] rsn = rsns.Split(','); //String[] newsbarcode = newbarcodes.Split(','); List <wms_cangdtl_111> lstDtl = new List <wms_cangdtl_111>(); if ((oldbarcode.Length != gdsid.Length) && (oldbarcode.Length != qty.Length) && (oldbarcode.Length != gdstype.Length) && (oldbarcode.Length != rsn.Length)) { return(RInfo("I0173")); } int i = 0; foreach (String s in oldbarcode) { if (!String.IsNullOrEmpty(s)) { //判断gdsid和barcode是不是在一个区 String[] qu = GetQuByGdsid(gdsid[i], LoginInfo.DefStoreid); if (qu == null) { return(RInfo("I0174")); } if (!qu.Contains(s.Substring(0, 2))) { return(RInfo("I0176", gdsid[i], String.Join(",", qu))); } //判断分区是否有效 if (!IsExistBarcode(s)) { return(RInfo("I0177", s.Trim())); } wms_cangdtl_111 dtl = new wms_cangdtl_111(); dtl.wmsno = wmsno; dtl.bllid = WMSConst.BLL_TYPE_PROFITORLOSS; dtl.rcdidx = i + 1; dtl.barcode = s; //判断分区是否有效 if (!IsExistBarcode(dtl.barcode)) { return(RInfo("I0178", s.Trim())); } dtl.gdsid = gdsid[i]; dtl.gdstype = gdstype[i]; dtl.pkgid = "01"; double fQty = 0; if (!double.TryParse(qty[i], out fQty)) { return(RInfo("I0179", gdsid[i], qty[i])); } dtl.qty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.preqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.pkgqty = Math.Round(fQty, 4, MidpointRounding.AwayFromZero); dtl.gdstype = gdstype[i]; dtl.bthno = String.IsNullOrEmpty(bthno[i]) ? "1" : bthno[i]; dtl.vlddat = String.IsNullOrEmpty(vlddat[i]) ? GetCurrentDay() : vlddat[i]; JsonResult jr = (JsonResult)GetBcdByGdsid(gdsid[i]); ResultMessage rm = (ResultMessage)jr.Data; if (rm.ResultCode != ResultMessage.RESULTMESSAGE_SUCCESS) { return(RInfo("I0180", gdsid[i])); } bcd[] b = (bcd[])rm.ResultObject; dtl.bcd = b[0].bcd1; dtl.bkr = ""; dtl.bokflg = GetN(); dtl.bokdat = GetCurrentDate(); dtl.brfdtl = rsn[i]; lstDtl.Add(dtl); i++; } } return(RSucc("成功", lstDtl.ToArray(), "S0096")); }
private void OnInvoked(Hub hub, ClientMessage originalMessage, ResultMessage result) { Debug.Log(hub.Name + " invokedFromClient success!"); }