//select distinct(Section) from Dept where Dept=[Dept] //union //select 'SMT1A' //union //select 'SMT1B' public IList<string> GetSectionList(DeptInfo condition) { IList<string> result = new List<string>(); try { IMBRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); result = itemRepository.GetSectionList(condition); } catch (Exception) { throw; } return result; }
//select * from Dept //where Dept = [Dept] //and Section like '[Section]%' //order by Dept, Section, Line, FISLine public IList<DeptInfo> GetLineList(DeptInfo eqCondition, DeptInfo likeCondition) { IList<DeptInfo> result = new List<DeptInfo>(); try { IMBRepository iMBRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); /* DeptInfo deptCondition = new DeptInfo(); deptCondition.dept = eqCondition.dept; DeptInfo deptlikeCondition = new DeptInfo(); deptlikeCondition.section = likeCondition.section + "%";*/ result = iMBRepository.GetSectionList(eqCondition, likeCondition); } catch (Exception) { throw; } return result; }
public void initMaintainSection() { if (iDept != null) { IList<string> lstMaintainSection = null; DeptInfo deptCondition = new DeptInfo(); deptCondition.dept = dept; lstMaintainSection = iDept.GetSectionList(deptCondition); //Console.Write(lstMaintainLineStage.Count); if (lstMaintainSection != null && lstMaintainSection.Count != 0) { initControl(lstMaintainSection); } else { initControl(null); } } else { initControl(null); } }
public DataTable GetLine(string line) { DeptInfo condition =new DeptInfo(); // condition.line = line; DataTable tmp ; try { tmp = repMB.GetRemarkAndLineFromDept(condition); } catch (Exception ee) { logger.Error(ee.Message); throw ee; } return tmp; }
protected void btnDelete_ServerClick(Object sender, EventArgs e) { string olddept = this.dOldDept.Value.Trim(); string oldsection = this.dOldSection.Value.Trim(); string oldline = this.dOldLine.Value.Trim(); DeptInfo depttemp = new DeptInfo(); depttemp.dept = olddept.ToUpper(); depttemp.section = oldsection.ToUpper(); depttemp.line = oldline.ToUpper(); try { iDept.DeleteDeptInfo(depttemp); } catch (FisException ex) { showErrorMessage(ex.mErrmsg); return; } catch (Exception ex) { //show error showErrorMessage(ex.Message); return; } ShowLineList(); this.updatePanel.Update(); ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DeleteComplete();DealHideWait();", true); }
protected void btnSave_ServerClick(Object sender, EventArgs e) { DeptInfo item = new DeptInfo(); item.dept = this.cmbMaintainDept.InnerDropDownList.SelectedValue.Trim(); item.section = this.cmbMaintainSection.InnerDropDownList.SelectedValue.Trim(); item.line = this.txtLine.Text.Trim().ToUpper(); item.fisline = this.txtFISLine.Text.Trim().ToUpper(); item.startTime = this.txtStart.Text.Trim().ToUpper(); item.endTime = this.txtEnd.Text.Trim(); item.remark = this.txtRemark.Text.Trim(); item.editor = userName; string oldItemDept = this.dOldDept.Value.Trim(); string oldItemSection = this.dOldSection.Value.Trim(); string oldItemLine = this.dOldLine.Value.Trim(); DeptInfo olditem = new DeptInfo(); olditem.dept = oldItemDept; olditem.section = oldItemSection; olditem.line = oldItemLine.ToUpper(); string itemId = ""; try { if ((oldItemDept == item.dept) && (oldItemSection == item.section) && (oldItemLine == item.line)) { //UpdateDeptInfo(DeptInfo setValue, DeptInfo condition) itemId =this.dOldID.Value.Trim(); iDept.UpdateDeptInfo(item, olditem); } else { //AddDeptInfo(DeptInfo item) itemId = iDept.AddDeptInfo(item); } } catch (FisException ex) { showErrorMessage(ex.mErrmsg); return; } catch (Exception ex) { //show error showErrorMessage(ex.Message); return; } ShowLineList(); this.updatePanel.Update(); String script = "<script language='javascript'> AddUpdateComplete('" + itemId + "'); </script>"; ScriptManager.RegisterStartupScript(this.updatePanelAll, ClientScript.GetType(), "saveUpdate", script, false); //ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + itemId + "');", true); }
private Boolean ShowAllLineList() { try { IList<string> lstMaintainDept = null; lstMaintainDept = iDept.GetDeptList(); DeptInfo dept = new DeptInfo(); dept.dept = lstMaintainDept[0]; List<DeptInfo> dataList = null; dataList = (List<DeptInfo>)iDept.GetDeptInfoList(dept); if (dataList == null) { bindTable(null, DEFAULT_ROWS); } else { bindTable(dataList, DEFAULT_ROWS); } } catch (FisException ex) { bindTable(null, DEFAULT_ROWS); showErrorMessage(ex.mErrmsg); return false; } catch (Exception ex) { //show error bindTable(null, DEFAULT_ROWS); showErrorMessage(ex.Message); return false; } this.updatePanel.Update(); ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DealHideWait();ShowRowEditInfo(null);", true); return true; }
private Boolean ShowLineList() { string dept = this.cmbMaintainDept.InnerDropDownList.SelectedValue; String section = this.cmbMaintainSection.InnerDropDownList.SelectedValue; try { DeptInfo deptCondition = new DeptInfo(); deptCondition.dept = dept; DeptInfo deptlikeCondition = new DeptInfo(); deptlikeCondition.section = section + "%"; List<DeptInfo> dataList = null; dataList = (List<DeptInfo>)iDept.GetLineList(deptCondition, deptlikeCondition); if (dataList == null) { bindTable(null, DEFAULT_ROWS); } else { bindTable(dataList, DEFAULT_ROWS); } } catch (FisException ex) { bindTable(null, DEFAULT_ROWS); showErrorMessage(ex.mErrmsg); return false; } catch (Exception ex) { //show error bindTable(null, DEFAULT_ROWS); showErrorMessage(ex.Message); return false; } this.updatePanel.Update(); ScriptManager.RegisterStartupScript(this.updatePanelAll, typeof(System.Object), "saveUpdate", "DealHideWait();ShowRowEditInfo(null);", true); return true; }
public void UpdateDeptInfo(DeptInfo setValue, DeptInfo condition) { try { IMBRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); itemRepository.UpdateDeptInfo(setValue, condition); } catch (Exception) { throw; } return; }
public string AddDeptInfo(DeptInfo item) { String result = ""; try { IMBRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); itemRepository.AddDeptInfo(item); result = item.id.ToString(); } catch (Exception) { throw; } return result; }
//DELETE FROM [Dept] public void DeleteDeptInfo(DeptInfo condition) { try { IMBRepository itemRepository = RepositoryFactory.GetInstance().GetRepository<IMBRepository>(); itemRepository.DeleteDeptInfo(condition); } catch (Exception) { throw; } return; }