/// <summary> /// 保存 /// </summary> /// <param name="sender">控件</param> /// <param name="e">参数</param> private void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtName.Text) == true) { MessageBoxEx.Show("医嘱名称不能为空!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Convert.ToBoolean(InvokeController("CheckInfo", ID, txtName.Text, Convert.ToInt32(cbbWork.SelectedValue))) == false) { MessageBoxEx.Show("医嘱名称重复,请修改!", "提示框", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int flag = ID; //是新增或修改 Basic_AttachAdvice enti = new Basic_AttachAdvice(); enti.ID = ID; enti.ItemCode = txtCode.Text; enti.ItemName = txtName.Text; enti.ItemSpec = txtSpec.Text; if (tbUnit.MemberValue != null) { enti.Unit = tbUnit.MemberValue.ToString(); } enti.PYCode = txtPY.Text; enti.WBCode = txtWB.Text; if (flag == 0) { enti.DelFlag = 0; } if (Convert.ToInt32(InvokeController("SaveAttachAdviceInfo", enti, Convert.ToInt32(cbbWork.SelectedValue))) > 0) { InvokeController("BindAttachAdvice", cbbWork.SelectedValue, txtQueryName.Text); if (flag > 0) { setGridSelectIndex(dgEntrust); } else { setGridSelectIndex(dgEntrust, ((DataTable)dgEntrust.DataSource).Rows.Count - 1); } tbUnit.Enabled = false; btnCancel.Enabled = false; btnSave.Enabled = false; btnNew.Enabled = true; btnStop.Enabled = true; btnEdit.Enabled = true; btnRefresh.Enabled = true; txtName.Enabled = false; txtPY.Enabled = false; txtWB.Enabled = false; txtSpec.Enabled = false; txtCode.Enabled = false; } }
/// <summary> /// 停用或启用 /// </summary> /// <param name="sender">控件</param> /// <param name="e">参数</param> private void btnStop_Click(object sender, EventArgs e) { if (dgEntrust.CurrentCell == null) { return; } RowIndex = dgEntrust.CurrentCell.RowIndex; DataTable dt = (DataTable)dgEntrust.DataSource; Basic_AttachAdvice enti = new Basic_AttachAdvice(); enti = EFWCoreLib.CoreFrame.Common.ConvertExtend.ToObject <Basic_AttachAdvice>(dt, RowIndex); if (btnStop.Text == "启用(&U)") { enti.DelFlag = 0; } else { enti.DelFlag = 1; } if (Convert.ToInt32(InvokeController("SaveAttachAdviceInfo", enti, Convert.ToInt32(cbbWork.SelectedValue))) > 0) { InvokeController("BindAttachAdvice", cbbWork.SelectedValue, txtQueryName.Text); setGridSelectIndex(dgEntrust); } }
public int SaveAttachAdviceInfo(Basic_AttachAdvice enti, int workID) { var retdata = InvokeWcfService( "BaseProject.Service", "AttachAdviceController", "SaveAttachAdviceInfo", (request) => { enti.Uploader = LoginUserInfo.EmpId; enti.UploadTime = System.DateTime.Now; request.AddData(enti); request.AddData(workID); }); return(retdata.GetData <int>(0)); }
/// <summary> /// 保存说明性医嘱 /// </summary> /// <param name="enti">说明性医嘱</param> /// <returns>保存成功的行数</returns> public int SaveAttachAdivce(Basic_AttachAdvice enti) { this.BindDb(enti); return(enti.save()); }