예제 #1
0
        /// <summary>
        /// hàm thực hiện cập nhâp thôn tin phiếu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdUpdatePhieuNhap_Click(object sender, EventArgs e)
        {
            try
            {
                if(!InValiUpdateXoa())return;
                int ITPhieuNhapxuatthuoc = Utility.Int32Dbnull(grdList.GetValue(TPhieuNhapxuatthuoc.Columns.IdPhieu), -1);
                using (frm_Themmoi_Phieunhapkho frm = new frm_Themmoi_Phieunhapkho())
                {
                    frm._OnActionSuccess += frm__OnActionSuccess;
                    frm.em_Action = action.Update;
                    frm.KIEU_THUOC_VT = KIEU_THUOC_VT;
                    frm.grdList = grdList;
                    frm.p_mDataPhieuNhapKho = m_dtDataNhapKho;
                    frm.txtIDPhieuNhapKho.Text = Utility.sDbnull(ITPhieuNhapxuatthuoc);

                    frm.ShowDialog();
                    if (!frm.b_Cancel)
                    {
                        grdList_SelectionChanged(grdList, new EventArgs());
                    }
                }
            }
            catch (Exception exception)
            {
                if (globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(exception.ToString());
                }

            }
            finally
            {
                ModifyCommand();
            }
        }
예제 #2
0
        /// <summary>
        /// hàm thực hiện việc thêm mới thông tin 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdThemPhieuNhap_Click(object sender, EventArgs e)
        {
            try
            {
                using (frm_Themmoi_Phieunhapkho frm = new frm_Themmoi_Phieunhapkho())
                {
                    frm.em_Action = action.Insert;
                    frm._OnActionSuccess += frm__OnActionSuccess;
                    frm.p_mDataPhieuNhapKho = m_dtDataNhapKho;
                    frm.KIEU_THUOC_VT = KIEU_THUOC_VT;
                    frm.grdList = grdList;
                    frm.txtIDPhieuNhapKho.Text = "-1";
                    frm.ShowDialog();
                    if (!frm.b_Cancel)
                    {
                        grdList_SelectionChanged(grdList, new EventArgs());
                    }
                }
            }
            catch (Exception exception)
            {
                if(globalVariables.IsAdmin)
                {
                    Utility.ShowMsg(exception.ToString());
                }

            }
            finally
            {
                ModifyCommand();
            }
        }