private void btnView_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { NoticeDto dto = grvNotice.GetRow(grvNotice.FocusedRowHandle) as NoticeDto; NoticePop note = new NoticePop(dto.NoticeID); note.ShowDialog(); }
private void MainForm_Load(object sender, EventArgs e) { CreateBizMenuList(); BindComBox.IsNetWork = _userInfoDto.IsNetWork; CommonHandler.IsNetWork = _userInfoDto.IsNetWork; if (_userInfoDto.IsNetWork) { localhost.Service webService = new localhost.Service(); // LocalService localService = new LocalService(); #region 步SP //{ // DataSet ds = webService.SyncSp(); // if (ds.Tables[0].Rows.Count > 0) // { // for (int i = 0; i < ds.Tables[0].Rows.Count; i++) // { // string spName = ds.Tables[0].Rows[i]["SPName"].ToString(); // string spContent = ds.Tables[0].Rows[i]["SPContent"].ToString(); // localService.syncSP(spName, spContent); // } // } //} #endregion #region Notice { DataSet ds = webService.GetAllNotice(DateTime.Now.AddDays(-2), DateTime.Now.AddDays(2)); List <NoticeDto> noticeList = new List <NoticeDto>(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { NoticeDto dto = new NoticeDto(); dto.NoticeID = ds.Tables[0].Rows[i]["NoticeID"].ToString(); dto.NoticeTitle = ds.Tables[0].Rows[i]["NoticeTitle"].ToString(); dto.NoticeContent = ds.Tables[0].Rows[i]["NoticeContent"].ToString(); dto.FileExist = ds.Tables[0].Rows[i]["FileExist"].ToString(); dto.InDateTime = Convert.ToDateTime(ds.Tables[0].Rows[i]["InDateTime"]); noticeList.Add(dto); } } foreach (NoticeDto dto in noticeList) { View.NoticePop noticePop = new XHX.View.NoticePop(dto.NoticeID); noticePop.Show(); } } #endregion #region SpecialCase { DataSet ds = webService.SearchSpecialCaseByNeedVICoConfirm(); List <SpecialCaseDto> specialCaseList = new List <SpecialCaseDto>(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SpecialCaseDto dto = new SpecialCaseDto(); dto.ProjectCode = ds.Tables[0].Rows[i]["ProjectCode"].ToString(); dto.ShopCode = ds.Tables[0].Rows[i]["ShopCode"].ToString(); dto.ShopName = ds.Tables[0].Rows[i]["ShopName"].ToString(); dto.SubjectCode = ds.Tables[0].Rows[i]["SubjectCode"].ToString(); dto.SpecialCaseCode = ds.Tables[0].Rows[i]["SpecialCaseCode"].ToString(); specialCaseList.Add(dto); } } foreach (SpecialCaseDto dto in specialCaseList) { if (this.UserInfoDto.RoleType == "C") { //View.SpecialCasePop specialCasePop = new XHX.View.SpecialCasePop(dto.SpecialCaseCode, this.UserInfoDto); //specialCasePop.Show(); } } } #endregion } else { //LocalService localService = new LocalService(); localhost.Service localService = new localhost.Service(); localService.Url = "http://192.168.1.99/XHX.YiQiServer/service.asmx"; //localhost1.Service localService = new localhost1.Service(); #region Notice { DataSet ds = localService.GetAllNotice(DateTime.Now.AddDays(-1), DateTime.Now.AddDays(2)); List <NoticeDto> noticeList = new List <NoticeDto>(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { NoticeDto dto = new NoticeDto(); dto.NoticeID = ds.Tables[0].Rows[i]["NoticeID"].ToString(); dto.NoticeTitle = ds.Tables[0].Rows[i]["NoticeTitle"].ToString(); dto.NoticeContent = ds.Tables[0].Rows[i]["NoticeContent"].ToString(); dto.FileExist = ds.Tables[0].Rows[i]["FileExist"].ToString(); dto.InDateTime = Convert.ToDateTime(ds.Tables[0].Rows[i]["InDateTime"]); noticeList.Add(dto); } } foreach (NoticeDto dto in noticeList) { ViewLocalService.NoticePop noticePop = new XHX.ViewLocalService.NoticePop(dto.NoticeID); noticePop.Show(); } } #endregion #region SpecialCase { DataSet ds = localService.SearchSpecialCaseByNeedVICoConfirm(); List <SpecialCaseDto> specialCaseList = new List <SpecialCaseDto>(); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SpecialCaseDto dto = new SpecialCaseDto(); dto.ProjectCode = ds.Tables[0].Rows[i]["ProjectCode"].ToString(); dto.ShopCode = ds.Tables[0].Rows[i]["ShopCode"].ToString(); dto.ShopName = ds.Tables[0].Rows[i]["ShopName"].ToString(); dto.SubjectCode = ds.Tables[0].Rows[i]["SubjectCode"].ToString(); specialCaseList.Add(dto); } } foreach (SpecialCaseDto dto in specialCaseList) { if (this.UserInfoDto.RoleType == "C" && dto.NeedVICoConfirmChk == true) { //ViewLocalService.SpecialCasePop specialCasePop = new XHX.ViewLocalService.SpecialCasePop(dto.SpecialCaseCode, this.UserInfoDto); //specialCasePop.Show(); } } } #endregion } }
public override void AddButtonClick() { NoticePop note = new NoticePop(); note.ShowDialog(); }