public static bool GetNextLotSp(CSIContext SrcContext, string Item, string Prefix, ref string Message, ref string Key, string Site = "") { try { CSIItems item = new CSIItems(SrcContext); item.UseAsync(false); string strParmeters = ""; strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, Item); strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, Prefix); strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, Message, true); strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, Key, true); bool rtn = item.InvokeMethod("FetchNextLotSp", ref strParmeters); if (rtn) { Message = CSIBaseInvoker.GetXMLParameters(strParmeters, 2); Key = CSIBaseInvoker.GetXMLParameters(strParmeters, 3); return(true); } else { return(false); } } catch (Exception Ex) { WriteErrorLog(Ex); return(false); } }
private void SLDcjms_CallMethodCompleted(object sender, CallMethodCompletedEventArgs e) { try { //throw new NotImplementedException(); if (e.Error == null) { if (e.Result.ToString() == "0") { if (CSISystemContext.ShowSuccessMessage) { ShowProcessedMessage(); } Initialize(); } else { //get error - delete first. SLDcjms.CurrentTable.Rows[0].Delete(); ShowProgressBar(true); SLDcjms.DeleteIDO(); WriteErrorLog(new Exception(CSIBaseInvoker.GetXMLParameters(e.strMethodParameters, 1))); } } else { //try to delete post SLDcjms.CurrentTable.Rows[0].Delete(); ShowProgressBar(true); SLDcjms.DeleteIDO(); WriteErrorLog(e.Error); } } catch (Exception Ex) { WriteErrorLog(Ex); } ShowProgressBar(false); }