public crmCostValue GetCostValue(crmCostModel cm, csValuta val) { crmCostValue cv = null; if (cm == null || val == null) { return(null); } foreach (crmCostValue ccv in this.CostItems) { if (ccv.Valuta == val && ccv.CostModel == cm) { cv = ccv; } } if (cv == null) { foreach (crmCostValue ccv in this.CostItems) { if (ccv.Valuta == val) { cv = ccv.Copy(); cv.CostModel = cm; } } if (cv == null) { cv = new crmCostValue(this.Session); cv.CostCol = this; cv.CostModel = cm; cv.Valuta = val; } } return(cv); }
public void UpdateCostAfter(crmCostValue cv) { if (this.CurrentCost == cv) { this.SummCost = this.SummCost + cv.SummCost; this.SummNDS = this.SummNDS + cv.SummNDS; } if (this.UpCol != null) { this.UpCol.UpdateCostAfter(cv); } }
// #endregion #region МЕТОДЫ //public void UpdateCost(crmCostValue sp, Boolean mode) { // this.IsUpdate = true; // if (mode) { // this.SummCost = this.SummCost + sp.SummCost; // this.SummNDS = this.SummNDS + sp.SummNDS; // } // else { // this.SummCost = this.SummCost - sp.SummCost; // this.SummNDS = this.SummNDS - sp.SummNDS; // } // this.IsUpdate = false; //} public void UpdateCostBefore(crmCostValue cv) { if (this.CurrentCost == cv) { this.SummCost = this.SummCost - cv.SummCost; this.SummNDS = this.SummNDS - cv.SummNDS; } if (this.UpCol != null) { this.UpCol.UpdateCostBefore(cv); } }
public void UpdateCost(crmCostValue sp, Boolean mode) { this.IsUpdate = true; if (mode) { this.SummCost = this.SummCost + sp.SummCost; this.SummNDS = this.SummNDS + sp.SummNDS; } else { this.SummCost = this.SummCost - sp.SummCost; this.SummNDS = this.SummNDS - sp.SummNDS; } this.IsUpdate = false; }
// public crmCostValue Copy() { crmCostValue sp = new crmCostValue(this.Session); sp._CostModel = this.CostModel; sp._NDSRate = this.NDSRate; sp._Valuta = this.Valuta; // sp._Stage = this.Stage; // sp._Obligation = this.Obligation; // sp._ObligationUnit = this.ObligationUnit; sp._SummCost = this.SummCost; sp._SummFull = this.SummFull; sp._SummNDS = this.SummNDS; sp._Valuta = this.Valuta; return(sp); }
protected void UpdateStageCostInt(crmCostValue sp, Boolean mode) { //if (CurrentStageCost != null) // CurrentStageCost.UpdatePrice(sp, mode); //UpdateStageCost(sp, mode); }