Esempio n. 1
0
        private void jsgConditions_UpdatingRecord(object sender, System.ComponentModel.CancelEventArgs e)
        {
            Janus.Windows.GridEX.GridEXRow row = null;
            row = jsgConditions.GetRow();
            this.txtConditionName.Text = (string)row.Cells["clmName"].Value;

        }
Esempio n. 2
0
        private void jsgConditions_SelectionChanged(object sender, System.EventArgs e)
        {
            Janus.Windows.GridEX.GridEXRow currentRow = this.jsgConditions.GetRow();
            if (currentRow != null)
            {
                ActiveCondition = (GridEXFormatCondition)currentRow.DataRow;
                if (currentRow.Position == 0)
                {
                    this.btnMoveUp.Enabled = false;
                }
                else
                {
                    this.btnMoveUp.Enabled = true;
                }
                if (currentRow.Position < this.jsgConditions.RowCount - 1)
                {
                    this.btnMoveDown.Enabled = true;
                }
                else
                {
                    this.btnMoveDown.Enabled = false;
                }

            }
            else
            {
                this.btnMoveDown.Enabled = false;
                this.btnMoveUp.Enabled = false;
                ActiveCondition = null;
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Dùng trong trường hợp xóa
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gxAddEdit1_DeleteClick(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có chắc muốn xóa?", "Xác nhận", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
     {
         return;
     }
     if (gxHocSinhList1.CurrentRow != null)
     {
         int        count     = gxHocSinhList1.SelectedItems.Count;
         List <int> lstDelete = new List <int>();
         foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxHocSinhList1.SelectedItems)
         {
             lstDelete.Add(item.Position);
         }
         for (int i = 0; i < count; i++)
         {
             Janus.Windows.GridEX.GridEXRow item = gxHocSinhList1.GetRow(lstDelete[i] - i);
             DataRowView dtrv = (DataRowView)item.DataRow;
             if (dtrv != null)
             {
                 lstHSDel.Add(Convert.ToInt32(dtrv.Row["MaGiaoDan"]));
             }
         }
         if (gxHocSinhList1.CurrentRow != null)
         {
             gxHocSinhList1.CurrentRow.Delete();
         }
     }
 }
Esempio n. 4
0
 public void DeleteRow()
 {
     if (this.CurrentRow != null && (this.CurrentRow.DataRow as DataRowView) != null)
     {
         if (MessageBox.Show("Bạn có chắc muốn xóa (các) đôi rao được chọn trong danh sách?", "Xác nhận xóa", MessageBoxButtons.YesNo) == DialogResult.No)
         {
             return;
         }
         int        count     = this.SelectedItems.Count;
         List <int> lstDelete = new List <int>();
         foreach (Janus.Windows.GridEX.GridEXSelectedItem item in this.SelectedItems)
         {
             lstDelete.Add(item.Position);
         }
         for (int i = 0; i < count; i++)
         {
             Janus.Windows.GridEX.GridEXRow item = this.GetRow(lstDelete[i] - i);
             Memory.ExecuteSqlCommand(SqlConstants.DELETE_RAOHONPHOI,
                                      new object[] { (item.DataRow as DataRowView).Row[RaoHonPhoiConst.MaRaoHonPhoi] });
             if (Memory.ShowError())
             {
                 return;
             }
             item.Delete();
         }
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Dùng trong trường hợp xóa
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gxAddEdit1_DeleteClick(object sender, EventArgs e)
        {
            if (gxLopGiaoLyList1.CurrentRow != null && (gxLopGiaoLyList1.CurrentRow.DataRow as DataRowView) != null)
            {
                if (MessageBox.Show("Bạn có chắc muốn xóa lớp giáo lý này? Danh sách học sinh thuộc lớp giáo lý này sẽ bị xóa theo", "Xác nhận xóa", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
                int        count     = gxLopGiaoLyList1.SelectedItems.Count;
                List <int> lstDelete = new List <int>();
                foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxLopGiaoLyList1.SelectedItems)
                {
                    lstDelete.Add(item.Position);
                }
                for (int i = 0; i < count; i++)
                {
                    Janus.Windows.GridEX.GridEXRow item = gxLopGiaoLyList1.GetRow(lstDelete[i] - i);

                    Memory.ExecuteSqlCommand("Delete from ChiTietLopGiaoLy where MaLop  = ?", new object[] { (item.DataRow as DataRowView).Row["MaLop"] });
                    Memory.ExecuteSqlCommand("Delete from LopGiaoLy where MaLop = ?",
                                             new object[] { (item.DataRow as DataRowView).Row["MaLop"] });

                    if (Memory.ShowError())
                    {
                        return;
                    }
                    gxLopGiaoLyList1.CurrentRow.Delete();
                    item.Delete();
                }
            }
        }
Esempio n. 6
0
 private void tb_Proveedor_KeyDown(object sender, KeyEventArgs e)
 {
     if (Tb_FechaEnt.IsInputReadOnly == false)
     {
         if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Enter)
         {
             var            lista         = new ServiceDesktop.ServiceDesktopClient().ProveedorListarEncabezado();
             List <GLCelda> listEstCeldas = new List <GLCelda>();
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Id", visible = true, titulo = "ID", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Descrip", visible = true, titulo = "DESCRIPCION", tamano = 150
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Contacto", visible = true, titulo = "CONTACTO", tamano = 100
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Ciudad", visible = false, titulo = "IDCIUDAD", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "CiudadNombre", visible = true, titulo = "CIUDAD", tamano = 120
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Telfon", visible = true, titulo = "TELEFONO", tamano = 100
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "EdadSemana", visible = true, titulo = "EDAD EN SEMANAS", tamano = 100
             });
             Efecto efecto = new Efecto();
             efecto.Tipo       = 3;
             efecto.Tabla      = lista;
             efecto.SelectCol  = 2;
             efecto.listaCelda = listEstCeldas;
             efecto.Alto       = 50;
             efecto.Ancho      = 350;
             efecto.Context    = "SELECCIONE UN PROVEEDOR";
             efecto.ShowDialog();
             bool bandera = false;
             bandera = efecto.Band;
             if (bandera)
             {
                 Janus.Windows.GridEX.GridEXRow Row = efecto.Row;
                 _idProveedor      = Convert.ToInt32(Row.Cells["Id"].Value);
                 tb_Proveedor.Text = Row.Cells["Descrip"].Value.ToString();
                 Tb_Edad.Text      = Row.Cells["Id"].Value.ToString();
             }
         }
     }
 }
Esempio n. 7
0
 private void grJBuscador_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Escape)
     {
         this.Close();
     }
     if (e.KeyData == Keys.Enter)
     {
         filaSelect   = grJBuscador.GetRow();
         seleccionado = true;
         this.Close();
     }
 }
Esempio n. 8
0
 private void RemoveDetail(Janus.Windows.GridEX.GridEXRow gridExRow)
 {
     try
     {
         gridExRow.Delete();
         grdPhieuXuatChiTiet.UpdateData();
         grdPhieuXuatChiTiet.Refresh();
         m_dtDataPhieuChiTiet.AcceptChanges();
         ModifyCommand();
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Lỗi khi trả trả thuốc:\n" + ex.Message);
     }
 }
Esempio n. 9
0
 private void dgvField_DragDrop(object sender, DragEventArgs e)
 {
     Janus.Windows.GridEX.GridEXRow row = (Janus.Windows.GridEX.GridEXRow)e.Data.GetData(typeof(Janus.Windows.GridEX.GridEXRow));
     if (row != null)
     {
         int   indexSource = row.RowIndex;
         Point p           = dgvField.PointToClient(new Point(e.X, e.Y));
         int   rowIndex    = dgvField.RowPositionFromPoint(p.X, p.Y);
         if (rowIndex >= 0 && rowIndex < dgvField.RowCount && indexSource != rowIndex)
         {
             DataRow rowmove = _dtField.NewRow();
             rowmove.ItemArray = _dtField.Rows[indexSource].ItemArray;
             _dtField.Rows.RemoveAt(indexSource);
             _dtField.Rows.InsertAt(rowmove, rowIndex);
         }
     }
 }
Esempio n. 10
0
 private void gxAddEdit2_DeleteClick(object sender, EventArgs e)
 {
     if (gxGiaoLyVien1.CurrentRow != null)
     {
         int        count     = gxGiaoLyVien1.SelectedItems.Count;
         List <int> lstDelete = new List <int>();
         foreach (Janus.Windows.GridEX.GridEXSelectedItem item in gxGiaoLyVien1.SelectedItems)
         {
             lstDelete.Add(item.Position);
         }
         for (int i = 0; i < count; i++)
         {
             Janus.Windows.GridEX.GridEXRow item = gxGiaoLyVien1.GetRow(lstDelete[i] - i);
             DataRowView dtrv = (DataRowView)item.DataRow;
             lstGLVDel.Add(Convert.ToInt32(dtrv.Row["MaGiaoDan"]));
         }
         gxGiaoLyVien1.CurrentRow.Delete();
     }
 }
Esempio n. 11
0
 private void btnDeleteDetail_Click(object sender, EventArgs e)
 {
     if (this.ValidateDelete() && this.ValidateDeleteCustom())
     {
         foreach (XModelBase model in this.m_SelectedModels)
         {
             if (model.ModelStatus != XModelStatus.Add)
             {
                 //如果不是新增的记录
                 string id = model.ID;
                 m_DeletedDetailIds += "'" + id + "',";
             }
             Janus.Windows.GridEX.GridEXRow gridRow = this.grdDetail.GetRow(model);
             gridRow.Delete();
             this.grdDetail.Refresh();
             //deleteRow.Delete();
         }
         m_DeletedDetailIds = m_DeletedDetailIds.TrimEnd(',');
     }
 }
        private void RemoveDetail(Janus.Windows.GridEX.GridEXRow gridExRow)
        {
            try
            {
                string  manhacungcap = "";
                string  NgayHethan   = "";
                string  solo         = "";
                int     id_thuoc     = -1;
                decimal dongia       = 0m;
                decimal Giaban       = 0m;
                Int32   soluong      = 0;
                decimal vat          = 0m;
                int     isHetHan     = 0;
                long    IdThuockho   = 0;

                DateTime NgayNhap = Convert.ToDateTime(gridExRow.Cells[TThuockho.Columns.NgayNhap].Value).Date;
                decimal  GiaBhyt  = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].Value, 0);
                NgayHethan   = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
                solo         = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
                id_thuoc     = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
                IdThuockho   = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuockho].Value, -1);
                dongia       = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
                Giaban       = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
                soluong      = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG"].Value, 0);
                vat          = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.Vat].Value, 0);
                isHetHan     = Utility.Int32Dbnull(gridExRow.Cells["IsHetHan"].Value, 0);
                manhacungcap = Utility.sDbnull(gridExRow.Cells[TThuockho.Columns.MaNhacungcap].Value, 0);



                DataRow[] arrDr = m_dtDataThuocKho.Select(TPhieuNhapxuatthuocChitiet.Columns.IdThuockho + "=" + IdThuockho.ToString());
                if (arrDr.Length <= 0)
                {
                    DataRow drv = m_dtDataThuocKho.NewRow();


                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuoc] = id_thuoc;
                    drv["ten_donvitinh"] = Utility.sDbnull(gridExRow.Cells["ten_donvitinh"].Value);
                    drv["IsHetHan"]      = isHetHan;
                    DmucThuoc objLDrug = DmucThuoc.FetchByID(id_thuoc);
                    if (objLDrug != null)
                    {
                        drv[DmucThuoc.Columns.TenThuoc]    = Utility.sDbnull(objLDrug.TenThuoc);
                        drv[DmucThuoc.Columns.HamLuong]    = Utility.sDbnull(objLDrug.HamLuong);
                        drv[DmucThuoc.Columns.HoatChat]    = Utility.sDbnull(objLDrug.HoatChat);
                        drv[DmucThuoc.Columns.NuocSanxuat] = Utility.sDbnull(objLDrug.NuocSanxuat);
                        drv[DmucThuoc.Columns.HangSanxuat] = Utility.sDbnull(objLDrug.HangSanxuat);
                    }
                    drv[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap]     = NgayNhap;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBhyt]      = GiaBhyt;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.Vat]          = vat;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaNhap]      = dongia;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.DonGia]       = dongia;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.MaNhacungcap] = manhacungcap;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoLo]         = solo;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoDky]        = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoDky].Value);
                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau]  = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau].Value);
                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuockho]   = IdThuockho;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBan]       = Giaban;

                    drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong]    = soluong;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien]  = dongia * soluong;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau]  = 0;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = NgayHethan;
                    drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu]    = -1;
                    m_dtDataThuocKho.Rows.Add(drv);
                }
                else
                {
                    arrDr[0]["SO_LUONG"]      = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluong;
                    arrDr[0]["SO_LUONG_THAT"] = arrDr[0]["SO_LUONG"];
                    m_dtDataThuocKho.AcceptChanges();
                }
                gridExRow.Delete();
                grdPhieuXuatChiTiet.UpdateData();
                grdPhieuXuatChiTiet.Refresh();
                m_dtDataPhieuChiTiet.AcceptChanges();
                m_dtDataThuocKho.AcceptChanges();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi hủy chuyển thuốc:\n" + ex.Message);
            }
            finally
            {
                ModifyCommand();
            }
        }
        private void AddDetailNext(Janus.Windows.GridEX.GridEXRow gridExRow)
        {
            try
            {
                string  manhacungcap = "";
                string  NgayHethan   = "";
                string  solo         = "";
                int     id_thuoc     = -1;
                decimal dongia       = 0m;
                decimal Giaban       = 0m;

                Int32    soluongchuyen     = 0;
                decimal  vat               = 0m;
                int      isHetHan          = 0;
                long     IdThuockho        = 0;
                DateTime NgayNhap          = DateTime.Now;
                decimal  GiaBhyt           = 0m;
                int      soluongthat       = 0;
                int      tongsoluongchuyen = 0;
                tongsoluongchuyen = 0;
                soluongthat       = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_THAT"].Value);
                soluongchuyen     = Utility.Int32Dbnull(gridExRow.Cells["SO_LUONG_CHUYEN"].Value, 0);
                if (soluongchuyen > 0)
                {
                    NgayHethan   = Utility.sDbnull(gridExRow.Cells["NGAY_HET_HAN"].Value);
                    solo         = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoLo].Value);
                    id_thuoc     = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuoc].Value, -1);
                    IdThuockho   = Utility.Int32Dbnull(gridExRow.Cells[TThuockho.Columns.IdThuockho].Value, -1);
                    dongia       = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaNhap].Value, 0);
                    Giaban       = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBan].Value, 0);
                    GiaBhyt      = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.GiaBhyt].Value, 0);
                    NgayNhap     = Convert.ToDateTime(gridExRow.Cells[TThuockho.Columns.NgayNhap].Value).Date;
                    vat          = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.Vat].Value, 0);
                    isHetHan     = Utility.Int32Dbnull(gridExRow.Cells["IsHetHan"].Value, 0);
                    manhacungcap = Utility.sDbnull(gridExRow.Cells[TThuockho.Columns.MaNhacungcap].Value, 0);
                    DataRow[] arrDr = m_dtDataPhieuChiTiet.Select(TPhieuNhapxuatthuocChitiet.Columns.IdThuockho + "=" + IdThuockho.ToString());
                    if (arrDr.Length <= 0)
                    {
                        DataRow drv = m_dtDataPhieuChiTiet.NewRow();
                        drv[TPhieuNhapxuatthuocChitiet.Columns.MotaThem] = String.Empty;

                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuoc] = id_thuoc;
                        drv["ten_donvitinh"] = Utility.sDbnull(gridExRow.Cells["ten_donvitinh"].Value);
                        drv["IsHetHan"]      = isHetHan;
                        DmucThuoc objLDrug = DmucThuoc.FetchByID(id_thuoc);
                        if (objLDrug != null)
                        {
                            drv[DmucThuoc.Columns.TenThuoc]    = Utility.sDbnull(objLDrug.TenThuoc);
                            drv[DmucThuoc.Columns.HamLuong]    = Utility.sDbnull(objLDrug.HamLuong);
                            drv[DmucThuoc.Columns.HoatChat]    = Utility.sDbnull(objLDrug.HoatChat);
                            drv[DmucThuoc.Columns.NuocSanxuat] = Utility.sDbnull(objLDrug.NuocSanxuat);
                            drv[DmucThuoc.Columns.HangSanxuat] = Utility.sDbnull(objLDrug.HangSanxuat);
                        }
                        drv[TPhieuNhapxuatthuocChitiet.Columns.NgayNhap]           = NgayNhap;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBhyt]            = GiaBhyt;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaPhuthuDungtuyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuDungtuyen].Value, 0);
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaPhuthuTraituyen] = Utility.DecimaltoDbnull(gridExRow.Cells[TThuockho.Columns.PhuthuTraituyen].Value, 0);
                        drv[TPhieuNhapxuatthuocChitiet.Columns.Vat]          = vat;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaNhap]      = dongia;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.DonGia]       = dongia;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.MaNhacungcap] = manhacungcap;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoLo]         = solo;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoDky]        = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoDky].Value);
                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau]  = Utility.sDbnull(gridExRow.Cells[TPhieuNhapxuatthuocChitiet.Columns.SoQdinhthau].Value);
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdThuockho]   = IdThuockho;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdChuyen]     = IdThuockho;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.GiaBan]       = Giaban;

                        drv[TPhieuNhapxuatthuocChitiet.Columns.SoLuong]    = soluongchuyen;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.ThanhTien]  = dongia * soluongchuyen;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.ChietKhau]  = 0;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.NgayHethan] = NgayHethan;
                        drv[TPhieuNhapxuatthuocChitiet.Columns.IdPhieu]    = -1;
                        tongsoluongchuyen = soluongchuyen;
                        m_dtDataPhieuChiTiet.Rows.Add(drv);
                    }
                    else
                    {
                        arrDr[0]["SO_LUONG"] = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]) + soluongchuyen;
                        arrDr[0][TPhieuNhapxuatthuocChitiet.Columns.ThanhTien] = dongia * Utility.Int32Dbnull(arrDr[0]["SO_LUONG"], 0);
                        tongsoluongchuyen = Utility.Int32Dbnull(arrDr[0]["SO_LUONG"]);
                        m_dtDataPhieuChiTiet.AcceptChanges();
                    }
                    //Update lại dữ liệu từ kho xuất
                    gridExRow.BeginEdit();
                    gridExRow.Cells["SO_LUONG"].Value        = soluongthat - tongsoluongchuyen;
                    gridExRow.Cells["SO_LUONG_CHUYEN"].Value = 0;
                    gridExRow.IsChecked = false;
                    gridExRow.EndEdit();
                }
                grdKhoXuat.UpdateData();
                m_dtDataThuocKho.AcceptChanges();
            }
            catch (Exception ex)
            {
                Utility.ShowMsg("Lỗi khi chuyển thuốc:\n" + ex.Message);
            }
        }
Esempio n. 14
0
 private void Tb_IdCompraIngreso_KeyDown(object sender, KeyEventArgs e)
 {
     if (Tb_FechaEnt.IsInputReadOnly == false)
     {
         if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Enter)
         {
             var            lista         = new ServiceDesktop.ServiceDesktopClient().CompraIngreso_ListarEncabezado();
             List <GLCelda> listEstCeldas = new List <GLCelda>();
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Id", visible = true, titulo = "ID", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "NumNota", visible = true, titulo = "NOTA DE GRANJA", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "FechaEnt", visible = true, titulo = "FECHA ENTRADA", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "FechaRec", visible = true, titulo = "FECHA RECEPCION", tamano = 80
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Placa", visible = true, titulo = "PLACA", tamano = 120
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "IdProvee", visible = false, titulo = "IdProvee", tamano = 100
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Proveedor", visible = true, titulo = "PROVEEDOR", tamano = 150
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "Tipo", visible = false, titulo = "Tipo", tamano = 100
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "EdadSemana", visible = false, titulo = "EDAD SEMANA", tamano = 100
             });
             listEstCeldas.Add(new GLCelda()
             {
                 campo = "IdSucur", visible = false, titulo = "IdSucur", tamano = 100
             });
             Efecto efecto = new Efecto();
             efecto.Tipo       = 3;
             efecto.Tabla      = lista;
             efecto.SelectCol  = 2;
             efecto.listaCelda = listEstCeldas;
             efecto.Alto       = 50;
             efecto.Ancho      = 350;
             efecto.Context    = "SELECCIONE UN INGRESO";
             efecto.ShowDialog();
             bool bandera = false;
             bandera = efecto.Band;
             if (bandera)
             {
                 Janus.Windows.GridEX.GridEXRow Row = efecto.Row;
                 Tb_IdCompraIngreso.Text = Row.Cells["Id"].Value.ToString();
                 Tb_NUmGranja.Text       = Row.Cells["NumNota"].Value.ToString();
                 Tb_FechaEnt.Value       = Convert.ToDateTime(Row.Cells["FechaEnt"].Value);
                 Tb_FechaRec.Value       = Convert.ToDateTime(Row.Cells["FechaRec"].Value);
                 Cb_Tipo.Value           = Row.Cells["Tipo"].Value;
                 tb_Proveedor.Text       = Row.Cells["Proveedor"].Value.ToString();
                 Tb_Placa.Text           = Row.Cells["Placa"].Value.ToString();
                 Tb_Edad.Text            = Row.Cells["EdadSemana"].Value.ToString();
                 Cb_Almacen.Value        = Row.Cells["IdSucur"].Value;
                 MP_CargarDetalle(Convert.ToInt32(Tb_IdCompraIngreso.Text));
                 MP_CargarDetalle_Nuevo(Convert.ToInt32(Tb_IdCompraIngreso.Text));
             }
         }
     }
 }