예제 #1
0
 internal static void LoadLocalization(string CultureCode)
 {
     if (Lang.Length == 0)
     {
         if (CultureCode.Length < 2)
         {
             LocCulture = "en";
         }
         else
         {
             LocCulture = CultureCode.Substring(0, 2);
             if (LocCulture == "be" || LocCulture == "uk")
             {
                 LocCulture = "ru";
             }
             if (!SupportedCultures.Contains(LocCulture))
             {
                 LocCulture = "en";
             }
         }
         Lang = LocCulture;
     }
     else
     {
         LocCulture = Lang;
     }
     using (Stream ResourceStream = GetResourceStream(new Uri($"pack://*****:*****@"\n", "\n"));
             }
             string AboutFeatures = string.Empty;
             while (!Reader.EndOfStream)
             {
                 AboutFeatures += $"• {Reader.ReadLine()}";
                 if (!Reader.EndOfStream)
                 {
                     AboutFeatures += "\n";
                 }
             }
             List.Add(LocCode.AboutFeatures, AboutFeatures);
         }
     HoursString   = List[LocCode.Hours];
     MinutesString = List[LocCode.Minutes];
     SecondsString = List[LocCode.Seconds];
 }
예제 #2
0
        private void AddSubmitCommand()
        {
            if (LocCode.IsNotNullOrEmpty() || LocName.IsNotNullOrEmpty())
            {
                if (ShowWarningMessage(PDMsg.BeforeCloseForm, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    CommonFormValUpdtae();
                    return;
                }
                else
                {
                    NextAction = "ADD";
                    SetUserRights("ADD");
                    // EditEnable = true;
                    //AddEnable = false;
                    LocCode            = string.Empty;
                    LocName            = string.Empty;
                    DeleteEnable       = false;
                    TxtReadOnly        = false;
                    IsVisibilityDelete = Visibility.Visible;
                    IsActive           = true;
                    IsDeleteEnable     = false;

                    ButtonEnable = Visibility.Collapsed;
                    FocusButton  = true;
                }
            }
            else
            {
                NextAction = "ADD";
                SetUserRights("ADD");
                // EditEnable = true;
                //AddEnable = false;
                LocCode            = string.Empty;
                LocName            = string.Empty;
                DeleteEnable       = false;
                TxtReadOnly        = false;
                IsVisibilityDelete = Visibility.Visible;
                IsActive           = true;
                IsDeleteEnable     = false;

                ButtonEnable = Visibility.Collapsed;
                FocusButton  = true;
            }
        }
예제 #3
0
        private void Refresh()
        {
            string startDate;
            string endDate;
            string message = "";
            Int64  cnt     = 0;

            try
            {
                if (StartDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Start Date"));
                    return;
                }

                if (EndDate.ToValueAsString().Trim() == "")
                {
                    ShowInformationMessage(PDMsg.NotEmpty("End Date"));
                    return;
                }

                if (StartDate > EndDate)
                {
                    ShowInformationMessage("Start Date is Greater than End Date,Please Check it.!");
                    return;
                }


                startDate = Convert.ToDateTime(StartDate).ToString("dd/MM/yyyy");
                endDate   = Convert.ToDateTime(EndDate).ToString("dd/MM/yyyy");

                if (_perfOption == performanceOption.CostSheetReceived)
                {
                    PerformanceResult = _ddPerformanceBll.CostSheetReceived(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForCostSheet();
                    message      = "Cost Sheets Received - ";
                    _reportTitle = "Cost Sheets Received Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.CostSheetCompleted)
                {
                    PerformanceResult = _ddPerformanceBll.CostSheetCompleted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForCostSheet();
                    message      = "Cost Sheets Completed - ";
                    _reportTitle = "Cost Sheets Completed Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.PartNumberAllotted)
                {
                    PerformanceResult = _ddPerformanceBll.PartNumberAllotted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForPartNoAllotted();
                    message      = "Part Numbers Allotted - ";
                    _reportTitle = "Part Numbers Allotted Between " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.DocumentReleased)
                {
                    PerformanceResult = _ddPerformanceBll.DocumentReleased(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForDocumentsReleased();
                    message      = "Documents Released - ";
                    _reportTitle = "Documents Released " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                else if (_perfOption == performanceOption.SampleSubmitted)
                {
                    PerformanceResult = _ddPerformanceBll.SampleSubmitted(startDate, endDate, LocCode.ToValueAsString().Trim());
                    columnDefinitionForSamplesSubmitted();
                    message      = "Samples Submitted - ";
                    _reportTitle = "Samples Submitted " + startDate + " and " + endDate;
                    cnt          = PerformanceResult.Count;
                }
                HeaderDetails = message + cnt.ToString() + (cnt > 0 ? " Entries" : " Entry") + " found ";
                NotifyPropertyChanged("HeaderDetails");
                NotifyPropertyChanged("PerformanceResult");
                NotifyPropertyChanged("HEADER1");
                NotifyPropertyChanged("VISIBLE");
                GC.Collect(2);
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
예제 #4
0
 internal static string LocString(LocCode Code) => List[Code];
예제 #5
0
        public void CommonFormValUpdtae()
        {
            try
            {
                isActiveSave = (IsActive) ? false : true;
                if (ButtonEnable == Visibility.Visible)
                {
                    NextAction = "EDIT";
                }
                else if (ButtonEnable == Visibility.Collapsed)
                {
                    NextAction = "ADD";
                }

                //    NextAction = "EDIT";

                if (String.IsNullOrEmpty(Convert.ToString(LocCode)) || LocCode.Trim().Length == 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Location Code"));
                    //FocusButton = true;
                    Flag = true;
                    //System.Windows.MessageBox.Show("Location Code should be Entered", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else if (String.IsNullOrEmpty(LocName) || LocName.Trim().Length == 0)
                {
                    ShowInformationMessage(PDMsg.NotEmpty("Location Name"));
                    // FocusButton = true;
                    Flag = true;
                    //System.Windows.MessageBox.Show("Location Name should be Entered", "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                }
                else
                {
                    Flag = false;
                    //Progress.ProcessingText = PDMsg.ProgressUpdateText;
                    //Progress.Start();
                    bool val = oLocMaster.AddNewLocationMaster(isActiveSave, LocCode, LocName, NextAction, ref _errMessage);
                    //Progress.End();
                    if (val)
                    {
                        ShowInformationMessage(_errMessage);
                        FocusButton = true;
                        //System.Windows.MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                        //MessageBox.Show(_errMessage);
                        ClearOperMaster();
                    }
                    if (val == false)
                    {
                        if ((string)_errMessage != "")
                        {
                            ShowInformationMessage(_errMessage);
                        }
                        FocusButton = true;
                        //MessageBox.Show(_errMessage, "SmartPD", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }

                DtDataview = oLocMaster.GetLocationMaster();
                // FocusButton = true;
                if (Flag == true)
                {
                    if (AddEnable == true)
                    {
                        NextAction = "EDIT";
                        SetUserRights("EDIT");
                        ButtonEnable = Visibility.Visible;
                    }
                    else if (EditEnable == true)
                    {
                        NextAction = "ADD";
                        SetUserRights("ADD");
                        ButtonEnable = Visibility.Collapsed;
                    }
                }
                TxtReadOnly = (NextAction == "EDIT") ? true : false;
                //   LoadTableData();
            }
            catch (Exception ex)
            {
                Progress.End();
                throw ex.LogException();
            }
        }