public void EditItem() { int x; if (this.lvRxFVSCmd.SelectedItems.Count == 0) { return; } string strFvsCmd = ""; FIA_Biosum_Manager.frmRxItemFvsCmdItem frmFvsCmdItem1 = new frmRxItemFvsCmdItem(); FIA_Biosum_Manager.RxItemFvsCommandItem oRxItemFvsCmdItem = null; FIA_Biosum_Manager.RxPackageItemFvsCommandItem oRxPackageItemFvsCmdItem = null; frmFvsCmdItem1.MaximizeBox = true; frmFvsCmdItem1.BackColor = System.Drawing.SystemColors.Control; frmFvsCmdItem1.Text = "FVS: FVS Command Item (Edit)"; //frmFvsCmdItem1.Initialize_Rx_User_Control(); //frmFvsCmdItem1.uc_rx_edit1.m_oResizeForm.ScrollBarParentControl=frmFvsCmdItem1.uc_rx_edit1.ParentForm; //frmFvsCmdItem1.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; frmFvsCmdItem1.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; //find the current rxid //for (x=0;x<=this.m_oRxItem_Collection.Count-1;x++) //{ // if (this.m_oRxItem_Collection.Item(x).RxId.Trim() == // this.lstRx.SelectedItems[0].SubItems[COLUMN_RX].Text.Trim()) // { // frmFvsCmdItem1.ReferenceRxItem = this.m_oRxItem_Collection.Item(x); // break; // } //} frmFvsCmdItem1.ReferenceUserControlFvsCmdList = this; frmFvsCmdItem1.m_strAction = "edit"; oRxItemFvsCmdItem = this.ReferenceFormRxItem.m_oRxItem.ReferenceFvsCommandsCollection.Item(lvRxFVSCmd.SelectedItems[0].Index); strFvsCmd = oRxItemFvsCmdItem.FVSCommand; System.Windows.Forms.DialogResult result = frmFvsCmdItem1.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { if (oRxItemFvsCmdItem.FVSCommand.Trim().ToUpper() != strFvsCmd.Trim().ToUpper()) { RxTools oRxTools = new RxTools(); oRxItemFvsCmdItem.FVSCommandId = oRxTools.AssignFvsCommandId(this.ReferenceFormRxItem.m_oRxItem.ReferenceFvsCommandsCollection, oRxItemFvsCmdItem.FVSCommand); oRxTools = null; } oRxItemFvsCmdItem.CopyProperties(frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem, oRxItemFvsCmdItem); UpdateListViewRxItem(oRxItemFvsCmdItem); } }
public void AddItem() { int x; RxTools oRxTools = new RxTools(); FIA_Biosum_Manager.frmRxItemFvsCmdItem frmFvsCmdItem1 = new frmRxItemFvsCmdItem(); FIA_Biosum_Manager.RxItemFvsCommandItem oFvsCmdItem = null; frmFvsCmdItem1.MaximizeBox = true; frmFvsCmdItem1.BackColor = System.Drawing.SystemColors.Control; frmFvsCmdItem1.Text = "FVS: FVS Command Item (New)"; frmFvsCmdItem1.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; frmFvsCmdItem1.ReferenceUserControlFvsCmdList = this; frmFvsCmdItem1.m_strAction = "new"; frmFvsCmdItem1.loadvalues(oFvsCmdItem); System.Windows.Forms.DialogResult result = frmFvsCmdItem1.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { frmFvsCmdItem1.uc_rx_fvscmd_edit1.savevalues(); frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem.RxId = ReferenceFormRxItem.m_oRxItem.RxId; frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem.Index = this.lvRxFVSCmd.Items.Count; frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem.Add = true; if (ReferenceFormRxItem.m_oRxItem.ReferenceFvsCommandsCollection == null) { this.ReferenceFormRxItem.m_oRxItem.m_oFvsCommandItem_Collection1 = new RxItemFvsCommandItem_Collection(); this.ReferenceFormRxItem.m_oRxItem.ReferenceFvsCommandsCollection = this.ReferenceFormRxItem.m_oRxItem.m_oFvsCommandItem_Collection1; } frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem.FVSCommandId = oRxTools.AssignFvsCommandId(this.ReferenceFormRxItem.m_oRxItem.m_oFvsCommandItem_Collection1, frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem.FVSCommand); ReferenceFormRxItem.m_oRxItem.ReferenceFvsCommandsCollection.Add(frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem); AddItemToList(frmFvsCmdItem1.uc_rx_fvscmd_edit1.m_oRxItemFvsCmdItem); } oRxTools = null; }