/// <summary> /// 设置当前选中病区 /// </summary> /// <param name="sender">控件</param> /// <param name="e">参数</param> private void dgWard_CurrentCellChanged(object sender, EventArgs e) { if (null == dgWard.CurrentRow) { return; } var rowIndex = dgWard.CurrentRow.Index; var dataSource = dgWard.DataSource as List <BaseWard>; CurrentWard = dataSource[rowIndex]; }
/// <summary> /// 新增 /// </summary> /// <param name="sender">控件</param> /// <param name="e">参数</param> private void toolbarAdd_Click(object sender, EventArgs e) { dgWard.Enabled = false; CurrentWard = new BaseWard { }; toolbarAdd.Enabled = false; toolbarFlag.Enabled = false; toolbarRelDept.Enabled = false; //toolbarRelEmp.Enabled = false; barWard.Refresh(); tbWardName.Focus(); }
public void SaveWard(BaseWard ward, int workId) { try { var retdata = InvokeWcfService( "BaseProject.Service", "WardController", "SaveWard", (request) => { request.AddData(workId); request.AddData(ward); }); var ret = retdata.GetData <string>(0); MessageBoxShowSimple("保存病区成功!"); } catch (Exception ex) { throw ex; } }