private void btnRead_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesLendingForm form = new ArchivesLendingForm(Action.Read, Lendarchives.LENDARCHIVESID, checkState); EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.Browse; browser.MinWidth = 495; browser.MinHeight = 270; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); } //if (Lendarchives != null) //{ // ArchivesViewForm form = new ArchivesViewForm(Lendarchives.LENDARCHIVESID); // EntityBrowser browser = new EntityBrowser(form); // browser.MinWidth = 445; // browser.MinHeight = 310; // browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); // browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true); //} //else //{ // ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); //} }
//查询档案能否被更新 public bool IsArchivesCanUpdate(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { return(archivesLendingBll.IsArchivesCanUpdate(archivesLendingInfo)); } }
/// <summary> /// 获取借阅记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void client_GetLendingListByLendingIdCompleted(object sender, GetLendingListByLendingIdCompletedEventArgs e) { try { if (e.Result != null) { lendingArchives = e.Result.ToList().First(); if (actionFlag == DataActionFlag.SubmitFlow) { actionFlag = DataActionFlag.SubmitComplete; //SumbitFlow(); return; } if (action == Action.AUDIT) { //audit.XmlObject = DataObjectToXml<T_OA_LENDARCHIVES>.ObjListToXml(lendingArchives, "OA"); } this.txtTitle.Text = lendingArchives.T_OA_ARCHIVES.ARCHIVESTITLE; this.txtCompany.Text = Utility.GetCompanyName(lendingArchives.T_OA_ARCHIVES.COMPANYID); this.sDate.SelectedDate = lendingArchives.STARTDATE; this.eDate.SelectedDate = lendingArchives.PLANENDDATE; //BindAduitInfo(); if (FormTypeAction == FormTypes.Resubmit) { lendingArchives.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString(); } RefreshUI(RefreshedTypes.AuditInfo); RefreshUI(RefreshedTypes.All); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString()); } }
void dgArchives_CurrentCellChanged(object sender, EventArgs e) { DataGrid grid = sender as DataGrid; if (grid.SelectedItem != null) { Lendarchives = (T_OA_LENDARCHIVES)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体 } }
void dgArchives_CurrentCellChanged(object sender, EventArgs e) { DataGrid grid = sender as DataGrid; if (grid.SelectedItem != null) { Lendarchives = (T_OA_LENDARCHIVES)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体 } }
void dgArchives_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid grid = sender as DataGrid; if (grid.SelectedItems.Count == 0) return; if (grid.SelectedItems.Count > 0 ) { Lendarchives = (T_OA_LENDARCHIVES)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体 } }
/// <summary> /// View调用的Loaded /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Form_Loaded(object sender, RoutedEventArgs e) { switch (action) { case Action.Add: FormTypeAction = FormTypes.New; break; case Action.Edit: FormTypeAction = FormTypes.Edit; break; case Action.AUDIT: FormTypeAction = FormTypes.Audit; break; case Action.Read: FormTypeAction = FormTypes.Browse; break; case Action.ReSubmit: FormTypeAction = FormTypes.Resubmit; break; } InitEvent(); this.sDate.SelectedDate = DateTime.Now; this.eDate.SelectedDate = DateTime.Now.AddDays(7); if (action != Action.Add) { if (action == Action.AUDIT) { actionFlag = DataActionFlag.SubmitComplete; } InitData(); } else { lendingArchives = new T_OA_LENDARCHIVES(); lendingArchives.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString(); } if (checkstate != ((int)CheckStates.UnSubmit).ToString() && checkstate != ((int)CheckStates.UnApproved).ToString()) //只有未提交和未通过才能修改 { if (action != Action.Add) { SetReadOnly(); } } else { if (action != Action.AUDIT || action != Action.Read) { SetToolBar(); } } }
void dgArchives_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid grid = sender as DataGrid; if (grid.SelectedItems.Count == 0) { return; } if (grid.SelectedItems.Count > 0) { Lendarchives = (T_OA_LENDARCHIVES)grid.SelectedItems[0];//获取当前选中的行数据并转换为对应的实体 } }
//新增档案借阅信息 public string AddArchivesLending(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { string returnStr = ""; if (!archivesLendingBll.AddArchivesLending(archivesLendingInfo)) { returnStr = "添加数据失败"; } return(returnStr); } }
//新增档案借阅信息 public string AddArchivesReturn(T_OA_LENDARCHIVES archivesObj) { using (ArchivesReturnBll archivesReturnBll = new ArchivesReturnBll()) { string returnStr = ""; if (!archivesReturnBll.AddArchivesReturn(archivesObj)) { returnStr = "归还失败"; } return(returnStr); } }
/// <summary> /// View调用的Loaded /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Form_Loaded(object sender, RoutedEventArgs e) { switch (action) { case Action.Add: FormTypeAction = FormTypes.New; break; case Action.Edit: FormTypeAction = FormTypes.Edit; break; case Action.AUDIT: FormTypeAction = FormTypes.Audit; break; case Action.Read: FormTypeAction = FormTypes.Browse; break; case Action.ReSubmit: FormTypeAction = FormTypes.Resubmit; break; } InitEvent(); this.sDate.SelectedDate = DateTime.Now; this.eDate.SelectedDate = DateTime.Now.AddDays(7); if (action != Action.Add) { if (action == Action.AUDIT) { actionFlag = DataActionFlag.SubmitComplete; } InitData(); } else { lendingArchives = new T_OA_LENDARCHIVES(); lendingArchives.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString(); } if (checkstate != ((int)CheckStates.UnSubmit).ToString() && checkstate != ((int)CheckStates.UnApproved).ToString()) //只有未提交和未通过才能修改 { if (action != Action.Add) { SetReadOnly(); } } else { if (action != Action.AUDIT || action != Action.Read) { SetToolBar(); } } }
private void searchFrm_Closed(object sender, EventArgs e) { if (searchFrm.returnValue != null) { if (action == Action.Add) { lendingArchives = new T_OA_LENDARCHIVES(); } //archiveLending.archives.ARCHIVESID = searchFrm.returnValue.archivesID; //archiveLending.archives.COMPANYID = searchFrm.returnValue.companyID; lendingArchives.T_OA_ARCHIVES = searchFrm.returnValue; this.txtCompany.Text = Utility.GetCompanyName(searchFrm.returnValue.COMPANYID); this.txtTitle.Text = searchFrm.returnValue.ARCHIVESTITLE; } }
//更新档案借阅信息 public string UpdateArchivesLending(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { string returnStr = ""; if (!archivesLendingBll.UpdateArchivesLending(archivesLendingInfo)) { returnStr = "更新数据失败"; } //} return(returnStr); } }
void BtnView_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesLendingForm form = new ArchivesLendingForm(Action.Read, Lendarchives.LENDARCHIVESID, "2");// 归还为审核通过 所以传值 2 EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.Browse; browser.MinWidth = 445; browser.MinHeight = 310; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); } }
//归还 private void FrmArchivesReturn_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesReturnForm form = new ArchivesReturnForm(Lendarchives.LENDARCHIVESID); EntityBrowser browser = new EntityBrowser(form); browser.Width = 450; browser.Height = 280; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "RETURN"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } }
private void client_GetLendingListByLendingIdCompleted(object sender, GetLendingListByLendingIdCompletedEventArgs e) { try { if (e.Result != null) { lendingArchives = e.Result.ToList().First(); this.txtTitle.Text = lendingArchives.T_OA_ARCHIVES.ARCHIVESTITLE; this.txtCompany.Text = Utility.GetCompanyName(lendingArchives.T_OA_ARCHIVES.COMPANYID); this.sDate.SelectedDate = lendingArchives.STARTDATE; this.eDate.SelectedDate = lendingArchives.PLANENDDATE; BindAduitInfo(); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString()); } }
//新增档案借阅信息 public string AddArchivesLending(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { string returnStr = ""; if (!archivesLendingBll.AddArchivesLending(archivesLendingInfo)) { returnStr = "添加数据失败"; } return returnStr; } }
/// <summary> /// 获取借阅记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void client_GetLendingListByLendingIdCompleted(object sender, GetLendingListByLendingIdCompletedEventArgs e) { try { if (e.Result != null) { lendingArchives = e.Result.ToList().First(); if (actionFlag == DataActionFlag.SubmitFlow) { actionFlag = DataActionFlag.SubmitComplete; //SumbitFlow(); return; } if (action == Action.AUDIT) { //audit.XmlObject = DataObjectToXml<T_OA_LENDARCHIVES>.ObjListToXml(lendingArchives, "OA"); } this.txtTitle.Text = lendingArchives.T_OA_ARCHIVES.ARCHIVESTITLE; this.txtCompany.Text = Utility.GetCompanyName(lendingArchives.T_OA_ARCHIVES.COMPANYID); this.sDate.SelectedDate = lendingArchives.STARTDATE; this.eDate.SelectedDate = lendingArchives.PLANENDDATE; //BindAduitInfo(); if (FormTypeAction == FormTypes.Resubmit) { lendingArchives.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString(); } RefreshUI(RefreshedTypes.AuditInfo); RefreshUI(RefreshedTypes.All); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString()); } }
private void client_GetLendingListByLendingIdCompleted(object sender, GetLendingListByLendingIdCompletedEventArgs e) { try { if (e.Result != null) { lendingArchives = e.Result.ToList().First(); this.txtTitle.Text = lendingArchives.T_OA_ARCHIVES.ARCHIVESTITLE; this.txtCompany.Text = Utility.GetCompanyName(lendingArchives.T_OA_ARCHIVES.COMPANYID); this.sDate.SelectedDate = lendingArchives.STARTDATE; this.eDate.SelectedDate = lendingArchives.PLANENDDATE; BindAduitInfo(); } } catch (Exception ex) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), ex.Message.ToString()); } }
//新增档案借阅信息 public string AddArchivesReturn(T_OA_LENDARCHIVES archivesObj) { using (ArchivesReturnBll archivesReturnBll = new ArchivesReturnBll()) { string returnStr = ""; if (!archivesReturnBll.AddArchivesReturn(archivesObj)) { returnStr = "归还失败"; } return returnStr; } }
//查询档案能否被更新 public bool IsArchivesCanUpdate(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { return archivesLendingBll.IsArchivesCanUpdate(archivesLendingInfo); } }
private void btnRefresh_Click(object sender, RoutedEventArgs e) { Lendarchives = null; LoadData(); }
//归还 private void FrmArchivesReturn_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesReturnForm form = new ArchivesReturnForm(Lendarchives.LENDARCHIVESID); EntityBrowser browser = new EntityBrowser(form); browser.Width = 450; browser.Height = 280; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "RETURN"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } }
private void btnRead_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesLendingForm form = new ArchivesLendingForm(Action.Read, Lendarchives.LENDARCHIVESID, checkState); EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.Browse; browser.MinWidth = 495; browser.MinHeight = 270; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); } //if (Lendarchives != null) //{ // ArchivesViewForm form = new ArchivesViewForm(Lendarchives.LENDARCHIVESID); // EntityBrowser browser = new EntityBrowser(form); // browser.MinWidth = 445; // browser.MinHeight = 310; // browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); // browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }, true); //} //else //{ // ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); //} }
private void btnRefresh_Click(object sender, RoutedEventArgs e) { Lendarchives = null; LoadData(); }
//更新档案借阅信息 public string UpdateArchivesLending(T_OA_LENDARCHIVES archivesLendingInfo) { using (ArchivesLendingBll archivesLendingBll = new ArchivesLendingBll()) { string returnStr = ""; if (!archivesLendingBll.UpdateArchivesLending(archivesLendingInfo)) { returnStr = "更新数据失败"; } //} return returnStr; } }
void BtnView_Click(object sender, RoutedEventArgs e) { if (Lendarchives != null) { ArchivesLendingForm form = new ArchivesLendingForm(Action.Read, Lendarchives.LENDARCHIVESID, "2");// 归还为审核通过 所以传值 2 EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.Browse; browser.MinWidth = 445; browser.MinHeight = 310; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); Lendarchives = null; } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "VIEW"), Utility.GetResourceStr("CONFIRMBUTTON")); } }
private void searchFrm_Closed(object sender, EventArgs e) { if (searchFrm.returnValue != null) { if (action == Action.Add) { lendingArchives = new T_OA_LENDARCHIVES(); } //archiveLending.archives.ARCHIVESID = searchFrm.returnValue.archivesID; //archiveLending.archives.COMPANYID = searchFrm.returnValue.companyID; lendingArchives.T_OA_ARCHIVES = searchFrm.returnValue; this.txtCompany.Text = Utility.GetCompanyName(searchFrm.returnValue.COMPANYID); this.txtTitle.Text = searchFrm.returnValue.ARCHIVESTITLE; } }