/// <summary> /// 获取部门列表 /// </summary> private void Search() { BusinessCardService businessCardService = new BusinessCardService(); // 获取数据 if (this.rbtnPersonal.Checked) { this.DTBusinessCard = businessCardService.GetDataTableByUser(UserInfo); } else { if (this.rbtnPublic.Checked) { this.DTBusinessCard = businessCardService.GetPublicDT(UserInfo); } else { if (this.rbtnAll.Checked) { this.DTBusinessCard = businessCardService.GetDataTable(UserInfo); } } } // 绑定屏幕数据 this.BindData(); }
private void Search(string organizeId) { // 获取数据 BusinessCardService businessCardService = new BusinessCardService(); this.DTBusinessCard = businessCardService.GetDataTable(UserInfo); // 绑定屏幕数据 this.BindData(); }
/// <summary> /// 加载窗体 /// </summary> public override void FormOnLoad() { BusinessCardService businessCardService = new BusinessCardService(); this.BusinessCardEntity = businessCardService.GetEntity(UserInfo, this.EntityId); // 显示内容 this.ShowEntity(this.BusinessCardEntity); // 设置焦点 this.ActiveControl = this.txtFullName; this.txtFullName.Focus(); }
/// <summary> /// 保存 /// </summary> /// <returns>保存成功</returns> public override bool SaveEntity() { bool returnValue = true; // 设置鼠标繁忙状态,并保留原先的状态 Cursor holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; string statusCode = string.Empty; string statusMessage = string.Empty; BusinessCardService businessCardService = new BusinessCardService(); this.EntityId = businessCardService.AddEntity(UserInfo, this.GetEntity(), out statusCode, out statusMessage); returnValue = !String.IsNullOrEmpty(EntityId); this.Changed = returnValue; // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; return(returnValue); }
/// <summary> /// 保存 /// </summary> /// <returns>保存成功</returns> public override bool SaveEntity() { bool returnValue = false; // 设置鼠标繁忙状态,并保留原先的状态 Cursor holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; string statusCode = string.Empty; string statusMessage = string.Empty; this.GetEntity(this.BusinessCardEntity); BusinessCardService businessCardService = new BusinessCardService(); int rowCount = businessCardService.UpdateEntity(UserInfo, this.BusinessCardEntity, out statusCode, out statusMessage); returnValue = rowCount > 0; this.Changed = returnValue; // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; return(returnValue); }
/// <summary> /// 批量保存 /// </summary> private void BatchSave() { // 去掉未修改的数据,提高运行速度 for (int i = this.DTBusinessCard.Rows.Count - 1; i >= 0; i--) { if (this.DTBusinessCard.Rows[i].RowState == DataRowState.Unchanged) { this.DTBusinessCard.Rows.RemoveAt(i); } } BusinessCardService businessCardService = new BusinessCardService(); businessCardService.BatchSave(UserInfo, this.DTBusinessCard); // 获取列表 this.Search(); if (BaseSystemInfo.ShowInformation) { // 批量保存,进行提示 MessageBox.Show(AppMessage.MSG0012, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 批量删除 /// </summary> /// <returns>影响行数</returns> public override int BatchDelete() { BusinessCardService businessCardService = new BusinessCardService(); return(businessCardService.BatchDelete(UserInfo, this.GetSelecteIds())); }