コード例 #1
0
ファイル: PriceCtrlMain.cs プロジェクト: watmis1223/product
        public void ModuleCalculationByProffixMode(string[] arguments)
        {
            settingTabPage.PageVisible     = false;
            generalTabPage.PageVisible     = true;
            calculationTabPage.PageVisible = false;
            mainTabControl.SelectedTabPage = generalTabPage;

            //if call from proffix, arguments should not null
            ProffixModel oProffix = new ProffixModel();

            oProffix.SetModel(arguments);
            generalCtrl1.SetProffixParam(oProffix, _PriceCalculationSetting.ProffixConnection);

            if (oProffix.IsLoad)
            {
                //load cal setting from db
                CalculationModel oCal = StorageOperator.CalPriceLoadByID(Convert.ToInt64(oProffix.CalculationID));
                calculationTabPage.PageVisible = true;

                generalCtrl1.LoadCalculation(oCal);

                ReloadPriceCalculationSetting(true);
                calculationBasicCtrl1.LoadCalculation(oCal, _PriceCalculationSetting);
            }
        }
コード例 #2
0
ファイル: GeneralCtrl.cs プロジェクト: watmis1223/product
        public void SetProffixParam(ProffixModel model, string connectionString)
        {
            //if proffix model needed
            _ProffixModel = model;

            //load proffix product
            ProffixLAGArtikelModel oLAGArtikel =
                StorageOperator.GetProffixLAGArtikelModel(model.LAGDokumenteArtikelNrLAG, connectionString);

            if (oLAGArtikel != null)
            {
                string[] oLines = new string[6];
                oLines[0]            = !String.IsNullOrWhiteSpace(oLAGArtikel.ArtikelNrLAG) ? oLAGArtikel.ArtikelNrLAG : "-";
                oLines[1]            = !String.IsNullOrWhiteSpace(oLAGArtikel.Bezeichnung1) ? oLAGArtikel.Bezeichnung1 : "-";
                oLines[2]            = !String.IsNullOrWhiteSpace(oLAGArtikel.Bezeichnung2) ? oLAGArtikel.Bezeichnung2 : "-";
                oLines[3]            = !String.IsNullOrWhiteSpace(oLAGArtikel.Bezeichnung3) ? oLAGArtikel.Bezeichnung3 : "-";
                oLines[4]            = !String.IsNullOrWhiteSpace(oLAGArtikel.Bezeichnung4) ? oLAGArtikel.Bezeichnung4 : "-";
                oLines[5]            = !String.IsNullOrWhiteSpace(oLAGArtikel.Bezeichnung5) ? oLAGArtikel.Bezeichnung5 : "-";
                txtProductDesc.Lines = oLines;
            }


            //load proffix supplier
            List <ProffixLAGLieferantenModel> oLAGLieferantenList =
                StorageOperator.GetProffixLAGLieferantenModelList(model.LAGDokumenteArtikelNrLAG, connectionString);

            if (oLAGLieferantenList != null)
            {
                ddSupplier.Properties.Items.Clear();
                //ddSupplier.Properties.Items.Add(new ComboboxItemModel() { Caption = "-", Value = 0 });
                foreach (ProffixLAGLieferantenModel item in oLAGLieferantenList)
                {
                    ddSupplier.Properties.Items.Add(new ComboboxItemModel()
                    {
                        Caption = item.Name, Value = item.LaufNr
                    });
                }
            }

            //load proffix document
            ProffixLAGDokumente oProffixLAGDokumente = StorageOperator.GetProffixLAGDokumente(model.LAGDokumenteArtikelNrLAG, model.CalculationID, connectionString);

            if (oProffixLAGDokumente != null)
            {
                txtRemark.Text = oProffixLAGDokumente.Bemerkungen;
            }

            if (model.IsNew)
            {
                //new from proffix
                dtCreate.EditValue = DateTime.Now;
                btnNew.Enabled     = true;
                btnReset.Enabled   = false;
            }
            else
            {
                //load from proffix
                btnNew.Enabled   = false;
                btnReset.Enabled = true;
            }
        }