Example #1
0
        private void InitialControls()
        {
            //initial type
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.CSSD, Value = ConstDef.TEXT_CSSD_STERILEROOM });
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.OP, Value = ConstDef.TEXT_OP_STERILEROOM });
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.FACILITY, Value = ConstDef.TEXT_FACILITY_STERILEROOM });
            cmbType.ValueMember   = "Key";
            cmbType.DisplayMember = "Value";

            //initial dept
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QueryDeptInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                foreach (DataRow row in queryTable.Rows)
                {
                    int    id   = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.DEPT_ID], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                    string name = Judgement.JudgeDBNullValue(row[ConstDef.TEXT_DEPT_SIMPLE_NAME], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
                    cmbDept.Items.Add(new { Key = id, Value = name });
                }
                cmbDept.ValueMember   = "Key";
                cmbDept.DisplayMember = "Value";
            }
        }
Example #2
0
        private void btnInsAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInsInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb   = new DbMaintainment();
                int            id       = 0;
                string         operId   = Judgement.JudgeDBNullValue(dgvOperList.SelectedRows[0].Cells[DBConstDef.OPERATION_CODE].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
                int            insCount = 0;
                if (!string.IsNullOrEmpty(tbInsQuantity.Text))
                {
                    insCount = Convert.ToInt32(tbInsQuantity.Text);
                }
                operDb.InsertAutoPackageInsInfo(ref id, operId, tbInsCode.Text, insCount);
                DataRow newRow = ((DataTable)dgvIns.DataSource).NewRow();
                newRow[DBConstDef.OPID_ID]                = id;
                newRow[ConstDef.TEXT_INS_NAME]            = ddlInsName.Text;
                newRow[DBConstDef.TEXT_INS_CODE]          = tbInsCode.Text;
                newRow[DBConstDef.TEXT_INS_SPECIFICATION] = tbInsSpec.Text;
                newRow[DBConstDef.TEXT_INS_UNIT]          = tbInsUnit.Text;
                newRow[DBConstDef.TEXT_INS_AMOUNT]        = tbInsQuantity.Text;
                ((DataTable)dgvIns.DataSource).Rows.Add(newRow);
            }
        }
Example #3
0
        private void UpdateSterileAreaInfo()
        {
            int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.SI_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (id <= 0)
            {
                return;
            }
            //apply to datagridview, its datasource and db
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_STERILE_AREA_TYPE].Value = cmbType.Text;
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_STERILE_AREA_NAME].Value = tbName.Text;
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_DEPT_NAME].Value         = cmbDept.Text;
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_ROOM_NAME].Value         = cmbRoom.Text;
            int type = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null));
            int dept = (int)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
            int room = -1;

            if (null != cmbRoom.SelectedItem)
            {
                room = (int)(cmbRoom.SelectedItem.GetType().GetProperty("Key").GetValue(cmbRoom.SelectedItem, null));
            }
            ((DataTable)dgv.DataSource).AcceptChanges();
            DbMaintainment operDb = new DbMaintainment();

            operDb.UpdateSterileAreaInfo(id, tbName.Text, type, dept, cmbDept.Text, room, cmbRoom.Text);
        }
Example #4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int            id     = 0;
                int            type   = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null));
                int            dept   = (int)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
                int            room   = -1;
                if (null != cmbRoom.SelectedItem)
                {
                    room = (int)(cmbRoom.SelectedItem.GetType().GetProperty("Key").GetValue(cmbRoom.SelectedItem, null));
                }
                operDb.InsertSterileAreaInfo(ref id, tbName.Text, type, dept, cmbDept.Text, room, cmbRoom.Text);

                DataRow newRow = ((DataTable)dgv.DataSource).NewRow();
                newRow[DBConstDef.SI_ID] = id;
                newRow[ConstDef.TEXT_STERILE_AREA_TYPE] = cmbType.Text;
                newRow[ConstDef.TEXT_STERILE_AREA_NAME] = tbName.Text;
                newRow[ConstDef.TEXT_DEPT_NAME]         = cmbDept.Text;
                newRow[ConstDef.TEXT_ROOM_NAME]         = cmbRoom.Text;
                ((DataTable)dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInsInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int            insId  = 0;
                operDb.InsertInsInfo(ref insId, (int)(EnumDef.INS_KINDS)(cmbINSType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbINSType.SelectedItem, null)), tbProductName.Text, tbCommonName.Text, tbCode.Text, tbSpec.Text, txtINSUnit.Text, tbInputcode.Text);

                DataRow newRow = ((DataTable)dgv.DataSource).NewRow();
                newRow[DBConstDef.INS_ID]                 = insId;
                newRow[ConstDef.TEXT_CONST_IND_KIND]      = cmbINSType.Text;
                newRow[ConstDef.TEXT_INS_NAME]            = tbProductName.Text;
                newRow[ConstDef.TEXT_INS_PRODUCT_NAME]    = tbCommonName.Text;
                newRow[DBConstDef.TEXT_INS_CODE]          = tbCode.Text;
                newRow[DBConstDef.TEXT_INS_SPECIFICATION] = tbSpec.Text;
                newRow[DBConstDef.TEXT_INS_UNIT]          = txtINSUnit.Text;
                newRow[ConstDef.TEXT_INS_INPUTCODE]       = tbInputcode.Text;
                ((DataTable)dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int            drugId = 0;
                operDb.InsertDrugInfo(ref drugId, tbName.Text, tbInputcode.Text, tbCommonName.Text, tbCommonInputcode.Text, cmbManufactuer.Text, tbCode.Text, tbSpec.Text, tbUnit.Text, tbPackUnit.Text, tbUnitRatio.Text);

                DataRow newRow = ((DataTable)dgv.DataSource).NewRow();
                newRow[DBConstDef.DRUG_ID]                  = drugId;
                newRow[ConstDef.TEXT_DRUG_NAME]             = tbName.Text;
                newRow[ConstDef.TEXT_DRUG_INPUTCODE]        = tbInputcode.Text;
                newRow[DBConstDef.TEXT_DRUG_PRODUCT_NAME]   = tbCommonName.Text;
                newRow[ConstDef.TEXT_DRUG_COMMON_INPUTCODE] = tbCommonInputcode.Text;
                newRow[ConstDef.TEXT_DRUG_MANUFACTUER]      = cmbManufactuer.Text;
                newRow[ConstDef.TEXT_DRUG_CODE]             = tbCode.Text;
                newRow[DBConstDef.TEXT_DRUG_SPECIFICATION]  = tbSpec.Text;
                newRow[DBConstDef.TEXT_DRUG_UNIT]           = tbUnit.Text;
                newRow[ConstDef.TEXT_DRUG_PACK_UNIT]        = tbPackUnit.Text;
                int ratio = -1;
                if (int.TryParse(tbUnitRatio.Text, out ratio))
                {
                    newRow[ConstDef.TEXT_DRUG_UNIT_RATIO] = ratio;
                }

                ((DataTable)dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #7
0
        private void btnDrugAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckDrugInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb    = new DbMaintainment();
                int            id        = 0;
                string         operId    = Judgement.JudgeDBNullValue(dgvOperList.SelectedRows[0].Cells[DBConstDef.OPERATION_CODE].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
                int            drugCount = 0;
                if (!string.IsNullOrEmpty(tbDrugQuantity.Text))
                {
                    drugCount = Convert.ToInt32(tbDrugQuantity.Text);
                }
                operDb.InsertAutoPackageDrugInfo(ref id, operId, tbDrugCode.Text, ddlDrugName.Text, tbDrugProductName.Text, tbDrugSpec.Text, tbDrugManufacture.Text, tbDrugUnit.Text, drugCount);
                DataRow newRow = ((DataTable)dgvDrug.DataSource).NewRow();
                newRow[DBConstDef.OPDD_ID] = id;
                newRow[DBConstDef.TEXT_DRUG_COMMON_NAME]   = ddlDrugName.Text;
                newRow[DBConstDef.TEXT_DRUG_PRODUCT_NAME]  = tbDrugProductName.Text;
                newRow[DBConstDef.TEXT_DRUG_SPECIFICATION] = tbDrugSpec.Text;
                newRow[DBConstDef.TEXT_DRUG_FACTORY]       = tbDrugManufacture.Text;
                newRow[DBConstDef.TEXT_DRUG_UNIT]          = tbDrugUnit.Text;
                newRow[DBConstDef.TEXT_DRUG_AMOUNT]        = tbDrugQuantity.Text;
                newRow[DBConstDef.TEXT_DRUG_ID]            = tbDrugCode.Text;
                ((DataTable)dgvDrug.DataSource).Rows.Add(newRow);
            }
        }
Example #8
0
 private void InitialOperList()
 {
     DbMaintainment operDb = new DbMaintainment();
     _operDict = new DataTable();
     if (operDb.QueryOperationDicInfo(ref _operDict) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         BingOperTable();
     }
 }
Example #9
0
        private void InitialOperList()
        {
            DbMaintainment operDb = new DbMaintainment();

            _operDict = new DataTable();
            if (operDb.QueryOperationDicInfo(ref _operDict) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                BingOperTable();
            }
        }
Example #10
0
 private void InitialDrug()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable drugTable = new DataTable();
     if (operDb.QueryDrugInfo(ref drugTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         dgv.DataSource = drugTable;
         if (null != dgv.Columns[DBConstDef.DRUG_ID])
             dgv.Columns[DBConstDef.DRUG_ID].Visible = false;
     }
 }
Example #11
0
 private void InitialDrugManufactures()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable queryTable = new DataTable();
     if (operDb.QueryDrugManufacturerInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         dgv.DataSource = queryTable;
         if (null != dgv.Columns[DBConstDef.PC_ID])
             dgv.Columns[DBConstDef.PC_ID].Visible = false;
     }
 }
Example #12
0
        private void LoadIns(string operId)
        {
            DbMaintainment operDb   = new DbMaintainment();
            DataTable      insTable = new DataTable();

            operDb.QueryAutoPackageInsInfo(ref insTable, operId);
            dgvIns.DataSource = insTable;
            if (null != dgvIns.Columns[DBConstDef.OPID_ID])
            {
                dgvIns.Columns[DBConstDef.OPID_ID].Visible = false;
            }
        }
Example #13
0
        private void LoadDrug(string operId)
        {
            DbMaintainment operDb    = new DbMaintainment();
            DataTable      drugTable = new DataTable();

            operDb.QueryAutoPackageDrugInfo(ref drugTable, operId);
            dgvDrug.DataSource = drugTable;
            if (null != dgvDrug.Columns[DBConstDef.OPDD_ID])
            {
                dgvDrug.Columns[DBConstDef.OPDD_ID].Visible = false;
            }
        }
Example #14
0
        private void InitialDrug()
        {
            DbMaintainment operDb    = new DbMaintainment();
            DataTable      drugTable = new DataTable();

            if (operDb.QueryDrugInfo(ref drugTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                dgv.DataSource = drugTable;
                if (null != dgv.Columns[DBConstDef.DRUG_ID])
                {
                    dgv.Columns[DBConstDef.DRUG_ID].Visible = false;
                }
            }
        }
Example #15
0
 private void DeleteDrugManufacturersInfo()
 {
     foreach (DataGridViewRow selRow in dgv.SelectedRows)
     {
         int            id     = Convert.ToInt32(Judgement.JudgeDBNullValue(selRow.Cells[DBConstDef.PC_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
         DbMaintainment operDb = new DbMaintainment();
         operDb.DeleteDrugManufacturersInfo(id);
         DataRow[] selRows = ((DataTable)dgv.DataSource).Select(string.Format("{0}={1}", DBConstDef.PC_ID, id));
         if (selRows.Length > 0)
         {
             ((DataTable)dgv.DataSource).Rows.Remove(selRows[0]);
         }
     }
 }
Example #16
0
        private void InitialDrugManufactures()
        {
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QueryDrugManufacturerInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                dgv.DataSource = queryTable;
                if (null != dgv.Columns[DBConstDef.PC_ID])
                {
                    dgv.Columns[DBConstDef.PC_ID].Visible = false;
                }
            }
        }
Example #17
0
 private void InitialControls()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable queryTable = new DataTable();
     if (operDb.QueryDrugManufacturerInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         foreach (DataRow row in queryTable.Rows)
         {
             string name = (string)Judgement.JudgeDBNullValue(row[ConstDef.TEXT_DRUG_COMPANY_NAME], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING);
             if (!string.IsNullOrEmpty(name))
                 cmbManufactuer.Items.Add(name);
         }
     }
 }
Example #18
0
        private void UpdateDrugManufacturersInfo()
        {
            int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.PC_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (id <= 0)
            {
                return;
            }
            //apply to datagridview, its datasource and db
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMPANY_NAME].Value = tbName.Text;
            dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMPANY_CODE].Value = tbInputcode.Text;
            ((DataTable)dgv.DataSource).AcceptChanges();
            DbMaintainment operDb = new DbMaintainment();

            operDb.UpdateDrugManufacturersInfo(id, tbName.Text, tbInputcode.Text);
        }
Example #19
0
        private void UpdateInfo()
        {
            int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.ID_INFO_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (id > 0)
            {
                //apply to datagridview, its datasource and db
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_CATEGORY].Value = cmbType.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_NAME].Value     = tbName.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_CODE].Value     = tbCode.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_NO].Value       = tbCardNo.Text;
                ((DataTable)dgv.DataSource).AcceptChanges();
                DbMaintainment operDb = new DbMaintainment();
                operDb.UpdateIdCardInfo(id, (int)(EnumDef.TRACE_ID_CATEGORY)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null)), tbName.Text, tbCode.Text, tbCardNo.Text);
            }
        }
Example #20
0
        private void InitialControls()
        {
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QueryDrugManufacturerInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                foreach (DataRow row in queryTable.Rows)
                {
                    string name = (string)Judgement.JudgeDBNullValue(row[ConstDef.TEXT_DRUG_COMPANY_NAME], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING);
                    if (!string.IsNullOrEmpty(name))
                    {
                        cmbManufactuer.Items.Add(name);
                    }
                }
            }
        }
Example #21
0
 private void InitialIdCard()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable queryTable = new DataTable();
     if (operDb.QueryIdCardInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         if (null != queryTable.Columns[DBConstDef.TEXT_ID_INFO_CATEGORY])
         {
             foreach (DataRow row in queryTable.Rows)
             {
                 int category = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.TEXT_ID_INFO_CATEGORY].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                 row[DBConstDef.TEXT_ID_INFO_CATEGORY] = Enum.GetName(typeof(EnumDef.TRACE_ID_CATEGORY), (EnumDef.TRACE_ID_CATEGORY)category);
             }
         }
         dgv.DataSource = queryTable;
         if (null != dgv.Columns[DBConstDef.ID_INFO_ID])
             dgv.Columns[DBConstDef.ID_INFO_ID].Visible = false;
     }
 }
Example #22
0
 private void InitialIns()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable insTable = new DataTable();
     if (operDb.QueryInsInfo(ref insTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         if (null != insTable.Columns[ConstDef.TEXT_CONST_IND_KIND])
         {
             foreach (DataRow row in insTable.Rows)
             {
                 int kind = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_CONST_IND_KIND].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                 row[ConstDef.TEXT_CONST_IND_KIND] = TransDef.MatchInsKindToString((EnumDef.INS_KINDS) kind);
             }
         }
         dgv.DataSource = insTable;
         if (null != dgv.Columns[DBConstDef.INS_ID])
             dgv.Columns[DBConstDef.INS_ID].Visible = false;
     }
 }
Example #23
0
        private void UpdateInsInfo()
        {
            int insId = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.INS_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (insId > 0)
            {
                //apply to datagridview, its datasource and db
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_CONST_IND_KIND].Value      = cmbINSType.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_NAME].Value            = tbProductName.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_PRODUCT_NAME].Value    = tbCommonName.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_CODE].Value          = tbCode.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_SPECIFICATION].Value = tbSpec.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_UNIT].Value          = txtINSUnit.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_INPUTCODE].Value       = tbInputcode.Text;
                ((DataTable)dgv.DataSource).AcceptChanges();
                DbMaintainment operDb = new DbMaintainment();
                operDb.UpdateInsInfo(insId, (int)(EnumDef.INS_KINDS)(cmbINSType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbINSType.SelectedItem, null)), tbProductName.Text, tbCommonName.Text, tbCode.Text, tbSpec.Text, txtINSUnit.Text, tbInputcode.Text);
            }
        }
Example #24
0
 private void InitialSterileArea()
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable queryTable = new DataTable();
     if (operDb.QuerySterileAreaInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         if (null != queryTable.Columns[ConstDef.TEXT_STERILE_AREA_TYPE])
         {
             foreach (DataRow row in queryTable.Rows)
             {
                 int type = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_STERILE_AREA_TYPE].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                 row[ConstDef.TEXT_STERILE_AREA_TYPE] = TransDef.MatchSterileRoomTypeToString((EnumDef.STERILE_ROOM_TYPE)type);
             }
         }
         dgv.DataSource = queryTable;
         if (null != dgv.Columns[DBConstDef.SI_ID])
             dgv.Columns[DBConstDef.SI_ID].Visible = false;
     }
 }
Example #25
0
        private void cmbDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            cmbRoom.Items.Clear();
            int            id         = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QueryRoomInfoByDeptId(ref queryTable, id) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                foreach (DataRow row in queryTable.Rows)
                {
                    int    roomId = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.ROOM_ID], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                    string name   = Judgement.JudgeDBNullValue(row[ConstDef.TEXT_ROOM_NAME], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
                    cmbRoom.Items.Add(new { Key = roomId, Value = name });
                }
                cmbRoom.ValueMember   = "Key";
                cmbRoom.DisplayMember = "Value";
            }
        }
Example #26
0
        private void UpdateInsInfo()
        {
            int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgvIns.SelectedRows[0].Cells[DBConstDef.OPID_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (id > 0)
            {
                //apply to datagridview, its datasource and db
                dgvIns.SelectedRows[0].Cells[ConstDef.TEXT_INS_NAME].Value            = ddlInsName.Text;
                dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_CODE].Value          = tbInsCode.Text;
                dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_SPECIFICATION].Value = tbInsSpec.Text;
                dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_UNIT].Value          = tbInsUnit.Text;
                dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_AMOUNT].Value        = tbInsQuantity.Text;
                ((DataTable)dgvIns.DataSource).AcceptChanges();
                DbMaintainment operDb   = new DbMaintainment();
                int            insCount = 0;
                if (!string.IsNullOrEmpty(tbInsQuantity.Text))
                {
                    insCount = Convert.ToInt32(tbInsQuantity.Text);
                }
                operDb.UpdateAutoPackageInsInfo(id, tbInsCode.Text, insCount);
            }
        }
Example #27
0
        private void InitialSterileArea()
        {
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QuerySterileAreaInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                if (null != queryTable.Columns[ConstDef.TEXT_STERILE_AREA_TYPE])
                {
                    foreach (DataRow row in queryTable.Rows)
                    {
                        int type = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_STERILE_AREA_TYPE].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                        row[ConstDef.TEXT_STERILE_AREA_TYPE] = TransDef.MatchSterileRoomTypeToString((EnumDef.STERILE_ROOM_TYPE)type);
                    }
                }
                dgv.DataSource = queryTable;
                if (null != dgv.Columns[DBConstDef.SI_ID])
                {
                    dgv.Columns[DBConstDef.SI_ID].Visible = false;
                }
            }
        }
Example #28
0
        private void InitialIns()
        {
            DbMaintainment operDb   = new DbMaintainment();
            DataTable      insTable = new DataTable();

            if (operDb.QueryInsInfo(ref insTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                if (null != insTable.Columns[ConstDef.TEXT_CONST_IND_KIND])
                {
                    foreach (DataRow row in insTable.Rows)
                    {
                        int kind = Convert.ToInt32(Judgement.JudgeDBNullValue(row[ConstDef.TEXT_CONST_IND_KIND].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                        row[ConstDef.TEXT_CONST_IND_KIND] = TransDef.MatchInsKindToString((EnumDef.INS_KINDS)kind);
                    }
                }
                dgv.DataSource = insTable;
                if (null != dgv.Columns[DBConstDef.INS_ID])
                {
                    dgv.Columns[DBConstDef.INS_ID].Visible = false;
                }
            }
        }
Example #29
0
        private void InitialIdCard()
        {
            DbMaintainment operDb     = new DbMaintainment();
            DataTable      queryTable = new DataTable();

            if (operDb.QueryIdCardInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                if (null != queryTable.Columns[DBConstDef.TEXT_ID_INFO_CATEGORY])
                {
                    foreach (DataRow row in queryTable.Rows)
                    {
                        int category = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.TEXT_ID_INFO_CATEGORY].ToString(), EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                        row[DBConstDef.TEXT_ID_INFO_CATEGORY] = Enum.GetName(typeof(EnumDef.TRACE_ID_CATEGORY), (EnumDef.TRACE_ID_CATEGORY)category);
                    }
                }
                dgv.DataSource = queryTable;
                if (null != dgv.Columns[DBConstDef.ID_INFO_ID])
                {
                    dgv.Columns[DBConstDef.ID_INFO_ID].Visible = false;
                }
            }
        }
Example #30
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int            id     = 0;
                operDb.InsertDrugManufacturersInfo(ref id, tbName.Text, tbInputcode.Text);

                DataRow newRow = ((DataTable)dgv.DataSource).NewRow();
                newRow[DBConstDef.PC_ID] = id;
                newRow[ConstDef.TEXT_DRUG_COMPANY_NAME] = tbName.Text;
                newRow[ConstDef.TEXT_DRUG_COMPANY_CODE] = tbInputcode.Text;
                ((DataTable)dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #31
0
        private void UpdateDrugInfo()
        {
            int drugId = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.DRUG_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (drugId > 0)
            {
                //apply to datagridview, its datasource and db
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_NAME].Value             = tbName.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_INPUTCODE].Value        = tbInputcode.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_PRODUCT_NAME].Value   = tbCommonName.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMMON_INPUTCODE].Value = tbCommonInputcode.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_MANUFACTUER].Value      = cmbManufactuer.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_CODE].Value             = tbCode.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_SPECIFICATION].Value  = tbSpec.Text;
                dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_UNIT].Value           = tbUnit.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_PACK_UNIT].Value        = tbPackUnit.Text;
                dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_UNIT_RATIO].Value       = tbUnitRatio.Text;
                ((DataTable)dgv.DataSource).AcceptChanges();
                DbMaintainment operDb = new DbMaintainment();
                operDb.UpdateDrugInfo(drugId, tbName.Text, tbInputcode.Text, tbCommonName.Text, tbCommonInputcode.Text, cmbManufactuer.Text, tbCode.Text, tbSpec.Text, tbUnit.Text, tbPackUnit.Text, tbUnitRatio.Text);
            }
        }
Example #32
0
        private void UpdateDrugInfo()
        {
            int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgvDrug.SelectedRows[0].Cells[DBConstDef.OPDD_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));

            if (id > 0)
            {
                //apply to datagridview, its datasource and db
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_COMMON_NAME].Value   = ddlDrugName.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_PRODUCT_NAME].Value  = tbDrugProductName.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_FACTORY].Value       = tbDrugManufacture.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_ID].Value            = tbDrugCode.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_SPECIFICATION].Value = tbDrugSpec.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_UNIT].Value          = tbDrugUnit.Text;
                dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_AMOUNT].Value        = tbDrugQuantity.Text;
                ((DataTable)dgvDrug.DataSource).AcceptChanges();
                DbMaintainment operDb    = new DbMaintainment();
                int            drugCount = 0;
                if (!string.IsNullOrEmpty(tbDrugQuantity.Text))
                {
                    drugCount = Convert.ToInt32(tbDrugQuantity.Text);
                }
                operDb.UpdateAutoPackageDrugInfo(id, tbDrugCode.Text, ddlDrugName.Text, tbDrugProductName.Text, tbDrugSpec.Text, tbDrugManufacture.Text, tbDrugUnit.Text, drugCount);
            }
        }
Example #33
0
        private void InitialControls()
        {
            //initial type
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.CSSD, Value = ConstDef.TEXT_CSSD_STERILEROOM });
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.OP, Value = ConstDef.TEXT_OP_STERILEROOM });
            cmbType.Items.Add(new { Key = EnumDef.STERILE_ROOM_TYPE.FACILITY, Value = ConstDef.TEXT_FACILITY_STERILEROOM });
            cmbType.ValueMember = "Key";
            cmbType.DisplayMember = "Value";

            //initial dept
            DbMaintainment operDb = new DbMaintainment();
            DataTable queryTable = new DataTable();
            if (operDb.QueryDeptInfo(ref queryTable) == EnumDef.DBMEDITS_RESULT.SUCCESS)
            {
                foreach (DataRow row in queryTable.Rows)
                {
                    int id = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.DEPT_ID], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
                    string name = Judgement.JudgeDBNullValue(row[ConstDef.TEXT_DEPT_SIMPLE_NAME],EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
                    cmbDept.Items.Add(new { Key = id, Value = name });
                }
                cmbDept.ValueMember = "Key";
                cmbDept.DisplayMember = "Value";
            }
        }
Example #34
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;

            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int            id     = 0;
                operDb.InsertIdCardInfo(ref id, (int)(EnumDef.TRACE_ID_CATEGORY)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null)), tbName.Text, tbCode.Text, tbCardNo.Text);

                DataRow newRow = ((DataTable)dgv.DataSource).NewRow();
                newRow[DBConstDef.ID_INFO_ID]            = id;
                newRow[DBConstDef.TEXT_ID_INFO_CATEGORY] = cmbType.Text;
                newRow[DBConstDef.TEXT_ID_INFO_NAME]     = tbName.Text;
                newRow[DBConstDef.TEXT_ID_INFO_CODE]     = tbCode.Text;
                newRow[DBConstDef.TEXT_ID_INFO_NO]       = tbCardNo.Text;
                ((DataTable)dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #35
0
 private void UpdateDrugInfo()
 {
     int drugId = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.DRUG_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (drugId > 0)
     {
         //apply to datagridview, its datasource and db
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_NAME].Value = tbName.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_INPUTCODE].Value = tbInputcode.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_PRODUCT_NAME].Value = tbCommonName.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMMON_INPUTCODE].Value = tbCommonInputcode.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_MANUFACTUER].Value = cmbManufactuer.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_CODE].Value = tbCode.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_SPECIFICATION].Value = tbSpec.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_UNIT].Value = tbUnit.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_PACK_UNIT].Value = tbPackUnit.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_UNIT_RATIO].Value = tbUnitRatio.Text;
         ((DataTable)dgv.DataSource).AcceptChanges();
         DbMaintainment operDb = new DbMaintainment();
         operDb.UpdateDrugInfo(drugId, tbName.Text, tbInputcode.Text, tbCommonName.Text, tbCommonInputcode.Text, cmbManufactuer.Text, tbCode.Text, tbSpec.Text, tbUnit.Text, tbPackUnit.Text, tbUnitRatio.Text);
     }
 }
Example #36
0
 private void UpdateInfo()
 {
     int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.ID_INFO_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (id > 0)
     {
         //apply to datagridview, its datasource and db
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_CATEGORY].Value = cmbType.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_NAME].Value = tbName.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_CODE].Value = tbCode.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_ID_INFO_NO].Value = tbCardNo.Text;
         ((DataTable)dgv.DataSource).AcceptChanges();
         DbMaintainment operDb = new DbMaintainment();
         operDb.UpdateIdCardInfo(id, (int)(EnumDef.TRACE_ID_CATEGORY)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null)), tbName.Text, tbCode.Text, tbCardNo.Text);
     }
 }
Example #37
0
 private void UpdateSterileAreaInfo()
 {
     int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.SI_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (id <= 0) return;
     //apply to datagridview, its datasource and db
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_STERILE_AREA_TYPE].Value = cmbType.Text;
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_STERILE_AREA_NAME].Value = tbName.Text;
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_DEPT_NAME].Value = cmbDept.Text;
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_ROOM_NAME].Value = cmbRoom.Text;
     int type = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null));
     int dept = (int)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
     int room = -1;
     if (null != cmbRoom.SelectedItem)
         room = (int)(cmbRoom.SelectedItem.GetType().GetProperty("Key").GetValue(cmbRoom.SelectedItem, null));
     ((DataTable)dgv.DataSource).AcceptChanges();
     DbMaintainment operDb = new DbMaintainment();
     operDb.UpdateSterileAreaInfo(id, tbName.Text, type, dept, cmbDept.Text, room, cmbRoom.Text);
 }
Example #38
0
 private void btnDrugAdd_Click(object sender, EventArgs e)
 {
     string errMsg = string.Empty;
     if (!CheckDrugInfoValid(ref errMsg, true))
     {
         BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
     }
     else
     {
         //insert a new row, db and datatable
         DbMaintainment operDb = new DbMaintainment();
         int id = 0;
         string operId = Judgement.JudgeDBNullValue(dgvOperList.SelectedRows[0].Cells[DBConstDef.OPERATION_CODE].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
         int drugCount = 0;
         if (!string.IsNullOrEmpty(tbDrugQuantity.Text))
             drugCount = Convert.ToInt32(tbDrugQuantity.Text);
         operDb.InsertAutoPackageDrugInfo(ref id, operId, tbDrugCode.Text, ddlDrugName.Text, tbDrugProductName.Text, tbDrugSpec.Text, tbDrugManufacture.Text,  tbDrugUnit.Text, drugCount);
         DataRow newRow = ((DataTable)dgvDrug.DataSource).NewRow();
         newRow[DBConstDef.OPDD_ID] = id;
         newRow[DBConstDef.TEXT_DRUG_COMMON_NAME] = ddlDrugName.Text;
         newRow[DBConstDef.TEXT_DRUG_PRODUCT_NAME] = tbDrugProductName.Text;
         newRow[DBConstDef.TEXT_DRUG_SPECIFICATION] = tbDrugSpec.Text;
         newRow[DBConstDef.TEXT_DRUG_FACTORY] = tbDrugManufacture.Text;
         newRow[DBConstDef.TEXT_DRUG_UNIT] = tbDrugUnit.Text;
         newRow[DBConstDef.TEXT_DRUG_AMOUNT] = tbDrugQuantity.Text;
         newRow[DBConstDef.TEXT_DRUG_ID] = tbDrugCode.Text;
         ((DataTable)dgvDrug.DataSource).Rows.Add(newRow);
     }
 }
Example #39
0
 private void DeleteInsInfo()
 {
     foreach (DataGridViewRow selRow in dgv.SelectedRows)
     {
         int insId = Convert.ToInt32(Judgement.JudgeDBNullValue(selRow.Cells[DBConstDef.INS_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
         DbMaintainment operDb = new DbMaintainment();
         operDb.DeleteInsInfo(insId);
         DataRow[] selRows =((DataTable) dgv.DataSource).Select(string.Format("{0}={1}", DBConstDef.INS_ID, insId));
         if (selRows.Length>0)
             ((DataTable)dgv.DataSource).Rows.Remove(selRows[0]);
     }
 }
Example #40
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;
            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int id = 0;
                operDb.InsertDrugManufacturersInfo(ref id, tbName.Text, tbInputcode.Text);

                DataRow newRow = ((DataTable) dgv.DataSource).NewRow();
                newRow[DBConstDef.PC_ID] = id;
                newRow[ConstDef.TEXT_DRUG_COMPANY_NAME] = tbName.Text;
                newRow[ConstDef.TEXT_DRUG_COMPANY_CODE] = tbInputcode.Text;
                ((DataTable) dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #41
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;
            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int drugId = 0;
                operDb.InsertDrugInfo(ref drugId, tbName.Text, tbInputcode.Text, tbCommonName.Text, tbCommonInputcode.Text, cmbManufactuer.Text, tbCode.Text, tbSpec.Text, tbUnit.Text, tbPackUnit.Text, tbUnitRatio.Text);

                DataRow newRow = ((DataTable) dgv.DataSource).NewRow();
                newRow[DBConstDef.DRUG_ID] = drugId;
                newRow[ConstDef.TEXT_DRUG_NAME] = tbName.Text;
                newRow[ConstDef.TEXT_DRUG_INPUTCODE] = tbInputcode.Text;
                newRow[DBConstDef.TEXT_DRUG_PRODUCT_NAME] = tbCommonName.Text;
                newRow[ConstDef.TEXT_DRUG_COMMON_INPUTCODE] = tbCommonInputcode.Text;
                newRow[ConstDef.TEXT_DRUG_MANUFACTUER] = cmbManufactuer.Text;
                newRow[ConstDef.TEXT_DRUG_CODE] = tbCode.Text;
                newRow[DBConstDef.TEXT_DRUG_SPECIFICATION] = tbSpec.Text;
                newRow[DBConstDef.TEXT_DRUG_UNIT] = tbUnit.Text;
                newRow[ConstDef.TEXT_DRUG_PACK_UNIT] = tbPackUnit.Text;
                int ratio = -1;
                if (int.TryParse(tbUnitRatio.Text,out ratio))
                    newRow[ConstDef.TEXT_DRUG_UNIT_RATIO] = ratio;

                ((DataTable) dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #42
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;
            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int id = 0;
                operDb.InsertIdCardInfo(ref id, (int)(EnumDef.TRACE_ID_CATEGORY)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null)), tbName.Text, tbCode.Text, tbCardNo.Text);

                DataRow newRow = ((DataTable) dgv.DataSource).NewRow();
                newRow[DBConstDef.ID_INFO_ID] = id;
                newRow[DBConstDef.TEXT_ID_INFO_CATEGORY] = cmbType.Text;
                newRow[DBConstDef.TEXT_ID_INFO_NAME] = tbName.Text;
                newRow[DBConstDef.TEXT_ID_INFO_CODE] = tbCode.Text;
                newRow[DBConstDef.TEXT_ID_INFO_NO] = tbCardNo.Text;
                ((DataTable) dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #43
0
 private void UpdateDrugManufacturersInfo()
 {
     int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.PC_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (id <= 0) return;
     //apply to datagridview, its datasource and db
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMPANY_NAME].Value = tbName.Text;
     dgv.SelectedRows[0].Cells[ConstDef.TEXT_DRUG_COMPANY_CODE].Value = tbInputcode.Text;
     ((DataTable)dgv.DataSource).AcceptChanges();
     DbMaintainment operDb = new DbMaintainment();
     operDb.UpdateDrugManufacturersInfo(id, tbName.Text, tbInputcode.Text);
 }
Example #44
0
 private void LoadIns(string operId)
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable insTable = new DataTable();
     operDb.QueryAutoPackageInsInfo(ref insTable, operId);
     dgvIns.DataSource = insTable;
     if (null != dgvIns.Columns[DBConstDef.OPID_ID])
         dgvIns.Columns[DBConstDef.OPID_ID].Visible = false;
 }
Example #45
0
 private void UpdateDrugInfo()
 {
     int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgvDrug.SelectedRows[0].Cells[DBConstDef.OPDD_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (id > 0)
     {
         //apply to datagridview, its datasource and db
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_COMMON_NAME].Value = ddlDrugName.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_PRODUCT_NAME].Value = tbDrugProductName.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_FACTORY].Value = tbDrugManufacture.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_ID].Value = tbDrugCode.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_SPECIFICATION].Value = tbDrugSpec.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_UNIT].Value = tbDrugUnit.Text;
         dgvDrug.SelectedRows[0].Cells[DBConstDef.TEXT_DRUG_AMOUNT].Value = tbDrugQuantity.Text;
         ((DataTable)dgvDrug.DataSource).AcceptChanges();
         DbMaintainment operDb = new DbMaintainment();
         int drugCount = 0;
         if (!string.IsNullOrEmpty(tbDrugQuantity.Text))
             drugCount = Convert.ToInt32(tbDrugQuantity.Text);
         operDb.UpdateAutoPackageDrugInfo(id, tbDrugCode.Text, ddlDrugName.Text, tbDrugProductName.Text, tbDrugSpec.Text, tbDrugManufacture.Text, tbDrugUnit.Text, drugCount);
     }
 }
Example #46
0
 private void LoadDrug(string operId)
 {
     DbMaintainment operDb = new DbMaintainment();
     DataTable drugTable = new DataTable();
     operDb.QueryAutoPackageDrugInfo(ref drugTable, operId);
     dgvDrug.DataSource = drugTable;
     if (null != dgvDrug.Columns[DBConstDef.OPDD_ID])
         dgvDrug.Columns[DBConstDef.OPDD_ID].Visible = false;
 }
Example #47
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;
            if (!CheckInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row,db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int id = 0;
                int type = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbType.SelectedItem, null));
                int dept = (int)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
                int room = -1;
                if (null != cmbRoom.SelectedItem)
                    room = (int)(cmbRoom.SelectedItem.GetType().GetProperty("Key").GetValue(cmbRoom.SelectedItem, null));
                operDb.InsertSterileAreaInfo(ref id, tbName.Text, type, dept, cmbDept.Text, room, cmbRoom.Text);

                DataRow newRow = ((DataTable) dgv.DataSource).NewRow();
                newRow[DBConstDef.SI_ID] = id;
                newRow[ConstDef.TEXT_STERILE_AREA_TYPE] = cmbType.Text;
                newRow[ConstDef.TEXT_STERILE_AREA_NAME] = tbName.Text;
                newRow[ConstDef.TEXT_DEPT_NAME] = cmbDept.Text;
                newRow[ConstDef.TEXT_ROOM_NAME] = cmbRoom.Text;
                ((DataTable) dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #48
0
 private void UpdateInsInfo()
 {
     int insId = Convert.ToInt32(Judgement.JudgeDBNullValue(dgv.SelectedRows[0].Cells[DBConstDef.INS_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (insId > 0)
     {
         //apply to datagridview, its datasource and db
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_CONST_IND_KIND].Value = cmbINSType.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_NAME].Value = tbProductName.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_PRODUCT_NAME].Value = tbCommonName.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_CODE].Value = tbCode.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_SPECIFICATION].Value = tbSpec.Text;
         dgv.SelectedRows[0].Cells[DBConstDef.TEXT_INS_UNIT].Value = txtINSUnit.Text;
         dgv.SelectedRows[0].Cells[ConstDef.TEXT_INS_INPUTCODE].Value = tbInputcode.Text;
         ((DataTable)dgv.DataSource).AcceptChanges();
         DbMaintainment operDb = new DbMaintainment();
         operDb.UpdateInsInfo(insId, (int)(EnumDef.INS_KINDS)(cmbINSType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbINSType.SelectedItem, null)), tbProductName.Text, tbCommonName.Text, tbCode.Text, tbSpec.Text, txtINSUnit.Text, tbInputcode.Text);
     }
 }
Example #49
0
 private void cmbDept_SelectedIndexChanged(object sender, EventArgs e)
 {
     cmbRoom.Items.Clear();
     int id = (int)(EnumDef.STERILE_ROOM_TYPE)(cmbDept.SelectedItem.GetType().GetProperty("Key").GetValue(cmbDept.SelectedItem, null));
     DbMaintainment operDb = new DbMaintainment();
     DataTable queryTable = new DataTable();
     if (operDb.QueryRoomInfoByDeptId(ref queryTable,id) == EnumDef.DBMEDITS_RESULT.SUCCESS)
     {
         foreach (DataRow row in queryTable.Rows)
         {
             int roomId = Convert.ToInt32(Judgement.JudgeDBNullValue(row[DBConstDef.ROOM_ID], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
             string name = Judgement.JudgeDBNullValue(row[ConstDef.TEXT_ROOM_NAME], EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
             cmbRoom.Items.Add(new { Key = roomId, Value = name });
         }
         cmbRoom.ValueMember = "Key";
         cmbRoom.DisplayMember = "Value";
     }
 }
Example #50
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string errMsg = string.Empty;
            if (!CheckInsInfoValid(ref errMsg, true))
            {
                BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
            }
            else
            {
                //insert a new row, db and datatable
                DbMaintainment operDb = new DbMaintainment();
                int insId = 0;
                operDb.InsertInsInfo(ref insId, (int)(EnumDef.INS_KINDS)(cmbINSType.SelectedItem.GetType().GetProperty("Key").GetValue(cmbINSType.SelectedItem, null)), tbProductName.Text, tbCommonName.Text, tbCode.Text, tbSpec.Text, txtINSUnit.Text, tbInputcode.Text);

                DataRow newRow = ((DataTable) dgv.DataSource).NewRow();
                newRow[DBConstDef.INS_ID] = insId;
                newRow[ConstDef.TEXT_CONST_IND_KIND] = cmbINSType.Text;
                newRow[ConstDef.TEXT_INS_NAME] = tbProductName.Text;
                newRow[ConstDef.TEXT_INS_PRODUCT_NAME] = tbCommonName.Text;
                newRow[DBConstDef.TEXT_INS_CODE] = tbCode.Text;
                newRow[DBConstDef.TEXT_INS_SPECIFICATION] = tbSpec.Text;
                newRow[DBConstDef.TEXT_INS_UNIT] = txtINSUnit.Text;
                newRow[ConstDef.TEXT_INS_INPUTCODE] = tbInputcode.Text;
                ((DataTable) dgv.DataSource).Rows.Add(newRow);
            }
        }
Example #51
0
 private void UpdateInsInfo()
 {
     int id = Convert.ToInt32(Judgement.JudgeDBNullValue(dgvIns.SelectedRows[0].Cells[DBConstDef.OPID_ID].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_INTEGER));
     if (id > 0)
     {
         //apply to datagridview, its datasource and db
         dgvIns.SelectedRows[0].Cells[ConstDef.TEXT_INS_NAME].Value = ddlInsName.Text;
         dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_CODE].Value = tbInsCode.Text;
         dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_SPECIFICATION].Value = tbInsSpec.Text;
         dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_UNIT].Value = tbInsUnit.Text;
         dgvIns.SelectedRows[0].Cells[DBConstDef.TEXT_INS_AMOUNT].Value = tbInsQuantity.Text;
         ((DataTable)dgvIns.DataSource).AcceptChanges();
         DbMaintainment operDb = new DbMaintainment();
         int insCount = 0;
         if (!string.IsNullOrEmpty(tbInsQuantity.Text))
             insCount = Convert.ToInt32(tbInsQuantity.Text);
         operDb.UpdateAutoPackageInsInfo(id, tbInsCode.Text, insCount);
     }
 }
Example #52
0
 private void btnInsAdd_Click(object sender, EventArgs e)
 {
     string errMsg = string.Empty;
     if (!CheckInsInfoValid(ref errMsg, true))
     {
         BaseMessageBox.ShowCustomerMessage(MessageBoxIcon.Error, "", errMsg);
     }
     else
     {
         //insert a new row, db and datatable
         DbMaintainment operDb = new DbMaintainment();
         int id = 0;
         string operId = Judgement.JudgeDBNullValue(dgvOperList.SelectedRows[0].Cells[DBConstDef.OPERATION_CODE].Value, EnumDef.ENUM_DATA_TYPE.DATA_TYPE_STRING).ToString();
         int insCount = 0;
         if (!string.IsNullOrEmpty(tbInsQuantity.Text))
             insCount = Convert.ToInt32(tbInsQuantity.Text);
         operDb.InsertAutoPackageInsInfo(ref id, operId, tbInsCode.Text, insCount);
         DataRow newRow = ((DataTable)dgvIns.DataSource).NewRow();
         newRow[DBConstDef.OPID_ID] = id;
         newRow[ConstDef.TEXT_INS_NAME] = ddlInsName.Text;
         newRow[DBConstDef.TEXT_INS_CODE] = tbInsCode.Text;
         newRow[DBConstDef.TEXT_INS_SPECIFICATION] = tbInsSpec.Text;
         newRow[DBConstDef.TEXT_INS_UNIT] = tbInsUnit.Text;
         newRow[DBConstDef.TEXT_INS_AMOUNT] = tbInsQuantity.Text;
         ((DataTable)dgvIns.DataSource).Rows.Add(newRow);
     }
 }