Esempio n. 1
0
        /// <summary>
        /// hàm thực hiện việc thêm phiếu nhập kho thuốc
        /// </summary>
        private void ThemPhieuthanhly()
        {
            TPhieuNhapxuatthuoc objPhieuNhap = CreatePhieuNhapKho();

            ActionResult actionResult = new XuatThuoc().ThemPhieuXuatKho(objPhieuNhap, CreateArrPhieuChiTiet());

            switch (actionResult)
            {
            case ActionResult.Success:
                txtIDPhieuNhapKho.Text = Utility.sDbnull(objPhieuNhap.IdPhieu);
                txtMaPhieu.Text        = Utility.sDbnull(objPhieuNhap.MaPhieu);
                TPhieuNhapxuatthuoc objPhieu = TPhieuNhapxuatthuoc.FetchByID(Utility.Int32Dbnull(txtIDPhieuNhapKho.Text));
                DataRow             newDr    = p_mDataPhieuNhapKho.NewRow();
                Utility.FromObjectToDatarow(objPhieu, ref newDr);
                TDmucKho objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhohuy.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khoxuat"] = Utility.sDbnull(objKho.TenKho);
                }
                p_mDataPhieuNhapKho.Rows.Add(newDr);
                Utility.GonewRowJanus(grdList, TPhieuNhapxuatthuoc.Columns.IdPhieu, Utility.sDbnull(txtIDPhieuNhapKho.Text));
                //Utility.ShowMsg("Bạn thêm mới phiếu chuyển kho thành công", "Thông báo");
                m_enAction = action.Insert;

                b_Cancel = true;
                this.Close();
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình thêm phiếu", "Thông báo lỗi", MessageBoxIcon.Error);
                break;
            }
        }
 private void FrmThongTinDonThuoc_Load(object sender, EventArgs e)
 {
     //
     objDKho =
         new Select().From(TDmucKho.Schema)
         .Where(TDmucKho.Columns.IdKho)
         .IsEqualTo(idkhosaochep)
         .ExecuteSingle <TDmucKho>();
     objLuotkham =
         new Select().From(KcbLuotkham.Schema)
         .Where(KcbLuotkham.Columns.MaLuotkham)
         .IsEqualTo(txtPatientCode.Text.Trim())
         .ExecuteSingle <KcbLuotkham>();
     m_dtqheCamchidinhChungphieu = globalVariables.gv_dtDmucQheCamCLSChungPhieu;
     _bhytPtramTraituyennoitru   =
         Utility.DecimaltoDbnull(
             THU_VIEN_CHUNG.Laygiatrithamsohethong("BHYT_PTRAM_TRAITUYENNOITRU", "0", false), 0m);
     if (!string.IsNullOrEmpty(txtMaBenhChinh.Text.Trim()))
     {
         LoadThongTinChanDoan(txtMaBenhChinh.Text);
     }
     m_dtDonthuocChitiet = _kedonthuoc.LaythongtinchitietdonthuocDeSaoChep(Utility.Int64Dbnull(txtPres_ID.Text));
     if (m_dtDonthuocChitiet.Rows.Count > 0)
     {
         Utility.SetDataSourceForDataGridEx(grdPresDetail, m_dtDonthuocChitiet, false, true, "", "");
         grdPresDetail.CheckAllRecords();
         m_dtDonthuocChitiet_View = m_dtDonthuocChitiet.Clone();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// hàm thực hiện việc thêm mới thông tin
 /// </summary>
 private void InsertData()
 {
     try
     {
         TDmucKho objDmuckho = CreateKhoThuoc();
         objDmuckho.IsNew = true;
         objDmuckho.Save();
         txtIDKHO.Text = Utility.sDbnull(objDmuckho.IdKho);
         objDmuckho    = TDmucKho.FetchByID(Utility.Int32Dbnull(txtIDKHO.Text, -1));
         if (objDmuckho != null)
         {
             DataRow dataRow = p_dtDataChung.NewRow();
             Utility.FromObjectToDatarow(objDmuckho, ref dataRow);
             p_dtDataChung.Rows.Add(dataRow);
             Utility.GonewRowJanus(grdList, TDmucKho.Columns.IdKho, Utility.sDbnull(txtIDKHO.Text));
         }
         foreach (QheDoituongKho objdoituongkho in CreateDoiTuongKhoThem())
         {
             QuanHeDoiTuongKho.THEM_DOITUONG_KHO(objdoituongkho);
         }
         // Utility.ShowMsg("Bạn thực hiện thêm mới thành công", "Thông báo", MessageBoxIcon.Information);
         if (chkTrangThaiForm.Checked)
         {
             this.Close();
         }
         else
         {
             NhapLienTuc();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        private void LoadThuocTrongKho()
        {
            TDmucKho _kho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKho.SelectedValue, -1));

            if (_kho != null)
            {
                kieu_thuocvattu = _kho.KhoThuocVt;
                if (kieu_thuocvattu != "THUOC" || kieu_thuocvattu != "VT")
                {
                    kieu_thuocvattu = "ALL";
                }
                DataSet ds = SPs.ThuocLaythongtinthuoctontrongkhoTheokho(Utility.Int32Dbnull(cboKho.SelectedValue, -1)).GetDataSet();
                m_dtKhothuoc = ds.Tables[0];
                m_dataFull   = ds.Tables[1];
                Utility.SetDataSourceForDataGridEx(grdList, m_dtKhothuoc, true, true, "1=1", "TEN_THUOC");
                string Orderby = TThuockho.Columns.SttBan;
                Utility.SetDataSourceForDataGridEx(grdDieuchinh, m_dataFull, true, true, "1=2", getOrderOut());

                if (grdList.GetDataRows().Length > 0)
                {
                    grdList.MoveFirst();
                    grdList_CurrentCellChanged(grdList, new EventArgs());
                }
            }
            else
            {
                m_dtKhothuoc.Rows.Clear();
                m_dataFull.Rows.Clear();
                m_dtkho.Rows.Clear();
            }
        }
Esempio n. 5
0
        private void Getdata()
        {
            TDmucKho objDmucKho = TDmucKho.FetchByID(Utility.sDbnull(txtIDKHO.Text, -1));

            if (objDmucKho != null)
            {
                txt_STT_HTHI.Text          = Utility.sDbnull(objDmucKho.SttHthi, 1);
                txtMa.Text                 = Utility.sDbnull(objDmucKho.MaKho, "");
                txtTEN.Text                = Utility.sDbnull(objDmucKho.TenKho, "");
                radKhoChan.Checked         = objDmucKho.KieuKho == "CHAN";
                radKhoLe.Checked           = objDmucKho.KieuKho == "LE";
                optChanle.Checked          = objDmucKho.KieuKho == "CHANLE";
                chkChongiakhikedon.Checked = Utility.Byte2Bool(objDmucKho.ChophepChongia);
                txtKieubiendong.SetCode(objDmucKho.KieuBiendong);
                if (Utility.sDbnull(objDmucKho.KhoThuocVt) == "VT")
                {
                    optVT.Checked = true;
                }
                else if (Utility.sDbnull(objDmucKho.KhoThuocVt) == "THUOC")
                {
                    optThuoc.Checked = true;
                }
                else
                {
                    optThuocVT.Checked = true;
                }

                optKhothuong.Checked = Utility.ByteDbnull(objDmucKho.LoaiKho, 0) == 0;
                optKhoAo.Checked     = Utility.ByteDbnull(objDmucKho.LoaiKho, 0) == 1;
                txtKhoanoitru.SetId(Utility.sDbnull(objDmucKho.IdKhoaphong, "-1"));
                chkSoLuongTon.Checked = Utility.Int32Dbnull(objDmucKho.KtraTon) == 1;
                chkTuThuoc.Checked    = Utility.Int32Dbnull(objDmucKho.LaTuthuoc) == 1;
                chkHienThi.Checked    = Utility.Int32Dbnull(objDmucKho.TrangThai) == 1;
                int loaiBN = 0;
                if (Utility.sDbnull(objDmucKho.LoaiBnhan, "") == "TATCA")
                {
                    loaiBN = 0;
                }

                else if (Utility.sDbnull(objDmucKho.LoaiBnhan, "") == "NGOAITRU")
                {
                    loaiBN = 1;
                }
                else if (Utility.sDbnull(objDmucKho.LoaiBnhan, "") == "NOITRU")
                {
                    loaiBN = 2;
                }


                radTatCa.Checked    = loaiBN == 0;
                radNgoaiTru.Checked = loaiBN == 1;
                radNoiTru.Checked   = loaiBN == 2;
                txtGhiChu.Text      = Utility.sDbnull(objDmucKho.MotaThem);
                chkKhoBan.Checked   = Utility.Int32Dbnull(objDmucKho.LaQuaythuoc) == 1;
            }
        }
 void SelectStock()
 {
     if (Utility.Int32Dbnull(cboKho.SelectedValue, -1) < 0)
     {
         _item = null;
     }
     else
     {
         _item = new Select().From(TDmucKho.Schema).Where(TDmucKho.IdKhoColumn).IsEqualTo(Utility.Int32Dbnull(cboKho.SelectedValue)).ExecuteSingle <TDmucKho>();
         GetKieuThuocVT();
         BindThuocVT();
     }
 }
Esempio n. 7
0
 private void chkThekhochitiet_CheckedChanged(object sender, EventArgs e)
 {
     if (!allowChanged)
     {
         return;
     }
     if (_item == null)
     {
         _item =
             new Select().From(TDmucKho.Schema).Where(TDmucKho.IdKhoColumn).IsEqualTo(
                 Utility.Int32Dbnull(cboKho.SelectedValue)).ExecuteSingle <TDmucKho>();
     }
     GetKieuThuocVT();
 }
        private void UpdatePhieuXuatKho()
        {
            TPhieuNhapxuatthuoc objPhieuNhap = CreatePhieuNhapKho();

            ActionResult actionResult = new XuatThuoc().UpdatePhieuXuatKho(objPhieuNhap, CreateArrPhieuChiTiet());

            switch (actionResult)
            {
            case ActionResult.Success:
                TPhieuNhapxuatthuoc objTPhieuNhapxuatthuoc = TPhieuNhapxuatthuoc.FetchByID(Utility.Int32Dbnull(txtIDPhieuNhapKho.Text));
                DataRow[]           arrDr =
                    p_mDataPhieuNhapKho.Select(string.Format("{0}={1}", TPhieuNhapxuatthuoc.Columns.IdPhieu,
                                                             Utility.Int32Dbnull(txtIDPhieuNhapKho.Text)));
                if (arrDr.GetLength(0) > 0)
                {
                    arrDr[0].Delete();
                }
                DataRow newDr = p_mDataPhieuNhapKho.NewRow();
                Utility.FromObjectToDatarow(objTPhieuNhapxuatthuoc, ref newDr);
                TDmucKho objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoNhap.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["TEN_KHO_NHAP"] = Utility.sDbnull(objKho.TenKho);
                }
                objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoXuat.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["TEN_KHO_XUAT"] = Utility.sDbnull(objKho.TenKho);
                }
                newDr["ID_KHOA_LINH"] = Utility.Int16Dbnull(cboKhoaTra.SelectedValue, 0);
                newDr["TEN_KHOA"]     = cboKhoaTra.Text;
                p_mDataPhieuNhapKho.Rows.Add(newDr);

                Utility.GonewRowJanus(grdList, TPhieuNhapxuatthuoc.Columns.IdPhieu, Utility.sDbnull(txtIDPhieuNhapKho.Text));
                Utility.ShowMsg("Bạn sửa  phiếu trả thành công", "Thông báo");
                m_enAction = action.Insert;

                b_Cancel = true;
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình sửa phiếu", "Thông báo lỗi", MessageBoxIcon.Error);
                break;
            }
        }
Esempio n. 9
0
        /// <summary>
        /// hàm thực hiện việc thêm phiếu nhập kho thuốc
        /// </summary>
        private void ThemPhieuXuatKho()
        {
            TPhieutrathuocKholeVekhochan objPhieuNhap = CreatePhieuNhapKho();

            ActionResult actionResult = new PhieuTraLai().ThemPhieuTraLaiKho
                                            (objPhieuNhap, CreateArrPhieuChiTiet());

            switch (actionResult)
            {
            case ActionResult.Success:
                txtIDPhieuNhapKho.Text = Utility.sDbnull(objPhieuNhap.IdPhieu);
                txtMaPhieu.Text        = Utility.sDbnull(objPhieuNhap.MaPhieu);
                TPhieutrathuocKholeVekhochan objDPhieuNhap = TPhieutrathuocKholeVekhochan.FetchByID(Utility.Int32Dbnull(txtIDPhieuNhapKho.Text));
                DataRow newDr = p_dtPhieuNhapTra.NewRow();
                Utility.FromObjectToDatarow(objDPhieuNhap, ref newDr);
                TDmucKho objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoLinh.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khonhap"] = Utility.sDbnull(objKho.TenKho);
                }
                objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoTra.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khoxuat"] = Utility.sDbnull(objKho.TenKho);
                }
                DmucNhanvien objStaff = DmucNhanvien.FetchByID(Utility.Int32Dbnull(cboNhanVien.SelectedValue));
                if (objStaff != null)
                {
                    newDr["ten_nhanvien"] = Utility.sDbnull(objStaff.TenNhanvien);
                }
                p_dtPhieuNhapTra.Rows.Add(newDr);
                grdList.UpdateData();
                //Utility.ShowMsg("Bạn thêm mới phiếu thành công", "Thông báo");
                Utility.GonewRowJanus(grdList, TPhieutrathuocKholeVekhochan.Columns.IdPhieu, Utility.sDbnull(txtIDPhieuNhapKho.Text));
                em_Action = action.Insert;
                b_Cancel  = true;
                this.Close();
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình thêm phiếu", "Thông báo lỗi", MessageBoxIcon.Error);
                break;
            }
        }
        private void UpdatePhieuXuatKho()
        {
            TPhieuNhapxuatthuoc objPhieuNhap = CreatePhieuNhapKho();

            ActionResult actionResult = new XuatThuoc().UpdatePhieuXuatKho(objPhieuNhap, CreateArrPhieuChiTiet());

            switch (actionResult)
            {
            case ActionResult.Success:
                TPhieuNhapxuatthuoc objTPhieuNhapxuatthuoc = TPhieuNhapxuatthuoc.FetchByID(Utility.Int32Dbnull(txtIDPhieuNhapKho.Text));
                DataRow[]           arrDr =
                    p_mDataPhieuNhapKho.Select(string.Format("{0}={1}", TPhieuNhapxuatthuoc.Columns.IdPhieu,
                                                             Utility.Int32Dbnull(txtIDPhieuNhapKho.Text)));
                if (arrDr.GetLength(0) > 0)
                {
                    arrDr[0].Delete();
                }
                DataRow newDr = p_mDataPhieuNhapKho.NewRow();
                Utility.FromObjectToDatarow(objTPhieuNhapxuatthuoc, ref newDr);
                DmucChung objNhaCC = THU_VIEN_CHUNG.LaydoituongDmucChung("NHACUNGCAP", txtNhacungcap.myCode);
                if (objNhaCC != null)
                {
                    newDr["ten_nhacungcap"] = Utility.sDbnull(objNhaCC.Ten);
                }
                TDmucKho objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoXuat.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khoxuat"] = Utility.sDbnull(objKho.TenKho);
                }
                p_mDataPhieuNhapKho.Rows.Add(newDr);

                Utility.GonewRowJanus(grdList, TPhieuNhapxuatthuoc.Columns.IdPhieu, Utility.sDbnull(txtIDPhieuNhapKho.Text));
                //Utility.ShowMsg("Bạn sửa  phiếu thành công", "Thông báo");
                m_enAction = action.Insert;
                this.Close();
                b_Cancel = true;
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình sửa phiếu", "Thông báo lỗi", MessageBoxIcon.Error);
                break;
            }
        }
Esempio n. 11
0
        private void UpdatePhieuXuatKho()
        {
            TPhieutrathuocKholeVekhochan objPhieuNhap = CreatePhieuNhapKho();

            ActionResult actionResult = new PhieuTraLai().UpdatePhieuTraLaiKho(objPhieuNhap, CreateArrPhieuChiTiet());

            switch (actionResult)
            {
            case ActionResult.Success:
                TPhieutrathuocKholeVekhochan objDPhieuNhap = TPhieutrathuocKholeVekhochan.FetchByID(Utility.Int32Dbnull(txtIDPhieuNhapKho.Text));
                DataRow[] arrDr =
                    p_dtPhieuNhapTra.Select(string.Format("{0}={1}", TPhieutrathuocKholeVekhochan.Columns.IdPhieu,
                                                          Utility.Int32Dbnull(txtIDPhieuNhapKho.Text)));
                if (arrDr.GetLength(0) > 0)
                {
                    arrDr[0].Delete();
                }
                DataRow newDr = p_dtPhieuNhapTra.NewRow();
                Utility.FromObjectToDatarow(objDPhieuNhap, ref newDr);
                TDmucKho objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoLinh.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khonhap"] = Utility.sDbnull(objKho.TenKho);
                }
                objKho = TDmucKho.FetchByID(Utility.Int32Dbnull(cboKhoTra.SelectedValue, -1));
                if (objKho != null)
                {
                    newDr["ten_khoxuat"] = Utility.sDbnull(objKho.TenKho);
                }
                p_dtPhieuNhapTra.Rows.Add(newDr);
                Utility.GonewRowJanus(grdList, TPhieutrathuocKholeVekhochan.Columns.IdPhieu, Utility.sDbnull(txtIDPhieuNhapKho.Text));
                Utility.ShowMsg("Bạn sửa  phiếu thành công", "Thông báo");
                em_Action = action.Insert;
                this.Close();
                b_Cancel = true;
                break;

            case ActionResult.Error:
                Utility.ShowMsg("Lỗi trong quá trình sửa phiếu", "Thông báo lỗi", MessageBoxIcon.Error);
                break;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// hàm thực hiện việc cập nhập lại thông tin thành công
        /// </summary>
        private void UpdateData()
        {
            try
            {
                TDmucKho objDmuckho = CreateKhoThuoc();
                objDmuckho.Save();
                m_blnCancel = false;
                objDmuckho  = TDmucKho.FetchByID(Utility.Int32Dbnull(txtIDKHO.Text, -1));
                DataRow[] arrDr =
                    p_dtDataChung.Select(string.Format("{0}={1}", TDmucKho.Columns.IdKho, Utility.Int32Dbnull(txtIDKHO.Text)));
                if (arrDr.GetLength(0) > 0)
                {
                    arrDr[0].Delete();
                }
                p_dtDataChung.AcceptChanges();
                if (objDmuckho != null)
                {
                    DataRow dataRow = p_dtDataChung.NewRow();
                    Utility.FromObjectToDatarow(objDmuckho, ref dataRow);
                    p_dtDataChung.Rows.Add(dataRow);
                    Utility.GonewRowJanus(grdList, TDmucKho.Columns.IdKho, Utility.sDbnull(txtIDKHO.Text));
                }
                new Delete().From(QheDoituongKho.Schema)
                .Where(QheDoituongKho.Columns.IdKho).IsEqualTo(Utility.Int32Dbnull(txtIDKHO.Text, -1))
                .Execute();

                foreach (QheDoituongKho objdoituongkho in CreateDoiTuongKhoThem())
                {
                    QuanHeDoiTuongKho.THEM_DOITUONG_KHO(objdoituongkho);
                }
                Utility.ShowMsg("Bạn đã cập nhật dữ liệu thành công", "Thông báo", MessageBoxIcon.Information);
                if (chkTrangThaiForm.Checked)
                {
                    this.Close();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 void SelectStock()
 {
     if (Utility.Int32Dbnull(cboKho.SelectedValue, -1) < 0)
         _item = null;
     else
     {
         _item = new Select().From(TDmucKho.Schema).Where(TDmucKho.IdKhoColumn).IsEqualTo(Utility.Int32Dbnull(cboKho.SelectedValue)).ExecuteSingle<TDmucKho>();
         GetKieuThuocVT();
         BindThuocVT();
     }
 }
Esempio n. 14
0
        private TDmucKho CreateKhoThuoc()
        {
            TDmucKho objDmuckho = new TDmucKho();

            if (em_Action == action.Update)
            {
                objDmuckho.IsLoaded = true;
                objDmuckho.MarkOld();
                objDmuckho.IdKho    = Utility.Int32Dbnull(txtIDKHO.Text, -1);
                objDmuckho.NgaySua  = globalVariables.SysDate;
                objDmuckho.NguoiSua = globalVariables.UserName;
            }
            objDmuckho.MaKho          = Utility.sDbnull(txtMa.Text.ToUpper());
            objDmuckho.ChophepChongia = Utility.Bool2byte(chkChongiakhikedon.Checked);
            objDmuckho.TenKho         = txtTEN.Text;
            objDmuckho.SttHthi        = Utility.Int32Dbnull(txt_STT_HTHI.Value);
            objDmuckho.IdKhoaphong    = Utility.Int16Dbnull(txtKhoanoitru.MyID, -1);
            objDmuckho.KhoThuocVt     = optThuoc.Checked ? "THUOC" : (optVT.Checked ? "VT":"THUOCVT");
            objDmuckho.KtraTon        = Utility.ByteDbnull(chkSoLuongTon.Checked, 0);
            objDmuckho.LaTuthuoc      = Utility.ByteDbnull(chkTuThuoc.Checked, 0);
            objDmuckho.MotaThem       = Utility.sDbnull(txtGhiChu.Text);
            objDmuckho.LaQuaythuoc    = (byte?)(chkKhoBan.Checked ? 1 : 0);
            objDmuckho.TrangThai      = (byte?)(chkHienThi.Checked ? 1 : 0);
            objDmuckho.KieuBiendong   = txtKieubiendong.myCode;
            objDmuckho.NgayTao        = globalVariables.SysDate;
            objDmuckho.NguoiTao       = globalVariables.UserName;
            objDmuckho.LoaiKho        = Utility.Bool2byte(optKhoAo.Checked);
            byte kieukho = 0;

            //if(radKhoTong.Checked) kieukho = 0;
            if (radKhoLe.Checked)
            {
                kieukho = 1;
            }
            if (radKhoChan.Checked)
            {
                kieukho = 2;
            }
            if (optChanle.Checked)
            {
                kieukho = 3;
            }
            objDmuckho.KieuKho = kieukho == 1 ? "LE" : (kieukho == 2 ? "CHAN" : "CHANLE");
            string loaiBN = "TATCA";

            if (radTatCa.Checked)
            {
                loaiBN = "TATCA";
            }
            if (radNgoaiTru.Checked)
            {
                loaiBN = "NGOAITRU";
            }
            if (radNoiTru.Checked)
            {
                loaiBN = "NOITRU";
            }
            objDmuckho.LoaiBnhan = loaiBN;

            return(objDmuckho);
        }
 private void cboStock_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if ((this.blnHasLoaded && (this.cboStock.Items.Count > 0)) && ((this.cboStock.SelectedValue == null) || (this.cboStock.SelectedValue.ToString() != "-1")))
         {
             globalVariables.KHOKEDON = Utility.Int32Dbnull(this.cboStock.SelectedValue, -1);
             if (KIEU_THUOC_VT == "THUOC")
                 PropertyLib._ThamKhamProperties.IDKho = globalVariables.KHOKEDON;
             else
                 PropertyLib._ThamKhamProperties.IDKhoVT = globalVariables.KHOKEDON;
             PropertyLib.SaveProperty(PropertyLib._ThamKhamProperties);
             int num = Utility.Int32Dbnull(this.cboStock.SelectedValue, -1);
             if ((num > 0) && (this.blnHasLoaded && (this.cboStock.Items.Count > 0)))
             {
                 this.m_dtDanhmucthuoc = this._KEDONTHUOC.LayThuoctrongkhokedon(num, KIEU_THUOC_VT, Utility.sDbnull(this.objLuotkham.MaDoituongKcb, "DV"), Utility.Int32Dbnull(this.objLuotkham.DungTuyen.Value, 0), noitru, globalVariables.MA_KHOA_THIEN);
                 this.ProcessData();
                 objDKho = ReadOnlyRecord<TDmucKho>.FetchByID(num);
                 this.rowFilter = "1=1";
                 this.txtdrug.AllowedSelectPrice = Utility.Byte2Bool(objDKho.ChophepChongia);
                 this.txtdrug.dtData = this.m_dtDanhmucthuoc;
                 this.txtdrug.ChangeDataSource();
                 this.txtdrug.Focus();
                 this.txtdrug.SelectAll();
             }
             else
             {
                 objDKho = null;
             }
         }
     }
     catch (Exception exception)
     {
         Utility.CatchException(exception);
     }
 }
Esempio n. 16
0
        private TDmucKho CreateKhoThuoc()
        {
            TDmucKho objDmuckho = new TDmucKho();
            if (em_Action == action.Update)
            {
                objDmuckho.IsLoaded = true;
                objDmuckho.MarkOld();
                objDmuckho.IdKho = Utility.Int32Dbnull(txtIDKHO.Text, -1);
                objDmuckho.NgaySua = globalVariables.SysDate;
                objDmuckho.NguoiSua = globalVariables.UserName;
            }
            objDmuckho.MaKho = Utility.sDbnull(txtMa.Text.ToUpper());
            objDmuckho.ChophepChongia = Utility.Bool2byte(chkChongiakhikedon.Checked);
            objDmuckho.TenKho = txtTEN.Text;
            objDmuckho.SttHthi = Utility.Int32Dbnull(txt_STT_HTHI.Value);
            objDmuckho.IdKhoaphong = Utility.Int16Dbnull(txtKhoanoitru.MyID, -1);
            objDmuckho.KhoThuocVt = optThuoc.Checked ? "THUOC" : (optVT.Checked ? "VT":"THUOCVT") ;
            objDmuckho.KtraTon = Utility.ByteDbnull(chkSoLuongTon.Checked, 0);
            objDmuckho.LaTuthuoc = Utility.ByteDbnull(chkTuThuoc.Checked, 0);
            objDmuckho.MotaThem = Utility.sDbnull(txtGhiChu.Text);
            objDmuckho.LaQuaythuoc = (byte?)(chkKhoBan.Checked ? 1 : 0);
            objDmuckho.TrangThai = (byte?) (chkHienThi.Checked ? 1 : 0);
            objDmuckho.KieuBiendong = txtKieubiendong.myCode;
            objDmuckho.NgayTao = globalVariables.SysDate;
            objDmuckho.NguoiTao = globalVariables.UserName;
            objDmuckho.LoaiKho = Utility.Bool2byte(optKhoAo.Checked);
            byte kieukho = 0;
            //if(radKhoTong.Checked) kieukho = 0;
            if (radKhoLe.Checked) kieukho = 1;
            if (radKhoChan.Checked) kieukho = 2;
            if (optChanle.Checked) kieukho = 3;
            objDmuckho.KieuKho = kieukho == 1 ? "LE" : (kieukho == 2 ? "CHAN" : "CHANLE");
            string loaiBN = "TATCA";
            if (radTatCa.Checked) loaiBN = "TATCA";
            if (radNgoaiTru.Checked) loaiBN = "NGOAITRU";
            if (radNoiTru.Checked) loaiBN = "NOITRU";
            objDmuckho.LoaiBnhan = loaiBN;

            return objDmuckho;
        }
Esempio n. 17
0
 void chkThekhochitiet_CheckedChanged(object sender, EventArgs e)
 {
     if (!allowChanged) return;
     if(_item==null)
         _item = new Select().From(TDmucKho.Schema).Where(TDmucKho.IdKhoColumn).IsEqualTo(Utility.Int32Dbnull(cboKho.SelectedValue)).ExecuteSingle<TDmucKho>();
     GetKieuThuocVT();
 }
Esempio n. 18
0
        public void Insert(string MaKho,string TenKho,int? SttHthi,string KieuKho,string KhoThuocVt,short IdKhoaphong,string MotaThem,byte? LaQuaythuoc,byte? KtraTon,DateTime? NgaySua,DateTime? NgayTao,string NguoiSua,string NguoiTao,byte? LaTuthuoc,string LoaiBnhan,byte? TrangThai,byte? TuTuc,byte? ChophepChongia,string KieuBiendong,byte? LoaiKho)
        {
            TDmucKho item = new TDmucKho();

            item.MaKho = MaKho;

            item.TenKho = TenKho;

            item.SttHthi = SttHthi;

            item.KieuKho = KieuKho;

            item.KhoThuocVt = KhoThuocVt;

            item.IdKhoaphong = IdKhoaphong;

            item.MotaThem = MotaThem;

            item.LaQuaythuoc = LaQuaythuoc;

            item.KtraTon = KtraTon;

            item.NgaySua = NgaySua;

            item.NgayTao = NgayTao;

            item.NguoiSua = NguoiSua;

            item.NguoiTao = NguoiTao;

            item.LaTuthuoc = LaTuthuoc;

            item.LoaiBnhan = LoaiBnhan;

            item.TrangThai = TrangThai;

            item.TuTuc = TuTuc;

            item.ChophepChongia = ChophepChongia;

            item.KieuBiendong = KieuBiendong;

            item.LoaiKho = LoaiKho;

            item.Save(UserName);
        }