示例#1
0
        /// <summary>
        /// 制单按钮Click事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void m_cmdNewMake_Click(object sender, EventArgs e)
        {
            if (!m_blnIsAdmin)
            {
                MessageBox.Show("当前用户没有药库管理权限!不能制单", "药品内退", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (string.IsNullOrEmpty(m_strStorageID))
            {
                MessageBox.Show("没有选择药库!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                frmInStorageMedicineWithdrawDetail m_objMakerBill = new frmInStorageMedicineWithdrawDetail(m_strStorageID, m_strStoreRoomName, ref m_dtbMedicineInnerWithdraw);

                DialogResult dlgResult = m_objMakerBill.ShowDialog();
                if (dlgResult == DialogResult.OK)
                {
                    m_mthQueryMedicineWithdrawData();
                    if (m_dgvMainInfo.RowCount > 0)
                    {
                        m_dgvMainInfo.Focus();
                    }
                }
            }
        }
示例#2
0
        private void m_mthModifyMedicineWithdraw()
        {
            string strStorageID   = string.Empty;
            string strInStorageID = string.Empty;

            if (m_dtbMedicineInnerWithdrawDetail.Rows.Count > 0)
            {
                //if (!m_blnIsAdmin)
                //{
                //    MessageBox.Show("当前用户没有药库管理权限!不能修改", "药品内退", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    return;
                //}
                int intStatus   = 0;
                int intRowIndex = 0;


                bool blnIsInitialWithdraw = ((clsCtl_InMedicineWithdraw)objController).m_blnIsInitialWithdraw();
                if (blnIsInitialWithdraw)//选中表单为内退初始化单据

                {
                    clsMS_InStorage_VO         objMain  = null;
                    clsMS_InStorageDetail_VO[] objSubVO = null;
                    ((clsCtl_InMedicineWithdraw)objController).m_mthModifyInitialWithdraw(out objMain, out objSubVO);
                    if (objMain != null && objSubVO != null)
                    {
                        frmInitialInStorageWithdraw frmInitial = new frmInitialInStorageWithdraw(m_strStorageID, objMain, objSubVO);
                        frmInitial.FormClosed += new FormClosedEventHandler(frmInitial_FormClosed);


                        int intRow = m_dgvMainInfo.CurrentRow.Index;
                        frmInitial.m_strMakName = m_dgvMainInfo.Rows[intRow].Cells["m_dgvtxtMakerName"].Value.ToString();
                        frmInitial.ShowDialog();
                    }
                }
                else
                {
                    clsMS_InStorage_VO         objMain   = null;
                    clsMS_InStorageDetail_VO[] objSubArr = null;
                    ((clsCtl_InMedicineWithdraw)objController).m_mthModifySelected(out objMain, out objSubArr);

                    if (objMain == null)
                    {
                        return;
                    }

                    int intSelectedSubRow = 0;
                    if ((m_dtbMedicineInnerWithdraw != null) && (m_dtbMedicineInnerWithdraw.Rows.Count > 0))
                    {
                        intSelectedSubRow = m_dgvMainInfo.CurrentRow.Index;
                    }


                    intRowIndex = m_dgvMainInfo.CurrentRow.Index;
                    string p_strReturnDept   = m_dtbMedicineInnerWithdraw.Rows[intRowIndex]["deptname_vchr"].ToString();
                    string p_strReturnDeptID = m_dtbMedicineInnerWithdraw.Rows[intRowIndex]["returndept_chr"].ToString();

                    frmInStorageMedicineWithdrawDetail frmModifyMedicineWithdraw = new frmInStorageMedicineWithdrawDetail(p_strReturnDeptID, p_strReturnDept, ref m_dtbMedicineInnerWithdraw, ref m_dtbMedicineInnerWithdrawDetail, m_strStorageID, m_strStoreRoomName, objMain, objSubArr, intSelectedSubRow);

                    frmModifyMedicineWithdraw.ShowDialog();
                    m_mthGetDetailData();
                }
            }
        }