/// <summary>
        /// Returns true if InputAuthLogin instances are equal
        /// </summary>
        /// <param name="other">Instance of InputAuthLogin to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InputAuthLogin other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     RefreshToken == other.RefreshToken ||
                     RefreshToken != null &&
                     RefreshToken.Equals(other.RefreshToken)
                     ) &&
                 (
                     RememberMe == other.RememberMe ||
                     RememberMe != null &&
                     RememberMe.Equals(other.RememberMe)
                 ) &&
                 (
                     ClientData == other.ClientData ||
                     ClientData != null &&
                     ClientData.Equals(other.ClientData)
                 ));
        }
Ejemplo n.º 2
0
 internal void LoginIntoAccount(string email, string password)
 {
     Email.SendKeys(email);
     Password.SendKeys(password);
     RememberMe.Click();
     SignIn.Click();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 节点岗位发生变化,删除该节点记忆的接收人员。
        /// </summary>
        /// <returns></returns>
        protected override bool beforeInsert()
        {
            RememberMe remeberMe = new RememberMe();

            remeberMe.Delete(RememberMeAttr.FK_Node, this.FK_Node);
            return(base.beforeInsert());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Конструктор, ограничивающий создание объекта из других классов
        /// </summary>
        private AppData()
        {
            appDataLock = new object();

            inited        = false;
            cultureName   = Localization.Culture.Name;
            viewStampCntr = 0;

            scadaDataDictUpdater = null;
            scadaWebDictUpdater  = null;
            webSettingsUpdater   = null;
            viewSettingsUpdater  = null;
            viewSettingsBaseAge  = DateTime.MinValue;

            WebSettings  = new WebSettings();
            ViewSettings = new ViewSettings();
            PluginSpecs  = new List <PluginSpec>();
            UiObjSpecs   = new Dictionary <string, UiObjSpec>();
            AppDirs      = new AppDirs();
            Log          = new Log(Log.Formats.Full);
            Storage      = new Storage(AppDirs.StorageDir);
            RememberMe   = new RememberMe(Storage, Log);
            Stats        = new Stats(Storage, Log);
            UserMonitor  = new UserMonitor(Log);

            CreateDataObjects();
        }
Ejemplo n.º 5
0
 public DashBoardViewModel(INavigationService navigationService) : base(navigationService)
 {
     try
     {
         _navigationService = navigationService;
         webServiceManager  = new WebServiceManager();
         Title        = "Inspections";
         LoginCommand = new Command(async() => ExecuteLogoutCommandAsync());
         UserRoleId   = Convert.ToInt32(RememberMe.Get("UserRoleId"));
         //Xamarin.Forms.Device.BeginInvokeOnMainThread(async () =>
         //{
         //  await Task.Delay(1000);
         //  bool IsSyncDatabse = (Boolean)RememberMe.Get("isSyncDatabse", true);
         //  if (IsSyncDatabse && ConfigurationCommon.App_Online)
         //  {
         //    InitData.SyncHeaderDetailsInServer();
         //    RememberMe.Set("isSyncDatabse", false);
         //    await Xamarin.Forms.Application.Current.SavePropertiesAsync();
         //  }
         //  InitData.GetAllInitData();
         //});
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
    void Awake()
    {
        RememberMe.Clear();
        Screen.SetResolution(1280, 720, false, 60);

        foreach (var sessionData in _mockSessionData)
        {
            GameContext.Instance.Player.SessionStorage.Store(sessionData.Key, sessionData.Value);
        }
    }
Ejemplo n.º 7
0
 public string Encode()
 {
     return("{0}={1}&{2}={3}&{4}={5}".FormatWith(
                CoreConstants.Authentication.RememberMe,
                RememberMe.ToString().ToLowerInvariant(),
                CoreConstants.Authentication.Email,
                HttpUtility.UrlEncode(Email),
                CoreConstants.Authentication.HasUserProfile,
                HasUserProfile.ToString().ToLowerInvariant()));
 }
        public HomePageObject FillLoginForm(string email, string password)
        {
            SignInButton.Click();             // Anasayfadaki giriş yap butonuna tıklar.
            EmailInput.SendKeys(email);       // Kullanıcı girişi formunda email'i doldurur.
            PasswordInput.SendKeys(password); // Kullanıcı girişi formunda parolayı doldurur.
            RememberMe.Click();               // Kullanıcının daha sonradan hatırlanması için beni hatırla butonuna tıklar.
            LogInButton.Click();              // Siteye üye girişi yapılması için giriş yap butonuna tıklar.

            return(new HomePageObject());     // Kullanıcıyı anasayfaya geri döndürür.
        }
 void Start()
 {
     badWords     = new string[] { "shit", "c**t", "c**k", "f**k", "asshole", "bitch", "hell", "nigger", "bastard", "f****t", "suck", "dick", "crap", "rape", "rapist", "pussy" };
     startLoading = true;
     loadTimer    = 0f;
     if (Application.loadedLevel == 6 && GameObject.FindWithTag("GLOBALTIMER") != null && GameObject.FindWithTag("REMEMBERME") != null)
     {
         globalTimer  = GameObject.FindWithTag("GLOBALTIMER").GetComponent <GLOBALTIMER>();
         rememberMe   = GameObject.FindWithTag("REMEMBERME").GetComponent <RememberMe>();
         roundedScore = Mathf.Round(globalTimer.globalTimer * 1000f) / 1000f;
     }
 }
Ejemplo n.º 10
0
 private async void ExecuteLogoutCommandAsync()
 {
     try
     {
         //await _navigationService.NavigateAsync("/LoginPage");
         //await _navigationService.NavigateAsync("NavigationPage/LoginPage");
         RememberMe.Set("isDatabaseUpdate", false);
         var status = await _navigationService.GoBackAsync();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 11
0
        public override void OnNavigatedTo(INavigationParameters parameters)
        {
            bool IsSyncDatabse = (Boolean)RememberMe.Get("isSyncDatabse", true);

            //if (ConfigurationCommon.App_Online)
            //{
            Xamarin.Forms.Device.BeginInvokeOnMainThread(async() =>
            {
                await Task.Delay(1000);
                if (IsSyncDatabse && ConfigurationCommon.App_Online)
                {
                    InitData.SyncHeaderDetailsInServer();
                    RememberMe.Set("isSyncDatabse", false);
                    await Xamarin.Forms.Application.Current.SavePropertiesAsync();
                }
                InitData.GetAllInitData();
            });
            //}
        }
Ejemplo n.º 12
0
        public void SaveSettings()
        {
            StreamWriter  SW = new StreamWriter(Globals.Files + "Settings.ini");
            StringBuilder SB = new StringBuilder();

            SB.AppendLine("GameDirectory:" + Globals.GameDirectory);
            SB.AppendLine("LauncherRunPath:" + AppDomain.CurrentDomain.BaseDirectory);
            SB.AppendLine("PlayerTag:" + PlayerTag);
            SB.AppendLine("DisplayMode:" + DisplayMode.ToString());
            SB.AppendLine("GameSound:" + GameSound.ToString());
            SB.AppendLine("VerticalSync:" + VerticalSync.ToString());
            SB.AppendLine("DefaultDisplay:" + DefaultDisplay.ToString());
            SB.AppendLine("RememberMe:" + RememberMe.ToString());
            SB.AppendLine("PlayerLoginToken:" + Encrypt.EncryptStringAES(PlayerLoginToken));
            SW.Write(SB.ToString());
            SW.Flush();
            SW.Close();
            SW.Dispose();
        }
Ejemplo n.º 13
0
        public void ClickOnRememberMe()
        {
            if (RememberMe.Displayed)
            {
                IJavaScriptExecutor js         = (IJavaScriptExecutor)driver;
                IWebElement         hiddenLink = driver.FindElement(_chkBoxRememberMe);
                String script = "arguments[0].click();";
                js.ExecuteScript(script, hiddenLink);

                WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(50));
                wait.Until(ExpectedConditions.ElementToBeClickable(_chkBoxRememberMe));
                //RememberMe.Clear();
                RememberMe.Click();
            }
            else
            {
                throw new Exception("Element is not found or not clickable");
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Конструктор, ограничивающий создание объекта из других классов
        /// </summary>
        private AppData()
        {
            appDataLock = new object();

            inited        = false;
            commSettings  = new CommSettings();
            viewStampCntr = 0;

            WebSettings  = new WebSettings();
            ViewSettings = new ViewSettings();
            PluginSpecs  = new List <PluginSpec>();
            ViewSpecs    = new Dictionary <string, ViewSpec>();
            AppDirs      = new AppDirs();
            Log          = new Log(Log.Formats.Full);
            Storage      = new Storage(AppDirs.StorageDir);
            RememberMe   = new RememberMe(Storage, Log);
            UserMonitor  = new UserMonitor(Log);

            InitUpdaters();
            CreateDataObjects();
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (RefreshToken != null)
         {
             hashCode = hashCode * 59 + RefreshToken.GetHashCode();
         }
         if (RememberMe != null)
         {
             hashCode = hashCode * 59 + RememberMe.GetHashCode();
         }
         if (ClientData != null)
         {
             hashCode = hashCode * 59 + ClientData.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 16
0
        public LoginPageViewModel(INavigationService navigationService) : base(navigationService)
        {
            _navigationService = navigationService;
            webServiceManager  = new WebServiceManager();
            //Title = "Login";

            UserId            = Convert.ToString(RememberMe.Get("username"));
            Password          = Convert.ToString(RememberMe.Get("password"));
            IsSwitchedToggled = (Boolean)RememberMe.Get("isSwitchedToggled", true);
            LoginCommand      = new Command(async() => Login_Command());
            ForgetCommand     = new Command(async() => Forget_Command());
            RegisterCommand   = new Command(async() => Register_Command());
            UserId            = "*****@*****.**";
            Password          = "******";
            if (IsSwitchedToggled)
            {
                if (!string.IsNullOrEmpty(UserId) && !string.IsNullOrEmpty(Password))
                {
                    _navigationService.NavigateAsync("NavigationPage/DashboardPage");
                }
            }
        }
Ejemplo n.º 17
0
        public RememberMe CheckCookie()
        {
            RememberMe obj_RememberMe = null;
            string     username = string.Empty, password = string.Empty;

            if (Response.Cookies["username"] != null)
            {
                username = Response.Cookies["username"].Value;
            }
            if (Response.Cookies["password"] != null)
            {
                password = Response.Cookies["password"].Value;
            }
            if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password))
            {
                obj_RememberMe = new RememberMe {
                    Username = username, Password = password
                }
            }
            ;
            return(obj_RememberMe);
        }
Ejemplo n.º 18
0
        public async void AddNew_Command()
        {
            if (SampleSize == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert ", "Please Enter Sample Size!", "ok");
            }
            else if (SelectedSize == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please select Size Description!", "ok");
            }
            else if (SelectedOppening == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please select Oppening!", "ok");
            }
            else if (SelectedPackageCondition == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please select Package Condition!", "ok");
            }
            else if (Weight == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Weight!", "ok");
            }
            else if (PhysicalCount == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Physical Count!", "ok");
            }
            else if (Temperature == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Temperature!", "ok");
            }
            else if (Brix == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Brix!", "ok");
            }
            else if (Firmness == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Firmness!", "ok");
            }
            else
            {
                try
                {
                    UserDialogs.Instance.ShowLoading("Loading...");
                    RememberMe.Set("isSyncDatabse", true);
                    await Xamarin.Forms.Application.Current.SavePropertiesAsync();

                    InspectionDetailsRequestDTO inspectionRequestDTO = new InspectionDetailsRequestDTO()
                    {
                        Id = InspectionDetailsID,
                        InspectionHeaderId = InspectionHeaderID,
                        SizeId             = (int)SelectedSize.Id,
                        //SizeId = 3,
                        SampleSize         = SampleSize,
                        Weight             = Weight,
                        PhysicalCount      = PhysicalCount,
                        OpeningApperenceId = (int)SelectedOppening.Id,
                        //OpeningApperenceId = 2,
                        Temperature        = Temperature,
                        Brix               = Brix,
                        Firmness           = Firmness,
                        SkinDamage         = SkinDamage,
                        Color              = Color,
                        PackageConditionId = (int)SelectedPackageCondition.Id,
                        //PackageConditionId = 1,
                        Comment      = Comment,
                        QualityScore = QualityScore
                    };
                    Model.InspectionDetailTable inspectionDetailTable = new Model.InspectionDetailTable
                    {
                        Id = 0,
                        InspectionHeaderId = inspectionRequestDTO.InspectionHeaderId,
                        SizeId             = inspectionRequestDTO.SizeId,
                        SampleSize         = inspectionRequestDTO.SampleSize,
                        Weight             = inspectionRequestDTO.Weight,
                        PhysicalCount      = inspectionRequestDTO.PhysicalCount,
                        OpeningApperenceId = inspectionRequestDTO.OpeningApperenceId,
                        Temperature        = inspectionRequestDTO.Temperature,
                        Brix               = inspectionRequestDTO.Brix,
                        Firmness           = inspectionRequestDTO.Firmness,
                        SkinDamage         = inspectionRequestDTO.SkinDamage,
                        Color              = inspectionRequestDTO.Color,
                        PackageConditionId = inspectionRequestDTO.PackageConditionId,
                        Comment            = inspectionRequestDTO.Comment,
                        QualityScore       = inspectionRequestDTO.QualityScore,
                    };

                    if (ConfigurationCommon.App_Online)
                    {
                        var result = await webServiceManager.RegistrationInspectionDetailsAsync(inspectionRequestDTO).ConfigureAwait(true);;
                        if (result.IsSuccess && result.Data.StatusCode == 0)
                        {
                            if (InspectionDetailsID > 0)
                            {
                                HeaderAsync(inspectionDetailTable, result.Data.Id, false);
                            }
                            else
                            {
                                HeaderAsync(inspectionDetailTable, result.Data.Id, true);
                            }
                            // save data
                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Details has been Saved!", "ok");

                            if (DashBoardViewModel.CheckNewInspection)
                            {
                                await _navigationService.GoBackToRootAsync();
                            }
                            else
                            {
                                await _navigationService.GoBackAsync();
                            }
                        }
                        else
                        {
                            await App.Current.MainPage.DisplayAlert("Alert", result.Data.Status, "ok");
                        }
                    }
                    else
                    {
                        int MaxHeaderCode = 0;
                        if (InspectionDetailsID == 0)
                        {
                            var data = await InitData.HeaderRepo.GetMaxCode(x => x.Id, false);

                            MaxHeaderCode = (int)data.Id + 1;
                        }
                        else
                        {
                            MaxHeaderCode = InspectionDetailsID;
                        }
                        if (InspectionDetailsID > 0)
                        {
                            inspectionDetailTable.ModifiedAt = DateTime.Now;
                            inspectionDetailTable.Updated    = true;
                            HeaderAsync(inspectionDetailTable, MaxHeaderCode, false);

                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Details has been Saved!", "ok");

                            if (DashBoardViewModel.CheckNewInspection)
                            {
                                await _navigationService.GoBackAsync();

                                await _navigationService.GoBackAsync();

                                //await _navigationService.GoBackToRootAsync();
                            }
                            else
                            {
                                await _navigationService.GoBackAsync();
                            }
                        }
                        else
                        {
                            inspectionDetailTable.CreatedAt = DateTime.Now;
                            inspectionDetailTable.NewEntry  = true;
                            HeaderAsync(inspectionDetailTable, MaxHeaderCode, true);
                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Details has been Saved!", "ok");

                            if (DashBoardViewModel.CheckNewInspection)
                            {
                                await _navigationService.GoBackToRootAsync();
                            }
                            else
                            {
                                await _navigationService.GoBackAsync();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    UserDialogs.Instance.HideLoading();
                    throw ex;
                }
                finally
                {
                    UserDialogs.Instance.HideLoading();
                }
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 确定窗口
        /// </summary>
        public void Confirm()
        {
            GenerWorkerLists wls = new GenerWorkerLists(this.WorkID, this.NodeID, true);

            try
            {
                #region 检查选择的人员是否为 0 .
                bool isHave0 = true;
                foreach (GenerWorkerList wl in wls)
                {
                    CheckBox cb = this.Pub1.GetCBByID("CB_" + wl.FK_Emp);
                    if (cb.Checked)
                    {
                        isHave0 = false;
                        break;
                    }
                }

                if (isHave0 == true)
                {
                    this.Alert("当前工作中你没有分配给任何人,此工作将不能被其他人所执行!");
                    return;
                }
                #endregion 检查选择的人员是否为 0 .

                #region 执行分配工作 - 更新选择的状态.
                foreach (GenerWorkerList wl in wls)
                {
                    CheckBox cb = this.Pub1.GetCBByID("CB_" + wl.FK_Emp);
                    if (wl.IsEnable != cb.Checked)
                    {
                        wl.IsEnable = cb.Checked;
                        wl.Update();
                    }
                }
                #endregion 执行分配工作 - 更新选择的状态.

                // 保存记忆功能,让下次发送可以记忆住他。
                RememberMe rm = new RememberMe();
                rm.FK_Emp  = BP.Web.WebUser.No;
                rm.FK_Node = NodeID;
                rm.Objs    = "@";
                rm.ObjsExt = "";

                foreach (GenerWorkerList wl in wls)
                {
                    if (wl.IsEnable == false)
                    {
                        continue;
                    }

                    rm.Objs    += wl.FK_Emp + "@";
                    rm.ObjsExt += wl.FK_EmpText + "&nbsp;&nbsp;";
                }

                rm.Emps    = "@";
                rm.EmpsExt = "";

                foreach (GenerWorkerList wl in wls)
                {
                    rm.Emps += wl.FK_Emp + "@";

                    string empInfo = BP.WF.Glo.DealUserInfoShowModel(wl.FK_Emp, wl.FK_EmpText);
                    if (rm.Objs.IndexOf(wl.FK_Emp) != -1)
                    {
                        rm.EmpsExt += "<font color=green>" + BP.WF.Glo.DealUserInfoShowModel(wl.FK_Emp, wl.FK_EmpText) + "</font>&nbsp;&nbsp;";
                    }
                    else
                    {
                        rm.EmpsExt += "<strike><font color=red>(" + BP.WF.Glo.DealUserInfoShowModel(wl.FK_Emp, wl.FK_EmpText) + "</font></strike>&nbsp;&nbsp;";
                    }
                }
                rm.Save();

                if (WebUser.IsWap)
                {
                    this.Pub1.Clear();
                    this.Pub1.AddFieldSet("提示信息");
                    this.Pub1.Add("<br>&nbsp;&nbsp;任务分配成功,特别提示:当下一次流程发送时系统会按照您设置的路径进行智能投递。");
                    this.Pub1.AddUL();
                    this.Pub1.AddLi("<a href='./WAP/Home.aspx' ><img src='/WF/Img/Home.gif' border=0/>主页</a>");
                    this.Pub1.AddLi("<a href='./WAP/Start.aspx' ><img src='/WF/Img/Start.gif' border=0/>发起</a>");
                    this.Pub1.AddLi("<a href='./WAP/Runing.aspx' ><img src='/WF/Img/Runing.gif' border=0/>待办</a>");
                    this.Pub1.AddULEnd();
                    this.Pub1.AddFieldSetEnd();
                }
                else
                {
                    this.ToMsg("任务分配成功!!!", "Info");
                    //this.WinCloseWithMsg("任务分配成功。");
                }
            }
            catch (Exception ex)
            {
                this.Response.Write(ex.Message);
                Log.DebugWriteWarning(ex.Message);
                this.Alert("任务分配出错:" + ex.Message);
            }
        }
Ejemplo n.º 20
0
 protected void WritePropertyValuesCore(SettingsStorage storage)
 {
     storage.SaveOption("", "UserName", UserName);
     storage.SaveOption("", "Password", Password);
     storage.SaveOption("", "RememberMe", RememberMe.ToString());
 }
Ejemplo n.º 21
0
        public async void AddNew_Command()
        {
            if (SelectedCompany == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert ", "Please Select Company Name!", "ok");
            }
            else if (string.IsNullOrEmpty(Invoice))
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Invoice!", "ok");
            }
            else if (SelectedProduct == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert ", "Please Select Product Name!", "ok");
            }
            else if (SelectedVariety == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert ", "Please Select Variety Name!", "ok");
            }
            else if (SelectedBrand == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Select Brand Name!", "ok");
            }
            else if (SelectedCountryofOrigin == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Select CountryofOrigin Name!", "ok");
            }
            else if (TotalBoxQua == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Total Box Quantities!", "ok");
            }
            else if (TempOnCaja == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Temp On Caja!", "ok");
            }
            else if (TempOnTermografo == 0)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Temp On Termografo!", "ok");
            }
            else if (SelectedPalletizingCondition == null)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Select Palletizing Condition!", "ok");
            }
            else
            {
                try
                {
                    UserDialogs.Instance.ShowLoading("Loading...");
                    RememberMe.Set("isSyncDatabse", true);
                    await Xamarin.Forms.Application.Current.SavePropertiesAsync();

                    InspectionHeadersRequestDTO inspectionHeaderRequestDTO = new InspectionHeadersRequestDTO()
                    {
                        Id                     = _InspectionHeader != null ? _InspectionHeader.Id : 0,
                        CompanyId              = (int)SelectedCompany.Id,
                        InspectionDate         = DateTime.Now,
                        UserId                 = Convert.ToInt32(RememberMe.Get("userID")),
                        Invoice                = Invoice,
                        ProducerId             = (int)SelectedProduct.Id,
                        VarietyId              = (int)SelectedVariety.Id,
                        BrandId                = (int)SelectedBrand.Id,
                        CountryofOriginId      = (int)SelectedCountryofOrigin.Id,
                        TotalBoxQuantities     = TotalBoxQua,
                        TempOnCaja             = TempOnCaja,
                        TempOnTermografo       = TempOnTermografo,
                        PalletizingConditionId = (int)SelectedPalletizingCondition.Id,
                    };
                    Model.InspectionHeaderTable inspectionHeaderTable = new Model.InspectionHeaderTable
                    {
                        Id                     = 0,
                        CompanyId              = inspectionHeaderRequestDTO.CompanyId,
                        InspectionDate         = inspectionHeaderRequestDTO.InspectionDate,
                        UserId                 = inspectionHeaderRequestDTO.UserId,
                        Invoice                = inspectionHeaderRequestDTO.Invoice,
                        ProducerId             = inspectionHeaderRequestDTO.ProducerId,
                        VarietyId              = inspectionHeaderRequestDTO.VarietyId,
                        BrandId                = inspectionHeaderRequestDTO.BrandId,
                        CountryofOriginId      = inspectionHeaderRequestDTO.CountryofOriginId,
                        TotalBoxQuantities     = inspectionHeaderRequestDTO.TotalBoxQuantities,
                        TempOnCaja             = inspectionHeaderRequestDTO.TempOnCaja,
                        TempOnTermografo       = inspectionHeaderRequestDTO.TempOnTermografo,
                        PalletizingConditionId = inspectionHeaderRequestDTO.PalletizingConditionId,
                    };

                    if (ConfigurationCommon.App_Online)
                    {
                        var result = await webServiceManager.RegistrationInspectionHeaderAsync(inspectionHeaderRequestDTO).ConfigureAwait(true);;
                        if (result.IsSuccess && result.Data.StatusCode == 0)
                        {
                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Header has been Saved!", "ok");

                            int InspectionID = _InspectionHeader != null ? _InspectionHeader.Id : 0;
                            var parameters   = new NavigationParameters();
                            if (InspectionID > 0)
                            {
                                HeaderAsync(inspectionHeaderTable, result.Data.Id, false);
                                parameters.Add("HeaderID", result.Data.Id);
                                await _navigationService.NavigateAsync("InspectionDetailsListPage", parameters);
                            }
                            else
                            {
                                UserDialogs.Instance.ShowLoading();
                                HeaderAsync(inspectionHeaderTable, result.Data.Id, true);
                                parameters.Add("HeaderID", result.Data.Id);
                                parameters.Add("ScreenRight", "New Detail Inspection");
                                await _navigationService.NavigateAsync("AddNewDetailsInspectionPage", parameters);

                                UserDialogs.Instance.HideLoading();
                            }
                        }
                        else
                        {
                            await App.Current.MainPage.DisplayAlert("Alert", result.Data.Status, "ok");
                        }
                    }
                    else
                    {
                        int MaxHeaderCode = 0;
                        if (inspectionHeaderRequestDTO.Id == 0)
                        {
                            var data = await InitData.HeaderRepo.GetMaxCode(x => x.Id, false);

                            MaxHeaderCode = (int)data.Id + 1;
                        }
                        else
                        {
                            MaxHeaderCode = inspectionHeaderRequestDTO.Id;
                        }

                        if (inspectionHeaderRequestDTO.Id > 0)
                        {
                            HeaderAsync(inspectionHeaderTable, MaxHeaderCode, false);

                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Header has been Saved!", "Ok");

                            var parameters = new NavigationParameters();
                            if (MaxHeaderCode > 0)
                            {
                                parameters.Add("HeaderID", MaxHeaderCode);
                                await _navigationService.NavigateAsync("InspectionDetailsListPage", parameters);
                            }
                        }
                        else
                        {
                            HeaderAsync(inspectionHeaderTable, MaxHeaderCode, true);

                            await App.Current.MainPage.DisplayAlert("Alert", "Inspection Header has been Saved!", "Ok");

                            var parameters = new NavigationParameters();
                            if (MaxHeaderCode > 0)
                            {
                                parameters.Add("HeaderID", MaxHeaderCode);
                                await _navigationService.NavigateAsync("InspectionDetailsListPage", parameters);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    UserDialogs.Instance.HideLoading();
                    throw ex;
                }
                finally
                {
                    UserDialogs.Instance.HideLoading();
                }
            }
        }
Ejemplo n.º 22
0
        public void Confirm()
        {
            GenerWorkerLists wls = new GenerWorkerLists(this.WorkID, this.NodeID, true);
            string           sql = "SELECT * FROM WF_RememberMe WHERE FK_Emp='" + WebUser.No + "' AND FK_Node=" + this.NodeID;
            DataTable        dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count == 0)
            {
                throw new Exception("@system error.....");
            }

            try
            {
                string[] objs    = dt.Rows[0]["Objs"].ToString().Split('@');
                string[] empStrs = dt.Rows[0]["Emps"].ToString().Split('@');

                ArrayList        al      = new ArrayList();
                GenerWorkerLists wlSeles = new GenerWorkerLists();

                foreach (string fk_emp in empStrs)
                {
                    if (fk_emp == null || fk_emp == "")
                    {
                        continue;
                    }

                    CheckBox cb = this.GetCBByID("CB_" + fk_emp);
                    if (cb == null)
                    {
                        BP.DA.Log.DebugWriteWarning("不应该查询不到:" + fk_emp);
                        continue;
                    }

                    if (cb.Checked == false)
                    {
                        continue;
                    }

                    GenerWorkerList wl = wls.GetEntityByKey(GenerWorkerListAttr.FK_Emp, fk_emp) as GenerWorkerList;
                    al.Add(cb.ID.Substring(3));
                    wlSeles.AddEntity(wl);
                }

                if (al.Count == 0)
                {
                    this.Alert("当前工作中你没有分配给任何人,此工作将不能被其他人所执行!");
                    return;
                }

                if (this.IsFHL)
                {
                    /* 处理分合流 */
                    this.DealWithFHLFlow(al, wlSeles);
                }
                else
                {
                    this.DealWithPanelFlow(al, wlSeles);
                }

                // 保存记忆功能。
                RememberMe rm = new RememberMe();
                rm.FK_Emp  = BP.Web.WebUser.No;
                rm.FK_Node = NodeID;
                rm.Objs    = "@";
                rm.ObjsExt = "";

                foreach (GenerWorkerList mywl in wlSeles)
                {
                    rm.Objs    += mywl.FK_Emp + "@";
                    rm.ObjsExt += mywl.FK_EmpText + "&nbsp;&nbsp;";
                }

                rm.Emps    = "@";
                rm.EmpsExt = "";

                foreach (GenerWorkerList wl in wls)
                {
                    rm.Emps += wl.FK_Emp + "@";

                    if (rm.Objs.IndexOf(wl.FK_Emp) != -1)
                    {
                        rm.EmpsExt += "<font color=green>(" + wl.FK_Emp + ")" + wl.FK_EmpText + "</font>&nbsp;&nbsp;";
                    }
                    else
                    {
                        rm.EmpsExt += "<strike>(" + wl.FK_Emp + ")" + wl.FK_EmpText + "</strike>&nbsp;&nbsp;";
                    }
                }

                rm.FK_Emp = BP.Web.WebUser.No;
                rm.Update();


                if (WebUser.IsWap)
                {
                    this.Clear();
                    this.AddFieldSet("提示信息");
                    this.Add("<br>&nbsp;&nbsp;任务分配成功,特别提示:当下一次流程发送时系统会按照您设置的路径进行智能投递。");
                    this.AddUL();
                    this.AddLi("<a href='./WAP/Home.aspx' ><img src='/WF/Img/Home.gif' border=0/>主页</a>");
                    this.AddLi("<a href='./WAP/Start.aspx' ><img src='/WF/Img/Start.gif' border=0/>发起</a>");
                    this.AddLi("<a href='./WAP/Runing.aspx' ><img src='/WF/Img/Runing.gif' border=0/>待办</a>");
                    this.AddULEnd();
                    this.AddFieldSetEnd();
                }
                else
                {
                    this.WinCloseWithMsg("任务分配成功。");
                }
            }
            catch (Exception ex)
            {
                this.Response.Write(ex.Message);
                Log.DebugWriteWarning(ex.Message);
                this.Alert("任务分配出错:" + ex.Message);
            }
        }
Ejemplo n.º 23
0
        public async void Login_Command()
        {
            if (UserId == null || userid == "")
            {
                await App.Current.MainPage.DisplayAlert("Alert ", "Please Enter EmailID", "ok");
            }
            else if (Password == null || Password == "")
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Please Enter Password", "ok");
            }
            else if (Color.Red == EmailColor)
            {
                await App.Current.MainPage.DisplayAlert("Alert", "Email is not in correct format!", "ok");
            }
            else if (ConfigurationCommon.App_Online)
            {
                try
                {
                    UserDialogs.Instance.ShowLoading("Loading...");
                    if (ConfigurationCommon.App_Online)
                    {
                        UsersRequestDTO clientRequestDTO = new UsersRequestDTO()
                        {
                            Email   = UserId,
                            UserPwd = Password,
                            //ApplicationId = ConfigurationCommon.ApplicationId,
                            //DeviceToken = RememberMe.Get("PushDeviceToken").ToString(),
                            //DeviceName = Device.RuntimePlatform,
                        };
                        var result = await webServiceManager.LoginAsync(clientRequestDTO).ConfigureAwait(true);;
                        if (result.IsSuccess && string.IsNullOrEmpty(result.Data.Status))
                        {
                            UserData = new User()
                            {
                                CompanyId = result.Data._Users.CompanyId,
                                //ApplicationId = result.Data._Users.ApplicationId,
                                UserRoleId = result.Data._Users.UserRoleId,
                                Id         = result.Data._Users.Id
                            };
                            RememberMe.Set("userID", result.Data._Users.Id);
                            RememberMe.Set("CmpID", result.Data._Users.CompanyId);
                            RememberMe.Set("UserRoleId", result.Data._Users.CompanyId);
                            //if (IsSwitchedToggled)
                            //{
                            RememberMe.Set("username", this.UserId);
                            RememberMe.Set("password", this.Password);
                            //}
                            RememberMe.Set("isSwitchedToggled", IsSwitchedToggled);
                            RememberMe.Set("isDatabaseUpdate", false);
                            await _navigationService.NavigateAsync("DashboardPage");

                            await Xamarin.Forms.Application.Current.SavePropertiesAsync();
                        }
                        else
                        {
                            App.Current.MainPage.DisplayAlert("Alert ", result.Data.Status, "ok");
                        }
                    }
                }
                catch (Exception ex)
                {
                    UserDialogs.Instance.HideLoading();
                    throw ex;
                }
                //finally
                //{
                //  UserDialogs.Instance.HideLoading();
                //}
            }
            else
            {
                if (UserId != Convert.ToString(RememberMe.Get("username")))
                {
                    await App.Current.MainPage.DisplayAlert("Alert", "Please Enter valid EmailID!", "ok");
                }
                else if (Password != Convert.ToString(RememberMe.Get("password")))
                {
                    await App.Current.MainPage.DisplayAlert("Alert", "Please Enter valid Password!", "ok");
                }
                else
                {
                    RememberMe.Set("isSwitchedToggled", IsSwitchedToggled);
                    await _navigationService.NavigateAsync("DashboardPage");

                    await Xamarin.Forms.Application.Current.SavePropertiesAsync();
                }
            }
        }