예제 #1
0
        /// <summary>
        /// Handles the ButtonCustomClick event of the textBoxX1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void textBoxX1_ButtonCustomClick(object sender, EventArgs e)
        {
            int clinicId = 0;

            int.TryParse(cboClinic.SelectedValue.ToString(), out clinicId);
            frmWareHouseEdit frmedit = new frmWareHouseEdit(clinicId, 0, 0, 0);

            frmedit.StartPosition = FormStartPosition.CenterScreen;
            frmedit.ShowDialog();
            if (frmedit.IsOK)
            {
                FillToGrid();
            }
        }
예제 #2
0
        private void grd_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }
            rowIndex = e.RowIndex;

            if (grd.Rows[e.RowIndex].Cells["MedicineId"].Value == null)
            {
                IdWareHouse = 0;
                IdMedicine  = 0;
                minAllowed  = 0;
            }
            else
            {
                IdWareHouse = int.Parse(grd.Rows[e.RowIndex].Cells["Id"].Value.ToString());
                IdMedicine  = int.Parse(grd.Rows[e.RowIndex].Cells["MedicineId"].Value.ToString());
                minAllowed  = int.Parse(grd.Rows[e.RowIndex].Cells["MinAllowed"].Value.ToString());
            }

            if (IdWareHouse > 0)
            {
                int clinicId = 0;
                int.TryParse(cboClinic.SelectedValue.ToString(), out clinicId);
                frmWareHouseEdit frmEdit = new frmWareHouseEdit(clinicId, IdWareHouse, IdMedicine, minAllowed);
                frmEdit.StartPosition = FormStartPosition.CenterScreen;
                frmEdit.ShowDialog();

                if (rowIndex < 0)
                {
                    FillToGrid();
                }
                else
                {
                    grd.Rows[rowIndex].Cells["MinAllowed"].Value = frmEdit.MinAllowed;
                }
            }
        }
예제 #3
0
        private void grd_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1) return;
            rowIndex = e.RowIndex;

            if (grd.Rows[e.RowIndex].Cells["MedicineId"].Value == null)
            {
                IdWareHouse = 0;
                IdMedicine = 0;
                minAllowed = 0;
            }
            else
            {
                IdWareHouse = int.Parse(grd.Rows[e.RowIndex].Cells["Id"].Value.ToString());
                IdMedicine = int.Parse(grd.Rows[e.RowIndex].Cells["MedicineId"].Value.ToString());
                minAllowed = int.Parse(grd.Rows[e.RowIndex].Cells["MinAllowed"].Value.ToString());
            }

            if (IdWareHouse > 0)
            {
                int clinicId = 0;
                int.TryParse(cboClinic.SelectedValue.ToString(), out clinicId);
                frmWareHouseEdit frmEdit = new frmWareHouseEdit(clinicId, IdWareHouse, IdMedicine, minAllowed);
                frmEdit.StartPosition = FormStartPosition.CenterScreen;
                frmEdit.ShowDialog();

                if (rowIndex < 0)
                    FillToGrid();
                else
                    grd.Rows[rowIndex].Cells["MinAllowed"].Value = frmEdit.MinAllowed;
            }
        }
예제 #4
0
 /// <summary>
 /// Handles the ButtonCustomClick event of the textBoxX1 control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void textBoxX1_ButtonCustomClick(object sender, EventArgs e)
 {
     int clinicId = 0;
     int.TryParse(cboClinic.SelectedValue.ToString(), out clinicId);
     frmWareHouseEdit frmedit = new frmWareHouseEdit(clinicId, 0, 0, 0);
     frmedit.StartPosition = FormStartPosition.CenterScreen;
     frmedit.ShowDialog();
     if (frmedit.IsOK)
     {
         FillToGrid();
     }
 }