public Model.Management.Master.SiteMaster_stm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { SiteMaster_stm_Info info = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { string iRecordId = string.Empty; foreach (var id in commandInfo.KeyInfoList) { iRecordId = id.KeyValue; break; } IQueryable <SiteMaster_stm> taQuery = (from stms in db.SiteMaster_stms where stms.stm_iRecordID > Convert.ToInt32(iRecordId) orderby stms.stm_iRecordID ascending select stms).Take(1); if (taQuery.Count() > 0) { foreach (var t in taQuery) { info = Common.General.CopyObjectValue <SiteMaster_stm, SiteMaster_stm_Info>(t); } } return(info); } } catch (Exception Ex) { return(info); } }
public Model.SysMaster.DepartmentMaster_dpm_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { Model.SysMaster.DepartmentMaster_dpm_Info info = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { string iRecordId = string.Empty; foreach (var id in commandInfo.KeyInfoList) { iRecordId = id.KeyValue; break; } IQueryable <DepartmentMaster_dpm> taQuery = (from dpms in db.DepartmentMaster_dpms where dpms.dpm_iRecordID < Convert.ToInt32(iRecordId) orderby dpms.dpm_iRecordID descending select dpms).Take(1); if (taQuery.Count() > 0) { foreach (var t in taQuery) { info = Common.General.CopyObjectValue <DepartmentMaster_dpm, model.DepartmentMaster_dpm_Info>(t); } } return(info); } } catch (Exception Ex) { return(info); } }
public Sys_FormMaster_fom_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { Sys_FormMaster_fom_Info info = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { string iRecordId = string.Empty; foreach (var id in commandInfo.KeyInfoList) { iRecordId = id.KeyValue; break; } IQueryable <Sys_FormMaster_fom> taQuery = (from ta in db.Sys_FormMaster_foms where ta.fom_iRecordID > Convert.ToInt32(iRecordId) orderby ta.fom_iRecordID ascending select ta).Take(1); if (taQuery.Count() > 0) { foreach (var t in taQuery) { info = Common.General.CopyObjectValue <Sys_FormMaster_fom, Sys_FormMaster_fom_Info>(t); FindFormPurview(info); } } return(info); } } catch (Exception Ex) { return(info); } }
public VegetableSpeciesMaster_vsm_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { VegetableSpeciesMaster_vsm_Info vegetableSpeciesMasterInfo = null; if (commandInfo != null && commandInfo.KeyInfoList != null && commandInfo.KeyInfoList[0] != null && commandInfo.KeyInfoList[0].KeyValue != "") { try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { VegetableSpeciesMaster_vsm vegetableSpecies = (from t in db.VegetableSpeciesMaster_vsm where t.vsm_iSeq < Convert.ToInt32(commandInfo.KeyInfoList[0].KeyValue) orderby t.vsm_iSeq descending select t).FirstOrDefault(); if (vegetableSpecies != null) { vegetableSpeciesMasterInfo = Common.General.CopyObjectValue <VegetableSpeciesMaster_vsm, VegetableSpeciesMaster_vsm_Info>(vegetableSpecies); } } } catch (Exception Ex) { throw Ex; } } return(vegetableSpeciesMasterInfo); }
public CodeMaster_cmt_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { try { return(_codeMasterDA.GetRecord_Next(commandInfo)); } catch (Exception Ex) { throw Ex; } }
public BuildingMaster_bdm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { BuildingMaster_bdm_Info info = null; try { info = this._buildingMasterDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); }
public Model.Management.Master.SchoolMaster_scm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { SchoolMaster_scm_Info info = null; try { info = this._schoolMasterDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); }
public DataRightsRole_drr_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { if (commandInfo.KeyInfoList == null) { return(null); } else { try { return(this._dataRightsRoleDA.GetRecord_Next(commandInfo)); } catch (Exception Ex) { throw Ex; } } }
public Model.Management.Master.SchoolMaster_scm_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { string RecordID = null; IQueryable <SchoolMaster_scm> taQuery = null; Model.Management.Master.SchoolMaster_scm_Info tab = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { if (commandInfo.KeyInfoList != null) { //foreach (var t in commandInfo.KeyInfoList) //{ // if (t.Key == "scm_iRecordID") // { // RecordID = t.KeyValue.ToString(); // break; // } //} RecordID = commandInfo.KeyInfoList[0].KeyValue.ToString(); taQuery = (from ta in db.SchoolMaster_scm where ta.scm_iRecordID < Convert.ToInt32(RecordID) orderby ta.scm_iRecordID descending select ta).Take(1); if (taQuery.Count() > 0) { foreach (SchoolMaster_scm t in taQuery) { tab = Common.General.CopyObjectValue <SchoolMaster_scm, SchoolMaster_scm_Info>(t); break; } } } } } catch (Exception Ex) { throw Ex; } return(tab); }
public CardUserMaster_cus_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { CardUserMaster_cus_Info info = null; try { info = this._cardUserMasterDA.GetRecord_Previous(commandInfo); if (info != null) { GetPhoto(info); } } catch (Exception Ex) { throw Ex; } return(info); }
public CodeMaster_cmt_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { CodeMaster_cmt_Info info; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { CodeMaster_cmt query = db.CodeMaster_cmts .Where(t => t.cmt_iRecordID > Convert.ToInt32(commandInfo.KeyInfoList[0].KeyValue)) .OrderBy(t => t.cmt_iRecordID) .FirstOrDefault(); info = Common.General.CopyObjectValue <CodeMaster_cmt, CodeMaster_cmt_Info>(query); } } catch (Exception Ex) { throw Ex; } return(info); }
public Sys_UserPurview_usp_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { Sys_UserPurview_usp_Info info = null; if (commandInfo.KeyInfoList == null) { return(info); } else { try { info = this._userPurviewDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); } }
public Model.Management.Master.SiteMaster_stm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { SiteMaster_stm_Info info = null; if (commandInfo.KeyInfoList == null) { return(info); } else { try { info = this._isteMasterDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); } }
public DepartmentMaster_dpm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { DepartmentMaster_dpm_Info info = null; if (commandInfo.KeyInfoList == null) { return(info); } else { try { info = this._departmentMasterDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); } }
public Sys_RoleMaster_rlm_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { Sys_RoleMaster_rlm_Info info = null; if (commandInfo.KeyInfoList == null) { return(info); } else { try { info = this._sysRoleMasterDA.GetRecord_Previous(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); } }
public Sys_FormMaster_fom_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { Sys_FormMaster_fom_Info info = null; if (commandInfo.KeyInfoList == null) { return(info); } else { try { info = this._sysFormMasterDA.GetRecord_Next(commandInfo); } catch (Exception Ex) { throw Ex; } return(info); } }
public Sys_UserPurview_usp_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { Sys_UserPurview_usp_Info info = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { string iRecordId = string.Empty; foreach (var id in commandInfo.KeyInfoList) { iRecordId = id.KeyValue; break; } IQueryable <Sys_UserPurview_usp> taQuery = (from ta in db.Sys_UserPurview_usps where ta.usp_iRecordID < Convert.ToInt32(iRecordId) orderby ta.usp_iRecordID descending select ta).Take(1); if (taQuery.Count() > 0) { foreach (var t in taQuery) { info = Common.General.CopyObjectValue <Sys_UserPurview_usp, Sys_UserPurview_usp_Info>(t); FindUser(info); FindRole(info); FindFunction(info); } } return(info); } } catch (Exception Ex) { return(info); } }
public DataRightsRole_drr_Info GetRecord_Previous(Model.Base.DataBaseCommandInfo commandInfo) { DataRightsRole_drr_Info info = null; try { using (VPMSDBDataContext db = new VPMSDBDataContext()) { string iRecordId = string.Empty; foreach (var id in commandInfo.KeyInfoList) { iRecordId = id.KeyValue; break; } IQueryable <DataRightsRole_drr> taQuery = (from ta in db.DataRightsRole_drrs where ta.drr_iRecordID < Convert.ToInt32(iRecordId) orderby ta.drr_iRecordID descending select ta).Take(1); if (taQuery.Count() > 0) { foreach (var t in taQuery) { info = Common.General.CopyObjectValue <DataRightsRole_drr, DataRightsRole_drr_Info>(t); GetTeacherList(info); GetClassList(info); } } return(info); } } catch (Exception Ex) { return(info); } }
private void ToolBar_BtnDeleteClick(object sender, EventArgs e) { this.EditState = DefineConstantValue.EditStateEnum.OE_Delete; Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo(); Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo(); Model.Base.DataBaseCommandKeyInfo comkey = new Model.Base.DataBaseCommandKeyInfo(); Sys_UserMaster_usm_Info Info = new Sys_UserMaster_usm_Info(); try { comkey.KeyValue = iRecordID; if (comkey.KeyValue != string.Empty && comkey.KeyValue != "0") { Info.usm_iRecordID = Convert.ToInt32(comkey.KeyValue); _sysUserMasterBL.Save(Info, Common.DefineConstantValue.EditStateEnum.OE_Delete); SetOpenToolBar(); Handel(Common.DefineConstantValue.GetReocrdEnum.GR_Next); if (Info.usm_iRecordID == int.Parse(iRecordID)) { Handel(DefineConstantValue.GetReocrdEnum.GR_Previous); } if (Info.usm_iRecordID == int.Parse(iRecordID)) { SetOpenToolBar(); ToolBar.BtnPreviousEnabled = false; ToolBar.BtnLastEnabled = false; ToolBar.BtnFirstEnabled = false; ToolBar.BtnNextEnabled = false; ToolBar.BtnModifyEnabled = false; ToolBar.BtnDeleteEnabled = false; ToolBar.BtnSearchEnabled = false; } } } catch (Exception Ex) { ShowErrorMessage(Ex); } }
private void Handel(Common.DefineConstantValue.GetReocrdEnum type) { Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo(); Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo(); Model.Base.DataBaseCommandKeyInfo comkey = new Model.Base.DataBaseCommandKeyInfo(); comkey.KeyValue = iRecordID; com.KeyInfoList.Add(comkey); Sys_UserMaster_usm_Info info = null; switch (type) { case Common.DefineConstantValue.GetReocrdEnum.GR_First: try { info = _sysUserMasterBL.GetRecord_First(); if (info.usm_iRecordID != 0) { ShowInfo(info); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } else { ToolBar.BtnModifyEnabled = false; ToolBar.BtnDeleteEnabled = false; ToolBar.BtnLastEnabled = false; ToolBar.BtnNextEnabled = false; ToolBar.BtnSearchEnabled = false; txtcName.Text = string.Empty; //txtcNumber.Text = string.Empty; txtcRemark.Text = string.Empty; lvwMaster.Items.Clear(); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } } catch (Exception Ex) { ShowErrorMessage(Ex); } break; case Common.DefineConstantValue.GetReocrdEnum.GR_Next: try { info = _sysUserMasterBL.GetRecord_Next(com); if (info == null) { Handel(DefineConstantValue.GetReocrdEnum.GR_Last); //info = _sysUserMasterBL.GetRecord_Last(); ToolBar.BtnLastEnabled = false; ToolBar.BtnNextEnabled = false; } else { info = _sysUserMasterBL.GetRecord_Next(com); } ShowInfo(info); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } catch (Exception Ex) { ShowErrorMessage(Ex); } break; case Common.DefineConstantValue.GetReocrdEnum.GR_Previous: try { info = _sysUserMasterBL.GetRecord_Previous(com); if (info == null) { info = _sysUserMasterBL.GetRecord_First(); ToolBar.BtnFirstEnabled = false; ToolBar.BtnPreviousEnabled = false; } else { info = _sysUserMasterBL.GetRecord_Previous(com); } ShowInfo(info); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } catch (Exception Ex) { ShowErrorMessage(Ex); } break; case Common.DefineConstantValue.GetReocrdEnum.GR_Last: try { info = _sysUserMasterBL.GetRecord_Last(); if (info.usm_iRecordID != 0) { ShowInfo(info); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } else { ToolBar.BtnFirstEnabled = false; ToolBar.BtnPreviousEnabled = false; ToolBar.BtnModifyEnabled = false; ToolBar.BtnDeleteEnabled = false; ToolBar.BtnLastEnabled = false; ToolBar.BtnNextEnabled = false; ToolBar.BtnSearchEnabled = false; txtcName.Text = string.Empty; //txtcNumber.Text = string.Empty; txtcRemark.Text = string.Empty; lvwMaster.Items.Clear(); SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly); } } catch (Exception Ex) { ShowErrorMessage(Ex); } break; } }
private void SysToolBar_BtnDeleteClick(object sender, EventArgs e) { this.EditState = DefineConstantValue.EditStateEnum.OE_Delete; Model.General.ReturnValueInfo msg = new Model.General.ReturnValueInfo(); Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo(); Model.Base.DataBaseCommandKeyInfo comkey = new Model.Base.DataBaseCommandKeyInfo(); Sys_FormMaster_fom_Info Info = new Sys_FormMaster_fom_Info(); try { comkey.KeyValue = _iRecordID; Info.fom_iParentID = int.Parse(_iRecordID); if (_ISysFormMasterBL.SearchRecords(Info).Count > 0) { msg.messageText = "该表单含有子表单,请先删除子表单!"; ShowInformationMessage(msg.messageText); SetOpenToolBar(); } else { if (comkey.KeyValue != string.Empty && comkey.KeyValue != "0") { Info.fom_iRecordID = Convert.ToInt32(comkey.KeyValue); _ISysFormMasterBL.Save(Info, Common.DefineConstantValue.EditStateEnum.OE_Delete); SetOpenToolBar(); //Handel(Common.DefineConstantValue.GetReocrdEnum.GR_Next); Bind(); BindTreeView(); } } } catch (Exception Ex) { ShowErrorMessage(Ex); } }
public Model.VegetableProduction.Master.VegetableSpeciesMaster_vsm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { throw new NotImplementedException(); }
public Sys_UserMaster_usm_Info GetRecord_Next(Model.Base.DataBaseCommandInfo commandInfo) { throw new NotImplementedException(); }
private void HandelResult_PreviousOrNext(DefineConstantValue.GetReocrdEnum recordState) { CodeMaster_cmt_Info info = new CodeMaster_cmt_Info(); try { Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo(); switch (recordState) { case DefineConstantValue.GetReocrdEnum.GR_Next: com.CommandType = Model.Base.DataBaseCommandType.Next; break; case DefineConstantValue.GetReocrdEnum.GR_Previous: com.CommandType = Model.Base.DataBaseCommandType.Previous; break; default: break; } Model.Base.DataBaseCommandKeyInfo comKey = new Model.Base.DataBaseCommandKeyInfo(); info = _CmtInfo; comKey.KeyValue = _CmtInfo.cmt_iRecordID.ToString(); com.KeyInfoList.Add(comKey); switch (recordState) { case DefineConstantValue.GetReocrdEnum.GR_Next: _CmtInfo = _ICodeMasterBL.GetRecord_Next(com); if (_CmtInfo != null) { SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Middle); } else { SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Last); _CmtInfo = info; } break; case DefineConstantValue.GetReocrdEnum.GR_Previous: _CmtInfo = _ICodeMasterBL.GetRecord_Previous(com); if (_CmtInfo != null) { SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Middle); } else { SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_First); _CmtInfo = info; } break; default: break; } //顯視數據處理 ShowData(_CmtInfo); } catch (Exception Ex) { ShowErrorMessage(Ex); } }
private void ToolBar_BtnDeleteClick(object sender, EventArgs e) { Model.General.ReturnValueInfo returnValue = new Model.General.ReturnValueInfo(); CodeMaster_cmt_Info info = new CodeMaster_cmt_Info(); Model.Base.DataBaseCommandInfo com = new Model.Base.DataBaseCommandInfo(); info.cmt_iRecordID = _CmtInfo.cmt_iRecordID; returnValue = _ICodeMasterBL.Save(info, DefineConstantValue.EditStateEnum.OE_Delete); if (returnValue.boolValue) { com.CommandType = Model.Base.DataBaseCommandType.Next; Model.Base.DataBaseCommandKeyInfo comKey = new Model.Base.DataBaseCommandKeyInfo(); comKey.KeyValue = info.cmt_iRecordID.ToString(); com.KeyInfoList.Add(comKey); try { _CmtInfo = _ICodeMasterBL.GetRecord_Next(com); } catch (Exception Ex) { ShowErrorMessage(Ex); } if (_CmtInfo == null) { com.CommandType = Model.Base.DataBaseCommandType.Previous; try { _CmtInfo = _ICodeMasterBL.GetRecord_Previous(com); } catch (Exception Ex) { ShowErrorMessage(Ex); } ShowData(_CmtInfo); this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly; SetControlStatus(DefineConstantValue.EditStateEnum.OE_ReaOnly); SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Last); if (_CmtInfo == null) { cboKey1.Text = string.Empty; SetToolBarViewState(DefineConstantValue.GetReocrdEnum.GR_Null); } } } }