コード例 #1
0
ファイル: StyleTNAColor.xaml.cs プロジェクト: Osama91/CCWFM
 public StyleTNAColor(StyleHeaderViewModel styleViewModel)
 {
     InitializeComponent();
     DataContext = styleViewModel;
     ViewModel   = styleViewModel;
     ViewModel.AddNewStyleTNAColorDetailRow(true);
 }
コード例 #2
0
 public AdvanceSampleRequestChildWindow(StyleHeaderViewModel style)
 {
     InitializeComponent();
     DataContext = style;
     _viewModel  = style;
     //     _RequestforSampleViewModel = requestForSampleViewModel;
 }
コード例 #3
0
 public SalesOrderColorCancelRequest(StyleHeaderViewModel styleViewModel)
 {
     InitializeComponent();
     DataContext = styleViewModel;
     ViewModel   = styleViewModel;
     GetSalesOrderColorsBySalesOrderType();
 }
コード例 #4
0
ファイル: BomOperations.xaml.cs プロジェクト: Osama91/CCWFM
 public BomOperations(StyleHeaderViewModel viewModel, bool mainOperation)
 {
     InitializeComponent();
     DataContext   = this;
     MainOperation = mainOperation;
     _viewModel    = viewModel;
     _client.SearchVendorsCompleted += (s, e) =>
     {
         if (e.Error != null)
         {
             return;
         }
         VendAutoComplete.ItemsSource = e.Result;
         VendAutoComplete.PopulateComplete();
     };
     RouteCardService.GetRoutesCompleted += (s, sv) =>
     {
         DgResults.ItemsSource = sv.Result;
     };
     RouteCardService.GetRoutGroupsAsync(null, null);
     RouteCardService.GetRoutGroupsCompleted += (s, sv) =>
     {
         CmbRouteGroup.ItemsSource = sv.Result;
     };
 }
コード例 #5
0
        public SeasonalMasterListChildWindow(StyleHeaderViewModel viewModel)
        {
            InitializeComponent();

            _viewModel     = new SeasonalMasterListViewModel(viewModel);
            DataContext    = _viewModel;
            StyleviewModel = viewModel;
        }
コード例 #6
0
        public SalesOrderNotes(StyleHeaderViewModel styleViewModel)
        {
            InitializeComponent();

            DataContext = styleViewModel;
            ViewModel   = styleViewModel;
            ViewModel.GetSalesOrderNotes();
        }
コード例 #7
0
ファイル: ReservationViewModel.cs プロジェクト: Osama91/CCWFM
        public ReservationViewModel(StyleHeaderViewModel styleViewModel)
        {
            this.styleViewModel = styleViewModel;

            InitializeCompleted();
            GetOnhand = true;
            GetReservationMainDetail(styleViewModel);
        }
コード例 #8
0
        public FabricReservation(StyleHeaderViewModel styleViewModel)
        {
            InitializeComponent();
            ReservationViewModel resViewModel = new ReservationViewModel(styleViewModel);

            _viewModel          = resViewModel;
            this.DataContext    = resViewModel;
            this.styleViewModel = styleViewModel;
        }
コード例 #9
0
        public StyleTNAChildWindow(StyleHeaderViewModel viewModel)
        {
            InitializeComponent();

            _viewModel     = new StyleTNAHeaderViewModel(viewModel);
            DataContext    = _viewModel;
            StyleviewModel = viewModel;
            //TxtCreatedBy.Text = viewModel.SelectedMainRow.CreatedBy;
            //TxtCreationDate.Text = viewModel.SelectedMainRow.CreationDate.Value.ToShortDateString();
        }
コード例 #10
0
        public StyleTNAHeaderViewModel(StyleHeaderViewModel selectedStyle)
        {
            if (!DesignerProperties.IsInDesignTool)
            {
                GetItemPermissions(PermissionItemName.StyleTNAForm.ToString());

                SelectedStyleViewModel = selectedStyle;
                MainRowList            = new ObservableCollection <TblStyleTNAHeaderViewModel>();
                SelectedMainRow        = new TblStyleTNAHeaderViewModel();
            }
        }
コード例 #11
0
        public RequestForSample(StyleHeaderViewModel styleViewModel)
        {
            InitializeComponent();
            _viewModel              = new RequestForSampleViewModel(styleViewModel);
            DataContext             = _viewModel;
            _styleViewModel         = styleViewModel;
            _viewModel.DataGridName = "MainGrid";

            _viewModel.PremCompleted += (s, sv) =>
            {
                if (_viewModel.CustomePermissions.SingleOrDefault(x => x.Code == "RequestForSampleOpen") != null)
                {
                    _viewModel.RequestForSampleOpen = true;
                }
            };
        }
コード例 #12
0
ファイル: StyleTNAStatus.xaml.cs プロジェクト: Osama91/CCWFM
        public StyleTNAStatus(StyleHeaderViewModel styleViewModel)
        {
            InitializeComponent();
            ViewModel   = new StyleTNAStatusViewModel(styleViewModel);
            DataContext = ViewModel;

            ViewModel.ProductionClient.UpdateOrInsertTblStyleTNAStatusDetailCompleted += (s, x) =>
            {
                var savedRow = (TblStyleTNAStatusDetailModel)ViewModel.MainRowList.GetItemAt(x.outindex);
                if (savedRow != null)
                {
                    savedRow.InjectFrom(x.Result);
                }

                ViewModel.TempStyleViewModel.Loading = false;
                ViewModel.TempStyleViewModel.SelectedTnaRow.TblStyleTNAStatus = x.Result.TblStyleTnaStatus;
                ViewModel.Loading = false;
                DialogResult      = true;
            };
        }
コード例 #13
0
ファイル: ReservationViewModel.cs プロジェクト: Osama91/CCWFM
 internal void GetReservationMainDetail(StyleHeaderViewModel StyleHeaderViewModel)
 {
     if (ValuesObjects == null)
     {
         ValuesObjects = new System.Collections.Generic.Dictionary <string, object>();
     }
     if (StyleHeaderViewModel.SelectedBomRow != null)
     {
         if (StyleHeaderViewModel.SelectedBomRow.ItemPerRow != null)
         {
             ObservableCollection <string> temp = new ObservableCollection <string>();
             foreach (var item in this.styleViewModel.SelectedBomRow.BomStyleColors.Where(w => w.TblColor != null).Select(w => w.TblColor.Code).Distinct())
             {
                 temp.Add(item);
             }
             Loading = true;
             Client.GetReservationMainDetailByFabricAsync(Filter, ValuesObjects, GetOnhand, StyleHeaderViewModel.SelectedDetailRow.Iserial, -1, StyleHeaderViewModel.SelectedBomRow.ItemPerRow.Code, temp);
             GetOnhand = false;
         }
     }
 }
コード例 #14
0
        public SalesOrderColorProduction(StyleHeaderViewModel styleViewModel, SalesOrderType salesOrderType)
        {
            InitializeComponent();
            DataContext = styleViewModel;
            ViewModel   = styleViewModel;

            SalesOrderColorsGrid.Visibility = Visibility.Visible;

            foreach (var row in SalesOrderColorsGrid.Columns.Where(x => x.DisplayIndex >= 0 && x.DisplayIndex < 9))
            {
                const int pageWidth = 650;
                row.Width = new DataGridLength(pageWidth / 9);
            }

            if (salesOrderType == SalesOrderType.SalesOrderPo)
            {
                foreach (var row in SalesOrderColorsGrid.Columns.Where(x => x.DisplayIndex > 3 && x.DisplayIndex < 9))
                {
                    row.Visibility = Visibility.Collapsed;
                }
            }
        }
コード例 #15
0
ファイル: SalesOrderColor.xaml.cs プロジェクト: Osama91/CCWFM
        public SalesOrderColor(StyleHeaderViewModel styleViewModel, SalesOrderType salesOrderType)
        {
            InitializeComponent();
            _salesOrderType = salesOrderType;
            DataContext     = styleViewModel;
            ViewModel       = styleViewModel;
            if (_salesOrderType != SalesOrderType.SalesOrderPo)
            {
                SalesOrderColorsGrid.Visibility = Visibility.Collapsed;
            }
            else
            {
                RfqColorsGrid.Visibility = Visibility.Collapsed;
            }
            foreach (var row in SalesOrderColorsGrid.Columns.Where(x => x.DisplayIndex >= 0 && x.DisplayIndex < 9))
            {
                const int pageWidth = 650;
                row.Width = new DataGridLength(pageWidth / 9);
            }

            //if (salesOrderType == SalesOrderType.SalesOrderPo)
            //{
            //    foreach (var row in SalesOrderColorsGrid.Columns.Where(x => x.DisplayIndex > 3 && x.DisplayIndex < 5))
            //    {
            //        row.Visibility = Visibility.Collapsed;
            //    }
            //}

            ViewModel.SelectedDetailRow.SalesOrderColorList.Clear();
            if (ViewModel.SelectedDetailRow != null && ViewModel.SelectedDetailRow.IsPlannedOrder)
            {
                ViewModel.GetSeasonalMasterList();
            }

            ViewModel.GetSalesOrderColors();
        }
コード例 #16
0
        public ApprovalViewModel(StyleHeaderViewModel styleViewModel)
        {
            TempStyleViewModel = styleViewModel;
            Perm = 301;
            if (!DesignerProperties.IsInDesignTool)
            {
                User = LoggedUserInfo.Iserial;

                Salesorder = styleViewModel.SelectedDetailRow.Iserial;

                var approvalTypeService = new CRUD_ManagerServiceClient();

                approvalTypeService.GetGenericAsync("TblApprovalTypes", "%%", "%%", "%%", "Iserial", "ASC");

                approvalTypeService.GetGenericCompleted += (s, sv) =>
                {
                    var tblUserBrandSection =
                        LoggedUserInfo.UserBrandSection.FirstOrDefault(
                            x =>
                            x.BrandCode == styleViewModel.SelectedMainRow.Brand &&
                            x.TblLkpBrandSection == styleViewModel.SelectedMainRow.TblLkpBrandSection);

                    switch (styleViewModel.SelectedDetailRow.SalesOrderType)
                    {
                    case (int)SalesOrderType.SalesOrderPo:

                        Perm = 303;
                        break;
                    }

                    if (tblUserBrandSection != null)
                    {
                        ApprovalTypesList = sv.Result;
                        var userPerm =
                            tblUserBrandSection.TblUserBrandSectionPermissions.SingleOrDefault(
                                x => x.TblAuthPermission == Perm);

                        if (userPerm != null)
                        {
                            if (!userPerm.Retail)
                            {
                                var tempRow = sv.Result.SingleOrDefault(x => x.Code == "Retail");
                                ApprovalTypesList.Remove(tempRow);
                            }
                            if (!userPerm.Financial)
                            {
                                var tempRow = sv.Result.SingleOrDefault(x => x.Code == "Financial");
                                ApprovalTypesList.Remove(tempRow);
                            }
                            if (!userPerm.Technical)
                            {
                                var tempRow = sv.Result.SingleOrDefault(x => x.Code == "Technical");
                                ApprovalTypesList.Remove(tempRow);
                            }
                        }
                        else
                        {
                            ApprovalTypesList.Clear();
                        }
                    }

                    if (ApprovalTypesList != null && ApprovalTypesList.Count > 0)
                    {
                        GetMaindata();
                    }
                };

                MainRowList     = new ObservableCollection <TblApprovalViewModel>();
                SelectedMainRow = new TblApprovalViewModel();

                Client.GetTblApprovalCompleted += (s, sv) =>
                {
                    if (sv.Error != null)
                    {
                        MessageBox.Show(sv.Error.Message);
                    }

                    foreach (var row in sv.Result)
                    {
                        var newrow = new TblApprovalViewModel();
                        newrow.InjectFrom(row);
                        newrow.ApprovalPerRow.InjectFrom(row.TblApprovalType);
                        newrow.UserPerRow = row.TblAuthUser1;
                        MainRowList.Add(newrow);
                    }

                    foreach (var row in ApprovalTypesList)
                    {
                        if (row.Iserial == 1 && !styleViewModel.SelectedDetailRow.IsRetailApproved ||
                            row.Iserial == 2 && !styleViewModel.SelectedDetailRow.IsFinancialApproved ||
                            row.Iserial == 3 && !styleViewModel.SelectedDetailRow.IsTechnicalApproved
                            )
                        {
                            AddNewMainRow(row);
                        }
                    }

                    Loading = false;
                };

                ProductionClient.GetTblUsersApprovalStatusAsync(LoggedUserInfo.Iserial);

                ProductionClient.GetTblUsersApprovalStatusCompleted += (s, sv) =>
                {
                    ApprovalStatusList.Clear();
                    foreach (var item in sv.Result.ToList())
                    {
                        ApprovalStatusList.Add(new GenericTable().InjectFrom(item) as GenericTable);
                    }
                };

                Client.UpdateOrInsertTblApprovalCompleted += (s, x) =>
                {
                    Salesorder.InjectFrom(x.Result.TblSalesOrder);
                    var savedRow = (TblApprovalViewModel)MainRowList.GetItemAt(x.outindex);
                    if (savedRow != null)
                    {
                        savedRow.InjectFrom(x.Result);
                    }
                    OnApproveCompleted();
                    TempStyleViewModel.Loading = false;
                    Loading = false;
                };
                Client.DeleteTblApprovalCompleted += (s, ev) =>
                {
                    if (ev.Error != null)
                    {
                        throw ev.Error;
                    }

                    var oldrow = MainRowList.FirstOrDefault(x => x.Iserial == ev.Result);
                    if (oldrow != null)
                    {
                        MainRowList.Remove(oldrow);
                    }
                };
            }
        }
コード例 #17
0
 public PendingStyles(StyleHeaderViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
 }
コード例 #18
0
 public GenerateSalesOrderFromPo(StyleHeaderViewModel viewModel)
 {
     InitializeComponent();
     _viewModel  = viewModel;
     DataContext = viewModel;
 }
コード例 #19
0
        public SeasonalMasterListViewModel(StyleHeaderViewModel selectedStyle)
        {
            if (!DesignerProperties.IsInDesignTool)
            {
                GetItemPermissions(PermissionItemName.SeasonalMasterListForm.ToString());
                SelectedStyleViewModel         = selectedStyle;
                MainRowList                    = new ObservableCollection <TblSeasonalMasterListViewModel>();
                SelectedMainRow                = new TblSeasonalMasterListViewModel();
                MainRowList.CollectionChanged += MainRowList_CollectionChanged;

                if (LoggedUserInfo.AllowedStores != null)
                {
                    Client.SearchBysStoreNameAsync(new ObservableCollection <int>(LoggedUserInfo.AllowedStores), LoggedUserInfo.Iserial, null, null, LoggedUserInfo.DatabasEname);
                }

                Client.SearchBysStoreNameCompleted += (s, sv) =>
                {
                    StoreList = sv.Result;
                };
                Client.GetSmlCompleted += (s, sv) =>
                {
                    foreach (var row in sv.Result)
                    {
                        var newrow = new TblSeasonalMasterListViewModel();

                        newrow.CanEditDeliveryDate = CanChangeDeliveryDate;

                        newrow.InjectFrom(row);
                        newrow.StylePerRow = row.TblStyle1;
                        newrow.ThemePerRow =
                            SelectedStyleViewModel.ThemesList.SingleOrDefault(
                                x => x.Iserial == row.TblSalesOrderColorTheme);
                        newrow.ColorPerRow =
                            SelectedStyleViewModel.ColorList.SingleOrDefault(
                                x => x.Iserial == row.TblColor);
                        var sizeRatioList = new ObservableCollection <TblSeasonalMasterListDetail>();
                        foreach (var sizeCode in SelectedStyleViewModel.Sizes.OrderBy(x => x.Id))
                        {
                            sizeRatioList.Add(new TblSeasonalMasterListDetail
                            {
                                Size = sizeCode.SizeCode,
                            });
                        }
                        //Added By  Hashem to Map with the NEW Stitch System Ratios with Sizes

                        ObservableCollection <TblSeasonalMasterListDetail> data = new ObservableCollection <TblSeasonalMasterListDetail>();

                        if (row.TblSeasonalMasterListDetails.Count() != 0)
                        {
                            //foreach (var r in row.TblSeasonalMasterListDetails)
                            //{
                            foreach (var item in SelectedStyleViewModel.Sizes.OrderBy(x => x.Id))
                            {
                                TblSeasonalMasterListDetail d = new TblSeasonalMasterListDetail();
                                d = row.TblSeasonalMasterListDetails.Where(x => x.Size == item.SizeCode).FirstOrDefault();
                                data.Add(d);
                            }
                            //}
                        }


                        //Commented By Hashem  to Map with the NEW Stitch System Ratios with Sizes
                        //GenericMapper.InjectFromObCollection(newrow.SeasonalMasterListDetail,
                        //row.TblSeasonalMasterListDetails.Count() != 0 ? row.TblSeasonalMasterListDetails : sizeRatioList);

                        GenericMapper.InjectFromObCollection(newrow.SeasonalMasterListDetail,
                                                             row.TblSeasonalMasterListDetails.Count() != 0 ? data : sizeRatioList);
                        try
                        {
                            newrow.DelivaryDate = row.DelivaryDate.Value;
                        }
                        catch { }
                        MainRowList.Add(newrow);
                    }
                    Loading   = false;
                    FullCount = sv.fullCount;
                    if (FullCount == 0 && MainRowList.Count == 0)
                    {
                        AddNewMainRow(false);
                    }
                };

                Client.GetTblStoreIntialOrderCompleted += (s, sv) =>
                {
                    foreach (var row in sv.Result)
                    {
                        var newrow = new TblStoreIntialOrderViewModel();

                        newrow.InjectFrom(row);
                        newrow.StorePerRow = sv.Stores.FirstOrDefault(x => x.iserial == row.Store);
                        SelectedMainRow.DetailList.Add(newrow);
                    }
                    Loading         = false;
                    DetailFullCount = sv.fullCount;
                    if (DetailFullCount == 0 && SelectedMainRow.DetailList.Count == 0)
                    {
                        AddNewDetailRow(false);
                    }
                };

                Client.UpdateOrInsertTblSmlCompleted += (s, x) =>
                {
                    if (x.Error != null)
                    {
                        MessageBox.Show(x.Error.Message);
                    }
                    var savedRow = (TblSeasonalMasterListViewModel)MainRowList.GetItemAt(x.outindex);

                    if (savedRow != null)
                    {
                        savedRow.InjectFrom(x.Result);


                        foreach (var item in x.Result.TblSeasonalMasterListDetails)
                        {
                            var newsizeRow = savedRow.SeasonalMasterListDetail.FirstOrDefault(w => w.Size == item.Size);
                            if (newsizeRow != null)
                            {
                                newsizeRow.Iserial = item.Iserial;
                            }
                        }
                    }
                    Loading = false;
                    if (savedRow.Iserial == 0)
                    {
                        var amountAva    = x.AmountAvaliable;
                        var amountExc    = x.AmountExceeded;
                        var qtyAvaliable = x.QtyAvaliable;
                        var qtyExc       = x.QtyExceeded;

                        MessageBox.Show("Brand Budget Is Not Enough For The current Amounts Or Quantities, Amount Avaliable= " + amountAva + " and  Amount Exceeded= " + amountExc + "Qty Avaliable= " + qtyAvaliable + " and  Qty Exceeded= " + qtyExc);
                    }
                };

                Client.UpdateOrInsertTblStoreIntialOrderCompleted += (s, x) =>
                {
                    var savedRow = SelectedMainRow.DetailList.ElementAt(x.outindex);

                    if (savedRow != null)
                    {
                        savedRow.InjectFrom(x.Result);
                    }
                    Loading = false;
                };
                Client.DeleteSmlCompleted += (s, ev) =>
                {
                    if (ev.Error != null)
                    {
                        throw ev.Error;
                    }

                    var oldrow = MainRowList.FirstOrDefault(x => x.Iserial == ev.Result);
                    if (oldrow != null)
                    {
                        MainRowList.Remove(oldrow);
                    }
                    Loading = false;
                };
                Client.DeleteTblStoreIntialOrderCompleted += (s, ev) =>
                {
                    if (ev.Error != null)
                    {
                        throw ev.Error;
                    }

                    var oldrow = SelectedMainRow.DetailList.FirstOrDefault(x => x.Style == ev.Result.Style && x.Color == ev.Result.Color && x.Store == ev.Result.Store);
                    if (oldrow != null)
                    {
                        SelectedMainRow.DetailList.Remove(oldrow);
                    }
                    Loading = false;
                };
                GetMaindata();
            }
        }
コード例 #20
0
        public StyleTNAStatusViewModel(StyleHeaderViewModel styleViewModel)
        {
            TempStyleViewModel = styleViewModel;

            if (!DesignerProperties.IsInDesignTool)
            {
                MainRowList     = new ObservableCollection <TblStyleTNAStatusDetailModel>();
                SelectedMainRow = new TblStyleTNAStatusDetailModel();

                ProductionClient.GetTblStyleTNAStatusDetailCompleted += (s, sv) =>
                {
                    if (sv.Error != null)
                    {
                        MessageBox.Show(sv.Error.Message);
                    }

                    foreach (var row in sv.Result)
                    {
                        var newrow = new TblStyleTNAStatusDetailModel();
                        newrow.InjectFrom(row);
                        newrow.UserPerRow           = row.TblAuthUser1;
                        newrow.StyleTNAStatusPerRow = new GenericTable();
                        if (row.TblStyleTNAStatu != null)
                        {
                            GenericTable newTempRow = new GenericTable().InjectFrom(row.TblStyleTNAStatu) as GenericTable;
                            newrow.StyleTNAStatusPerRow = newTempRow;
                        }
                        MainRowList.Add(newrow);
                    }

                    AddNewMainRow();
                    Loading = false;
                };

                ProductionClient.GetTblUsersStyleTNAStatusAsync(LoggedUserInfo.Iserial);

                ProductionClient.GetTblUsersStyleTNAStatusCompleted += (s, sv) =>
                {
                    StyleTNAStatusList.Clear();
                    FullStyleTNAStatusList.Clear();
                    foreach (var item in sv.Result.ToList())
                    {
                        FullStyleTNAStatusList.Add(new ProductionService.TblStyleTNAStatu().InjectFrom(item) as ProductionService.TblStyleTNAStatu);
                    }
                    foreach (var item in sv.Result.ToList())
                    {
                        if (!CheckIfEnableEdit(TempStyleViewModel.SelectedTnaRow.TblStyleTNAStatus))
                        {
                            if (item.DisplayAfterApprove)
                            {
                                StyleTNAStatusList.Add(new ProductionService.TblStyleTNAStatu().InjectFrom(item) as ProductionService.TblStyleTNAStatu);
                            }
                        }
                        else
                        {
                            if (!item.DisplayAfterApprove)
                            {
                                StyleTNAStatusList.Add(new ProductionService.TblStyleTNAStatu().InjectFrom(item) as ProductionService.TblStyleTNAStatu);
                            }
                        }
                    }
                };
                ProductionClient.UpdateOrInsertTblStyleTNAStatusDetailCompleted += (s, sv) =>
                {
                    TempStyleViewModel.SelectedTnaRow.TblStyleTNAStatus = sv.Result.TblStyleTnaStatus;
                };

                GetMaindata();
            }
        }