Ejemplo n.º 1
0
        public void LoadProffixCalculation(GeneralSettingModel generalSettingModel, PriceCalculationSetting moduleSetting, string[] arguments)
        {
            //ProffixResult oResult = new ProffixResult(arguments);

            //if (arguments != null)
            //{
            //    if (arguments.Length == 2)
            //    {
            //        if (arguments[1].TrimStart().TrimEnd().Trim().StartsWith("opencal"))
            //        {
            //            //new or load
            //            string[] sSubParam = arguments[1].Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);

            //            if (sSubParam.Length == 2)
            //            {
            //                //new
            //                NewCalculation(generalSettingModel, moduleSetting, sSubParam[1]);
            //            }
            //            else if (sSubParam.Length > 2)
            //            {
            //                //load
            //            }
            //        }
            //    }
            //}
        }
Ejemplo n.º 2
0
 void ReloadPriceCalculationSetting(bool refresh)
 {
     //load module settings
     if (refresh)
     {
         _PriceCalculationSetting = ApplicationOperator.GetPriceCalculationSetting();
     }
 }
Ejemplo n.º 3
0
        public void LoadCalculation(CalculationModel model, PriceCalculationSetting moduleSetting)
        {
            model.ProffixConnection = moduleSetting.ProffixConnection;

            _Model = model;

            //setup everythings
            SetUpCalculation();
        }
Ejemplo n.º 4
0
        public static PriceCalculationSetting GetPriceCalculationSetting()
        {
            PriceCalculationSetting priceCalculationSetting = null;

            GetDeserialize <PriceCalculationSetting>(priceCalculationSettingPath, ref priceCalculationSetting);

            if (priceCalculationSetting == null)
            {
                return(new PriceCalculationSetting());
            }

            return(priceCalculationSetting);
        }
Ejemplo n.º 5
0
        public void NewCalculation(GeneralSettingModel generalSettingModel, PriceCalculationSetting moduleSetting)
        {
            _Model = new CalculationModel()
            {
                //set new id is zero
                ID                   = 0,
                GeneralSetting       = generalSettingModel,
                ProffixConnection    = moduleSetting.ProffixConnection,
                CalculationNotes     = new List <CalculationNoteModel>(),
                CalculationViewItems = new List <CalculationItemModel>(),
                ProffixModel         = generalSettingModel.ProffixModel
            };

            //setup new calculation
            _Model.SetBasicCalculationNote();
            _Model.SetScaleCalculationNote(moduleSetting.PriceSetting, _Model.CalculationNotes.First().CalculationItems.Last().ItemOrder);
            _Model.SetMarginCalculationNote();

            //setup everythings
            SetUpCalculation();
        }
Ejemplo n.º 6
0
 public static void SavePriceCalculationSetting(PriceCalculationSetting priceCalculationSettin)
 {
     SeSerialize <PriceCalculationSetting>(priceCalculationSettingPath, priceCalculationSettin);
 }
Ejemplo n.º 7
0
 public SettingCtrl()
 {
     InitializeComponent();
     _Setting = ApplicationOperator.GetPriceCalculationSetting();
 }