Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        private void SLDcjms_SaveDataSetCompleted(object sender, SaveDataSetCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    //check result status
                    if (SLDcjms.CurrentTable.Rows.Count <= 0)
                    {
                        //nothing happen or just delete rows
                    }
                    else
                    {
                        string RowStatus    = SLDcjms.GetCurrentPropertyValueOfString("Stat");
                        string ErrorMessage = SLDcjms.GetCurrentPropertyValueOfString("ErrorMessage");

                        if ((RowStatus != "E") || string.IsNullOrEmpty(ErrorMessage))
                        {
                            if (CSISystemContext.ForceAutoPost)
                            {
                                //Ready to Post -- calling DcjrPSp
                                ShowProgressBar(true);
                                string strParmeters = "";
                                strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, SLDcjms.GetCurrentPropertyValueOfString("TransNum"));
                                strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, "");
                                strParmeters = CSIBaseInvoker.BuildXMLParameters(strParmeters, "", true);
                                SLDcjms.InvokeMethod("DcjrPSp", strParmeters);
                            }
                            else
                            {
                                if (CSISystemContext.ShowSuccessMessage)
                                {
                                    ShowProcessedMessage();
                                }
                                //Clear Result if no error.
                                Initialize();
                            }
                        }
                        else
                        {
                            //delete first before prompt message.
                            SLDcjms.CurrentTable.Rows[0].Delete();
                            ShowProgressBar(true);
                            SLDcjms.DeleteIDO();

                            //Populate Error
                            FragmentTransaction ft           = FragmentManager.BeginTransaction();
                            CSIMessageDialog    DeleteDialog = (CSIMessageDialog)FragmentManager.FindFragmentByTag("DeleteDialog");

                            if (DeleteDialog != null)
                            {
                                ft.Show(DeleteDialog);
                            }
                            else
                            {
                                DeleteDialog = new CSIMessageDialog(GetString(Resource.String.app_name), ErrorMessage, DialogTypes.OK);
                                DeleteDialog.Show(ft, "DeleteDialog");
                            }
                        }
                    }
                }
                else
                {
                    WriteErrorLog(e.Error);
                }
            }catch (Exception Ex)
            {
                WriteErrorLog(Ex);
            }
            ShowProgressBar(false);
        }