private void DisplayOriginalDir() { BasicSettingEntity entity = BasicSettingBLL.Instance.GetBySettingKey(adMonitorDIRName); this.lblMessage.Text = entity.SettingValue; this.btnSave.Enabled = false; }
/// <summary> /// 计算具体的费用 /// </summary> /// <param name="costFormularKey"></param> /// <param name="salarySummary"></param> /// <returns></returns> private static decimal CalculateCostDetails(Guid costFormularKey, SalarySummaryEntity salarySummary) { decimal result = 0M; CostFormularEntity formularEntity = CostFormularBLL.Instance.Get(costFormularKey); if (formularEntity == null) { return(0M); } string formularValue = formularEntity.CostFormularValue; if (string.IsNullOrWhiteSpace(formularValue) == false) { List <string> costElementList = StringHelper.GetPlaceHolderList(formularValue, "{", "}"); foreach (string costElement in costElementList) { string placeHolderContent = string.Empty; switch (costElement) { case "NeedPaySalary": placeHolderContent = salarySummary.SalaryNeedPayBeforeCost.ToString(); break; case "RealPaySalary": placeHolderContent = salarySummary.SalaryNeedPayToLabor.ToString(); break; default: { BasicSettingEntity basicSettingEntity = CostList.Find(w => w.SettingKey == costElement); if (basicSettingEntity != null) { placeHolderContent = basicSettingEntity.SettingValue; } break; } } string placeHolder = "{" + costElement + "}"; formularValue = formularValue.Replace(placeHolder, placeHolderContent); } try { RPN rpn = new RPN(); if (rpn.Parse(formularValue)) { result = Convert.ToDecimal(rpn.Evaluate()); } } catch { result = 0; } } return(result); }
public ActionResult BasicSetting(int settingID) { BasicSettingEntity basicSettingEntity = BasicSettingEntity.Empty; if (settingID > 0) { basicSettingEntity = BasicSettingBLL.Instance.Get(settingID); } return(View(basicSettingEntity)); }
public ActionResult BasicSetting(int settingID, BasicSettingEntity settingInfo) { LogicStatusInfo statusInfo = new LogicStatusInfo(); BasicSettingEntity basicSettingEntity = BasicSettingEntity.Empty; if (settingID > 0) { basicSettingEntity = BasicSettingBLL.Instance.Get(settingID); basicSettingEntity.SettingValue = settingInfo.SettingValue; basicSettingEntity.OrderNumber = settingInfo.OrderNumber; statusInfo.IsSuccessful = BasicSettingBLL.Instance.Update(basicSettingEntity); } return Json(statusInfo); }
public ActionResult BasicSetting(int settingID, string SettingValue) { LogicStatusInfo statusInfo = new LogicStatusInfo(); BasicSettingEntity basicSettingEntity = BasicSettingEntity.Empty; if (settingID > 0) { basicSettingEntity = BasicSettingBLL.Instance.Get(settingID); basicSettingEntity.SettingValue = SettingValue; statusInfo.IsSuccessful = BasicSettingBLL.Instance.Update(basicSettingEntity); } return(Json(statusInfo)); }
protected override void OnSave(HiLand.Utility.Event.EventArgs<EventControlEntity> eventArgs) { base.OnSave(eventArgs); this.originalDir = this.newDir; BasicSettingEntity entity = new BasicSettingEntity(); entity.CanUsable = Logics.True; entity.DisplayName = "监控目录"; entity.SettingID = 1; entity.SettingKey = adMonitorDIRName; entity.SettingValue = this.newDir; bool isSuccessful= BasicSettingBLL.Instance.Update(entity); eventArgs.Data.Token = isSuccessful; eventArgs.Data.DelayOperationSecond = 3; }
protected override void OnSave(HiLand.Utility.Event.EventArgs <EventControlEntity> eventArgs) { base.OnSave(eventArgs); this.originalDir = this.newDir; BasicSettingEntity entity = new BasicSettingEntity(); entity.CanUsable = Logics.True; entity.DisplayName = "监控目录"; entity.SettingID = 1; entity.SettingKey = adMonitorDIRName; entity.SettingValue = this.newDir; bool isSuccessful = BasicSettingBLL.Instance.Update(entity); eventArgs.Data.Token = isSuccessful; eventArgs.Data.DelayOperationSecond = 3; }