protected void btnOK_Click(object sender, EventArgs e) { if (!Valid()) { mpeInfo.Show(); return; } try { ExchangeRateEntity entity = new ExchangeRateEntity { Name = txtDialogName.Text.Trim(), Rate = Convert.ToDecimal(txtDialogRate.Text), PKID = hfPKID.Value.SafeToInt(), ActiveDate = txtDialogActiveDate.Text.SafeToDateTime().GetValueOrDefault(), Symbol = txtDialogSymbol.Text.Trim() }; if (entity.PKID > 0) { ExchangeRateLogic.UpdateExchangeRate(entity); } else { ExchangeRateLogic.InsertExchangeRate(entity); } mpeInfo.Hide(); BindDataSource(); } catch (Exception ex) { DialogMessage = "<span class='fontred'>" + ex.Message + "</span>"; mpeInfo.Show(); } }
private void BindDataSource() { var source = ExchangeRateLogic.GetExchangeRateByCondition(txtName.Text.Trim(), txtActiveDate.Text.SafeToDateTime()); gvExchangeRate.DataSource = source; gvExchangeRate.DataBind(); lblMessage.Text = " <span class='font14b'>共查到 </span><span class='fontred'>" + source.Count + "</span><span class='font14b'> 条记录</span>"; }
public void Init(bool isPostBack) { _IReimburseView.Operation = "删除报销单"; _IReimburseView.SetFormReadonly = true; _IReimburseView.SetDetailReadonly = true; AttachViewEvent(); if (!isPostBack) { try { _IReimburseView.Message = string.Empty; _IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll(); Employee employee = _IReimburseFacade.GetEmployeeReimburseByEmployeeID(_LoginUser.Id); hrmisModel.Reimburse reimburse = employee.FindReimburseByReimburseID(_ReimburseID); employee.Account.Name = _LoginUser.Name; _IReimburseView.Employee = employee; _IReimburseView.Reimburse = reimburse; _IReimburseView.ReimburseCategoriesEnumID = reimburse.ReimburseCategoriesEnum.Id.ToString(); _IReimburseView.PaperCount = reimburse.PaperCount.ToString(); _IReimburseView.Destinations = reimburse.Destinations; //_IReimburseView.CustomerName = reimburse.CustomerName; _IReimburseView.ProjectName = reimburse.ProjectName; _IReimburseView.Discription = reimburse.Discription; _IReimburseView.ConsumeDateFrom = reimburse.ConsumeDateFrom.ToShortDateString(); _IReimburseView.ConsumeDateFromHour = reimburse.ConsumeDateFrom.Hour.ToString(); _IReimburseView.ConsumeDateFromMinute = reimburse.ConsumeDateFrom.Minute.ToString(); _IReimburseView.ConsumeDateTo = reimburse.ConsumeDateTo.ToShortDateString(); _IReimburseView.ConsumeDateToHour = reimburse.ConsumeDateTo.Hour.ToString(); _IReimburseView.ConsumeDateToMinute = reimburse.ConsumeDateTo.Minute.ToString(); _IReimburseView.DepartmentName = _LoginUser.Dept.DepartmentName; _IReimburseView.ReimburseItemSource = reimburse.ReimburseItems; _IReimburseView.SetDeleteFormButton = 2; _IReimburseView.ExchangeRateSource = ExchangeRateLogic.GetExchangeRateDistinctName(); _IReimburseView.ExchangeRateID = reimburse.ExchangeRateID; BindReimburseHistorySource(); } catch { _IReimburseView.Message = "初始化信息失败"; } // 差旅报销 if (_IReimburseView.ReimburseCategoriesEnumID == "0") { _IReimburseView.IsTravelReimburse = true; } // 非差旅报销 else if (_IReimburseView.ReimburseCategoriesEnumID == "1") { _IReimburseView.IsTravelReimburse = false; } } }
protected void btnDelete_Click(object sender, CommandEventArgs e) { try { ExchangeRateLogic.DeleteExchangeRate(Convert.ToInt32(e.CommandArgument)); BindDataSource(); } catch (ApplicationException ex) { lblMessage.Text = "<span class='fontred'>" + ex.Message + "</span>"; } }
public void Init(bool isPostBack) { AttachViewEvent(); _IReimburseView.SetFormReadonly = false; _IReimburseView.Operation = "新增报销单"; _IReimburseView.SetOutCityVisible = false; if (!isPostBack) { _IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll(); _IReimburseView.ConsumeDateFrom = DateTime.Now.ToShortDateString(); _IReimburseView.ConsumeDateFromHour = DateTime.Now.Hour.ToString(); _IReimburseView.ConsumeDateFromMinute = DateTime.Now.Minute.ToString(); _IReimburseView.ConsumeDateTo = _IReimburseView.ConsumeDateFrom; _IReimburseView.ConsumeDateToHour = _IReimburseView.ConsumeDateFromHour; _IReimburseView.ConsumeDateToMinute = _IReimburseView.ConsumeDateFromMinute; _IReimburseView.Message = string.Empty; _IReimburseView.Employee = _IEmployeeFacade.GetEmployeeByAccountID(LoginUser.Id); _IReimburseView.DepartmentName = LoginUser.Dept.DepartmentName; _IReimburseView.ApplyDate = DateTime.Now.ToShortDateString(); _IReimburseView.ExchangeRateSource = ExchangeRateLogic.GetExchangeRateDistinctName(); //if (_IReimburseView.ReimburseItemSource == null) //{ _IReimburseView.ReimburseItemSource = new List <hrmisModel.ReimburseItem>(); //} //else //{ // _IReimburseView.ReimburseItemSource = _IReimburseView.ReimburseItemSource; //} _IReimburseView.ReimburseHistorySource = null; } // Add bjl start // 差旅报销 if (_IReimburseView.ReimburseCategoriesEnumID == "0") { _IReimburseView.IsTravelReimburse = true; } // 非差旅报销 else if (_IReimburseView.ReimburseCategoriesEnumID == "1") { _IReimburseView.IsTravelReimburse = false; } // Add bjl end }
protected override void Validation() { _Reimburse = _DalReimburse.GetReimburseByReimburseID(_ReimburseID); if (_Reimburse == null) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Not_Exist); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Added) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Added); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursed) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursed); } else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Return) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Return); } //else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Auditing) //{ // BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Auditing); //} else if (_Reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing) { BllUtility.ThrowException(BllExceptionConst._Reimburse_Has_Reimbursing); } var exchangeRate = ExchangeRateLogic.GetExchangeRateByCondition(_Reimburse.ExchangeRateID, new DateTime(_BillingTime.Year, _BillingTime.Month, 1)); if (exchangeRate == null) { throw new ApplicationException("此月份尚未添加汇率"); } else { _ExchangeRateID = exchangeRate.PKID; } }
protected void btnModify_Click(object sender, CommandEventArgs e) { DialogMessage = string.Empty; hfPKID.Value = e.CommandArgument.ToString(); lblNameMessage.Text = string.Empty; lblRateMessage.Text = string.Empty; lblActiveDateMessage.Text = string.Empty; lblSymbolMessage.Text = string.Empty; lblOperation.Text = "更新汇率信息"; try { var entity = ExchangeRateLogic.GetExchangeRateByPKID(Convert.ToInt32(e.CommandArgument)); txtDialogName.Text = entity.Name; txtDialogRate.Text = entity.Rate.ToString(); txtDialogActiveDate.Text = entity.ActiveDate.ToString("yyyy-MM"); txtDialogSymbol.Text = entity.Symbol; mpeInfo.Show(); } catch (ApplicationException ex) { lblMessage.Text = "<span class='fontred'>" + ex.Message + "</span>"; } }
public void Init(bool isPostBack) { _IEmployeeReimburseView.IReimburseView.Operation = "报销单详情"; //_IEmployeeReimburseView.IReimburseView.SetFormReadonly = true; _IEmployeeReimburseView.IReimburseView.SetComfirmReadonly = true; AttachViewEvent(); if (!isPostBack) { try { //_IEmployeeReimburseView.IReimburseView.Message = string.Empty; //Employee employee = new Employee(); //hrmisModel.Reimburse reimburse = _IReimburseFacade.GetReimburseByPkid(_ReimburseID); //Account account = BllInstance.AccountBllInstance.GetAccountById(reimburse.ApplierID); //employee.Account = new Account(); //employee.Account.Name = account.Name; //_IEmployeeReimburseView.IReimburseView.Employee = employee; //_IEmployeeReimburseView.IReimburseView.Reimburse = reimburse; //_IEmployeeReimburseView.IReimburseView.DepartmentName = reimburse.Department.DepartmentName; //_IEmployeeReimburseView.IReimburseView.ReimburseItemSource = reimburse.ReimburseItems; _IEmployeeReimburseView.IReimburseView.Message = string.Empty; _IEmployeeReimburseView.IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll(); Employee employee = new Employee(); hrmisModel.Reimburse reimburse = _IReimburseFacade.GetReimburseByPkid(_ReimburseID); Account account = BllInstance.AccountBllInstance.GetAccountById(reimburse.ApplierID); employee.Account = new Account(); employee.Account.Name = account.Name; _IEmployeeReimburseView.IReimburseView.Employee = employee; _IEmployeeReimburseView.IReimburseView.Reimburse = reimburse; _IEmployeeReimburseView.IReimburseView.ReimburseCategoriesEnumID = reimburse.ReimburseCategoriesEnum.Id.ToString(); _IEmployeeReimburseView.IReimburseView.PaperCount = reimburse.PaperCount.ToString(); _IEmployeeReimburseView.IReimburseView.Destinations = reimburse.Destinations; //_IEmployeeReimburseView.IReimburseView.CustomerName = _ICustomerInfoFacade.GetCustomerInfoByID(reimburse.CustomerID); _IEmployeeReimburseView.IReimburseView.ProjectName = reimburse.ProjectName; _IEmployeeReimburseView.IReimburseView.Discription = reimburse.Discription; _IEmployeeReimburseView.IReimburseView.ConsumeDateFrom = reimburse.ConsumeDateFrom.ToShortDateString(); _IEmployeeReimburseView.IReimburseView.ConsumeDateFromHour = reimburse.ConsumeDateFrom.Hour.ToString(); _IEmployeeReimburseView.IReimburseView.ConsumeDateFromMinute = reimburse.ConsumeDateFrom.Minute.ToString(); _IEmployeeReimburseView.IReimburseView.ConsumeDateTo = reimburse.ConsumeDateTo.ToShortDateString(); _IEmployeeReimburseView.IReimburseView.ConsumeDateToHour = reimburse.ConsumeDateTo.Hour.ToString(); _IEmployeeReimburseView.IReimburseView.ConsumeDateToMinute = reimburse.ConsumeDateTo.Minute.ToString(); _IEmployeeReimburseView.IReimburseView.DepartmentName = reimburse.Department.DepartmentName; _IEmployeeReimburseView.IReimburseView.ReimburseItemSource = reimburse.ReimburseItems; _IEmployeeReimburseView.IReimburseView.SetFormReadonly = true; _IEmployeeReimburseView.IReimburseView.SetDeleteFormButton = 3; _IEmployeeReimburseView.IReimburseView.ExchangeRateSource = ExchangeRateLogic.GetExchangeRateDistinctName(); _IEmployeeReimburseView.IReimburseView.ExchangeRateID = reimburse.ExchangeRateID; BindReimburseHistorySource(); } catch { _IEmployeeReimburseView.IReimburseView.Message = "初始化信息失败"; } } // 差旅报销 if (_IEmployeeReimburseView.IReimburseView.ReimburseCategoriesEnumID == "0") { _IEmployeeReimburseView.IReimburseView.IsTravelReimburse = true; } // 非差旅报销 else if (_IEmployeeReimburseView.IReimburseView.ReimburseCategoriesEnumID == "1") { _IEmployeeReimburseView.IReimburseView.IsTravelReimburse = false; } }
public void Init(bool isPostBack) { _IReimburseView.Operation = "报销单详情"; _IReimburseView.SetFormReadonly = true; AttachViewEvent(); if (!isPostBack) { try { //_IReimburseView.Message = string.Empty; //Employee employee = _IReimburseFacade.GetEmployeeReimburseByEmployeeID(_Loginuser.Id); //Account account = BllInstance.AccountBllInstance.GetAccountById(_Loginuser.Id); //employee.Account.Name = account.Name; //hrmisModel.Reimburse reimburse = employee.FindReimburseByReimburseID(_ReimburseID); //_IReimburseView.Employee = employee; //_IReimburseView.Reimburse = reimburse; //_IReimburseView.DepartmentName = reimburse.Department.DepartmentName; //_IReimburseView.ReimburseItemSource = reimburse.ReimburseItems; //_IReimburseView.SetDeleteFormButton = true; _IReimburseView.Message = string.Empty; _IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll(); Employee employee = new Employee(); hrmisModel.Reimburse reimburse = _IReimburseFacade.GetReimburseByPkid(_ReimburseID); Account account = BllInstance.AccountBllInstance.GetAccountById(reimburse.ApplierID); employee.Account = new Account(); employee.Account.Name = account.Name; _IReimburseView.Employee = employee; _IReimburseView.Reimburse = reimburse; _IReimburseView.ReimburseCategoriesEnumID = reimburse.ReimburseCategoriesEnum.Id.ToString(); _IReimburseView.PaperCount = reimburse.PaperCount.ToString(); _IReimburseView.Destinations = reimburse.Destinations; int tempCustomerID; //if(int.TryParse(reimburse.CustomerID,out tempCustomerID)) //{ // _IReimburseView.CustomerName = _ICustomerInfoFacade.GetCustomerInfoByID(tempCustomerID).CompanyName; //} _IReimburseView.SetDetailReadonly = true; _IReimburseView.ProjectName = reimburse.ProjectName; _IReimburseView.Discription = reimburse.Discription; _IReimburseView.ConsumeDateFrom = reimburse.ConsumeDateFrom.ToShortDateString(); _IReimburseView.ConsumeDateFromHour = reimburse.ConsumeDateFrom.Hour.ToString(); _IReimburseView.ConsumeDateFromMinute = reimburse.ConsumeDateFrom.Minute.ToString(); _IReimburseView.ConsumeDateTo = reimburse.ConsumeDateTo.ToShortDateString(); _IReimburseView.ConsumeDateToHour = reimburse.ConsumeDateTo.Hour.ToString(); _IReimburseView.ConsumeDateToMinute = reimburse.ConsumeDateTo.Minute.ToString(); _IReimburseView.DepartmentName = reimburse.Department.DepartmentName; _IReimburseView.OutCityAllowance = reimburse.OutCityAllowance.ToString(); _IReimburseView.OutCityDays = reimburse.OutCityDays.ToString(); _IReimburseView.Remark = reimburse.Remark; _IReimburseView.Discription = reimburse.Discription; _IReimburseView.ReimburseItemSource = reimburse.ReimburseItems; _IReimburseView.SetDeleteFormButton = 2; _IReimburseView.ExchangeRateSource = ExchangeRateLogic.GetExchangeRateDistinctName(); _IReimburseView.ExchangeRateID = reimburse.ExchangeRateID; BindReimburseHistorySource(); } catch (Exception ex) { _IReimburseView.Message = ex.Message; } } // 差旅报销 if (_IReimburseView.ReimburseCategoriesEnumID == ReimburseCategoriesEnum.TravelReimburse.Id.ToString()) { _IReimburseView.IsTravelReimburse = true; } // 非差旅报销 else if (_IReimburseView.ReimburseCategoriesEnumID == ReimburseCategoriesEnum.UnTravelReimburse.Id.ToString()) { _IReimburseView.IsTravelReimburse = false; } }
public JsonResult GetUsdAndEurExchangeRates() { List <ExchangeRateViewModel> ratesList = new ExchangeRateLogic().GetUsdAndEurExchangeRates(); return(Json(ratesList, JsonRequestBehavior.AllowGet)); }