protected void btn_admEmployeeTransportationSetting_add_Click(object sender, EventArgs e) { this.lt_akert_msg.Text = ""; //check this empNo is Exist in row FormOptionsSettingViewModel.EmployeeTransportationSettingQueryParameter param = new FormOptionsSettingViewModel.EmployeeTransportationSettingQueryParameter() { desc = true, keyword = "", orderField = "EmpNo", pageIndex = 1, pageSize = int.MaxValue, transType = this.ddl_admEmployeeTransportationSetting_trans_type.SelectedValue, empNo = this.hid_admEmployeeTransportationSetting_emp.Value }; FormOptionsSettingViewModel.ViewEmployeeTransportationSettingListResult list_ret = this.formOptSvc.getViewEmployeeTransportationSettingListResult(param); if (list_ret.count > 0) { this.lt_akert_msg.Text = UtilitySvc.alertMsg("此員工已存在"); return; } EmployeeTransportationSetting ee = new EmployeeTransportationSetting() { DateCreated = DateTime.Now, Deleted = false, EmpNo = this.hid_admEmployeeTransportationSetting_emp.Value, TransId = this.txt_admEmployeeTransportationSetting_transId.Text, TransType = this.ddl_admEmployeeTransportationSetting_trans_type.SelectedValue }; FormOptionsSettingViewModel.ViewEmployeeTransportationSettingResult add_ret = this.formOptSvc.addEmployeeTransportationSetting(ee); if (add_ret.success) { this.lt_akert_msg.Text = UtilitySvc.alertMsg("新增成功"); } else { this.lt_akert_msg.Text = UtilitySvc.alertMsg(add_ret.resultException); } }
protected void reload() { this.lt_akert_msg.Text = ""; string pg_str = Request.QueryString["pg"] as string; pg_str = string.IsNullOrEmpty(pg_str) ? "1" : pg_str; int pg_int = 1; int.TryParse(pg_str, out pg_int); int pageSize = 15; FormOptionsSettingViewModel.EmployeeTransportationSettingQueryParameter param = new FormOptionsSettingViewModel.EmployeeTransportationSettingQueryParameter() { desc = true, keyword = this.txt_admEmployeeTransportationSetting_emp_search_keyword.Text, orderField = "EmpNo", pageIndex = pg_int, pageSize = pageSize, transType = "" }; FormOptionsSettingViewModel.ViewEmployeeTransportationSettingListResult list_ret = this.formOptSvc.getViewEmployeeTransportationSettingListResult(param); List <page_viewEmployeeTransationSetting> view_list = new List <page_viewEmployeeTransationSetting>(); foreach (var v in list_ret.list) { view_list.Add(new page_viewEmployeeTransationSetting(v)); } this.rpt_admEmployeeTransportationSetting_list.DataSource = view_list; this.rpt_admEmployeeTransportationSetting_list.DataBind(); this.component_pager.queryString = "pg"; this.component_pager.pageSize = pageSize; this.component_pager.showPageItem = 5; this.component_pager.currentPage = pg_int; this.component_pager.count = list_ret.count; this.component_pager.load(); this.component_pager.DataBind(); }
/// <summary> /// 捯 /// </summary> /// <param name="param"></param> /// <returns></returns> public FormOptionsSettingViewModel.ViewEmployeeTransportationSettingListResult getViewEmployeeTransportationSettingListResult(FormOptionsSettingViewModel.EmployeeTransportationSettingQueryParameter param) { FormOptionsSettingViewModel.ViewEmployeeTransportationSettingListResult ret = new FormOptionsSettingViewModel.ViewEmployeeTransportationSettingListResult(); try { ret.success = true; ret.resultCode = "200"; Tuple <List <ViewEmployeeTransportationSetting>, int> tuple_list = this.formOptionSettingDao.getViewEmployeeTransportationSettingList(param); ret.list = tuple_list.Item1; ret.count = tuple_list.Item2; } catch (Exception ex) { ret.success = false; ret.resultException = ex.ToString(); ret.resultCode = "500"; } return(ret); }