示例#1
0
        private void OnCreateSessionTokenCompleted(object sender, CreateSessionTokenCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                CSISystemContext.Token         = e.Result;
                CSISystemContext.SavedUser     = UserEdit.Text;
                CSISystemContext.SavedPassword = PasswordEdit.Text;
                CSISystemContext.SaveUser      = SaveUserSwitch.Checked;
                CSISystemContext.SavePassword  = SavePasswordSwitch.Checked;
                CSISystemContext.Configuration = (string)ConfigurationEdit.SelectedItem;
                CSISystemContext.WriteConfigurations();

                if (!string.IsNullOrEmpty(CSISystemContext.Token))
                {
                    GetParmInfor();
                }
            }
            else
            {
                WriteErrorLog(e.Error);
                ErrorText.Text       = CSIBaseInvoker.TranslateError(e.Error);
                ErrorText.Visibility = ViewStates.Visible;
            }
            ShowProgressBar(false);
        }
示例#2
0
        private void OnLoadDataSetCompleted(object sender, LoadDataSetCompletedEventArgs e)
        {
            try
            {
                if (e.Error == null)
                {
                    if (sender.GetType() == Users.GetType())
                    {
                        CSISystemContext.User     = Users.GetCurrentPropertyValueOfString("Username");
                        CSISystemContext.UserDesc = Users.GetCurrentPropertyValueOfString("UserDesc");
                        GetUserLocalInfor();
                    }
                    if (sender.GetType() == UsersLocal.GetType())
                    {
                        CSISystemContext.DefaultWarehouse = UsersLocal.GetCurrentPropertyValueOfString("Whse");
                        if (string.IsNullOrEmpty(CSISystemContext.DefaultWarehouse))
                        {
                            CSISystemContext.DefaultWarehouse = "MAIN";
                        }
                        GetEmpInfor();
                    }
                    if (sender.GetType() == Employee.GetType())
                    {
                        CSISystemContext.EmpNum  = Employee.GetCurrentPropertyValueOfString("EmpNum");
                        CSISystemContext.EmpName = Employee.GetCurrentPropertyValueOfString("Name");
                    }

                    ShowProgressBar(false);

                    if (ProgressBar.Visibility == ViewStates.Invisible)
                    {
                        ErrorText.Visibility = ViewStates.Invisible;
                        Dismiss();
                        Dispose();
                    }
                }
                else
                {
                    ShowProgressBar(false);
                    WriteErrorLog(e.Error);
                    CSISystemContext.Token = "";
                    ErrorText.Text         = CSIBaseInvoker.TranslateError(e.Error);
                    ErrorText.Visibility   = ViewStates.Visible;
                }
            }catch (Exception Ex)
            {
                ShowProgressBar(false);
                WriteErrorLog(Ex);
                WriteErrorLog(e.Error);
                CSISystemContext.Token = "";
                ErrorText.Text         = CSIBaseInvoker.TranslateError(e.Error);
                ErrorText.Visibility   = ViewStates.Visible;
            }
        }
示例#3
0
 private void Parmse_LoadDataSetCompleted(object sender, LoadDataSetCompletedEventArgs e)
 {
     try
     {
         CSISystemContext.Site = Parms.GetCurrentPropertyValueOfString("Site");
         GetUserInfor();
         ShowProgressBar(false);
     }
     catch (Exception Ex)
     {
         ShowProgressBar(false);
         WriteErrorLog(Ex);
         WriteErrorLog(e.Error);
         CSISystemContext.Token = "";
         ErrorText.Text         = CSIBaseInvoker.TranslateError(e.Error);
         ErrorText.Visibility   = ViewStates.Visible;
     }
 }