Beispiel #1
0
        private void m_btnNewValue_Click(object sender, System.EventArgs e)
        {
            if (this.m_lsvProperty.SelectedItems.Count == 0)
            {
                return;
            }
            clsPropertyValue objValue = new clsPropertyValue();

            objValue.ValueVO = new clsUnitPropertyValue_VO();
            objValue.State   = enmRecordState.New;
            objValue.ValueVO.m_intINUSE_FLAG_NUM  = 1;
            objValue.ValueVO.m_strPROPERTY_ID_CHR = ((clsApplyUnitProperty)this.m_lsvProperty.SelectedItems[0].Tag).PropertyVO.m_strPROPERTY_ID_CHR;
            ((clsApplyUnitProperty)this.m_lsvProperty.SelectedItems[0].Tag).Values.Add(objValue);

            ListViewItem lvi = new ListViewItem();

            lvi.Text = null;
            lvi.Tag  = objValue;
            this.m_lsvValue.Items.Add(lvi);
            this.m_lsvValue.SelectedItems.Clear();
            lvi.Selected = true;

            this.m_mthResetValue();
            this.m_txtValue.Clear();
            this.m_txtValue.ReadOnly    = false;
            this.m_btnEditValue.Enabled = false;
            this.m_txtValue.Focus();

            this.m_btnDeleteValue.Text = "删除";
        }
Beispiel #2
0
        private void m_btnEditValue_Click(object sender, System.EventArgs e)
        {
            if (this.m_lsvValue.SelectedItems.Count == 0)
            {
                return;
            }
            clsPropertyValue objValue = (clsPropertyValue)this.m_lsvValue.SelectedItems[0].Tag;

            if (objValue.State == enmRecordState.Original)
            {
                objValue.State = enmRecordState.Modify;
            }
            this.m_txtValue.ReadOnly    = false;
            this.m_btnEditValue.Enabled = false;
            this.m_txtValue.Focus();
        }
        public long m_lngConstructDoc(out clsApplyUnitPropertyDoc p_objDoc)
        {
            p_objDoc = null;
            clsUnitProperty_VO[]      objPropertyArr;
            clsUnitPropertyValue_VO[] objValueArr;

            long lngRes = m_lngGetAllUnitPropertyData(out objPropertyArr, out objValueArr);

            if (lngRes <= 0)
            {
                return(lngRes);
            }

            p_objDoc = new clsApplyUnitPropertyDoc();

            Hashtable hasPorperty = new Hashtable();

            if (objPropertyArr != null)
            {
                foreach (clsUnitProperty_VO objPropertyVO in objPropertyArr)
                {
                    clsApplyUnitProperty objProperty = new clsApplyUnitProperty();
                    objProperty.PropertyVO = objPropertyVO;
                    objProperty.State      = enmRecordState.Original;
                    p_objDoc.Properties.Add(objProperty);
                    if (!hasPorperty.ContainsKey(objPropertyVO.m_strPROPERTY_ID_CHR))
                    {
                        hasPorperty.Add(objPropertyVO.m_strPROPERTY_ID_CHR, objProperty);
                    }
                }
            }
            if (objValueArr != null)
            {
                foreach (clsUnitPropertyValue_VO objValueVO in objValueArr)
                {
                    clsPropertyValue objValue = new clsPropertyValue();
                    objValue.ValueVO = objValueVO;
                    objValue.State   = enmRecordState.Original;
                    if (hasPorperty.ContainsKey(objValueVO.m_strPROPERTY_ID_CHR))
                    {
                        ((clsApplyUnitProperty)hasPorperty[objValueVO.m_strPROPERTY_ID_CHR]).Values.Add(objValue);
                    }
                }
            }
            return(lngRes);
        }
Beispiel #4
0
        private void m_lsvValue_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (this.m_lsvValue.SelectedItems.Count == 0)
            {
                return;
            }
            clsPropertyValue objValue = (clsPropertyValue)this.m_lsvValue.SelectedItems[0].Tag;

            this.m_txtValue.Text = objValue.ValueVO.m_strVLAUE_VCHR;
            if (objValue.ValueVO.m_intINUSE_FLAG_NUM == 0)
            {
                this.m_btnDeleteValue.Text = "起用";
            }
            else
            {
                this.m_btnDeleteValue.Text = "删除";
            }
            m_mthResetValue();
        }
Beispiel #5
0
        private void m_btnDeleteValue_Click(object sender, System.EventArgs e)
        {
            if (this.m_lsvValue.SelectedItems.Count == 0 ||
                this.m_lsvProperty.SelectedItems.Count == 0)
            {
                return;
            }
            clsPropertyValue     objValue    = (clsPropertyValue)this.m_lsvValue.SelectedItems[0].Tag;
            clsApplyUnitProperty objProperty = (clsApplyUnitProperty)this.m_lsvProperty.SelectedItems[0].Tag;

            if (this.m_btnDeleteValue.Text == "删除")
            {
                if (objValue.State == enmRecordState.New)
                {
                    objProperty.Values.Remove(objProperty);
                    this.m_lsvValue.SelectedItems[0].Remove();
                    this.m_mthResetValue();
                }
                else
                {
                    objValue.ValueVO.m_intINUSE_FLAG_NUM = 0;
                    objValue.State = enmRecordState.Modify;
                    if (this.m_chkShowDeleteValue.Checked)
                    {
                        this.m_lsvValue.SelectedItems[0].ForeColor = Color.Red;
                        this.m_btnDeleteValue.Text = "起用";
                    }
                    else
                    {
                        this.m_lsvValue.SelectedItems[0].Remove();
                        this.m_mthResetValue();
                    }
                }
            }
            else
            {
                objValue.ValueVO.m_intINUSE_FLAG_NUM = 1;
                objValue.State             = enmRecordState.Modify;
                this.m_btnDeleteValue.Text = "删除";
                this.m_lsvValue.SelectedItems[0].ForeColor = SystemColors.ControlText;
            }
        }