コード例 #1
0
 private void btnDeleteAll_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.gridView1.RowCount != 0)
         {
             for (int i = 0; i < this.gridView1.RowCount; i++)
             {
                 GridEditorItem row = this.gridView1.GetRow(i) as GridEditorItem;
                 if (!(row.Tag as Class6).IsNew)
                 {
                     this.ilist_0.Add((row.Tag as Class6).TopoClass);
                 }
             }
             if (this.OnValueChange != null)
             {
                 this.OnValueChange();
             }
             this.bool_1 = true;
             this.vertXtraGrid_0.Clear();
             TopologyEditHelper.m_pList.RemoveAll();
             TopologyEditHelper.OnDeleteAllTopolyClass();
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
 }
コード例 #2
0
        private void GroupSaleYesNo_YSE()
        {
            GridEditorItem editorItem = new GridEditorItem(this.repositoryItemTextEdit1, "打折幅度(注:最大填10,填10为不打折):", "");

            this.gridEditors.Insert(rowHandle_GroupSaleYesNo + 1, editorItem);
            this.gridView1.RefreshData();
        }
コード例 #3
0
        public void chengzhong_yes()
        {
            int            irow       = rowHandl("是否称重:");
            GridEditorItem editorItem = new GridEditorItem(this.repositoryItemToggleSwitch1, "是否为必选菜:", (v_Category_Items.ismust == 1) ? true : false);

            this.gridEditors.Insert(irow + 3, editorItem);
            this.gridView1.RefreshData();
        }
コード例 #4
0
        public void taocanan_yes()
        {
            int            irow        = rowHandl("是否是套餐:");
            GridEditorItem editorItem  = new GridEditorItem(this.repositoryItemToggleSwitch1, "是否打印套餐详情:", (v_Category_Items.isprintset == 1) ? true : false);
            GridEditorItem editorItem2 = new GridEditorItem(this.repositoryItemButtonEdit2, "套餐内菜品:", "");

            this.gridEditors.Insert(irow + 2, editorItem2);
            this.gridEditors.Insert(irow + 3, editorItem);
            this.gridView1.RefreshData();
        }
コード例 #5
0
 private void gridView1_CustomRowCellEdit(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e)
 {
     if (e.Column == this.gridEditorValue)
     {
         GridEditorItem item = gridView1.GetRow(e.RowHandle) as GridEditorItem;
         if (item != null)
         {
             e.RepositoryItem = item.RepositoryItem;
         }
     }
 }
コード例 #6
0
 private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     if (this.m_CanDo)
     {
         object         obj2;
         ISubtypes      featureClass = this.m_pFeatLayer.FeatureClass as ISubtypes;
         GridEditorItem row          = this.gridView1.GetRow(e.RowHandle) as GridEditorItem;
         int            index        = this.m_pFeatLayer.FeatureClass.Fields.FindFieldByAliasName(row.Name);
         IField         pField       = this.m_pFeatLayer.FeatureClass.Fields.get_Field(index);
         if ((featureClass != null) && featureClass.HasSubtype)
         {
             if (featureClass.SubtypeFieldName == pField.Name)
             {
                 IEnumSubtype subtypes = featureClass.Subtypes;
                 subtypes.Reset();
                 int subtypeCode = 0;
                 for (string str = subtypes.Next(out subtypeCode);
                      str != null;
                      str = subtypes.Next(out subtypeCode))
                 {
                     if (e.Value.ToString() == str)
                     {
                         this.UpdateFieldValue(pField, subtypeCode);
                         break;
                     }
                 }
             }
             else if (e.Value.ToString() == "<空>")
             {
                 obj2 = DBNull.Value;
                 this.UpdateFieldValue(pField, obj2);
             }
             else
             {
                 this.UpdateFieldValue(pField, e.Value);
             }
         }
         else if (e.Value.ToString() == "<空>")
         {
             obj2 = DBNull.Value;
             this.UpdateFieldValue(pField, obj2);
         }
         else
         {
             this.UpdateFieldValue(pField, e.Value);
         }
     }
 }
コード例 #7
0
        public void Apply()
        {
            Exception exception;

            try
            {
                int num;
                this.bool_1 = false;
                for (num = 0; num < this.ilist_0.Count; num++)
                {
                    this.itopology_0.RemoveClass(this.ilist_0[num] as IClass);
                }
                this.ilist_0.Clear();
                for (num = 0; num < this.gridView1.RowCount; num++)
                {
                    GridEditorItem row       = this.gridView1.GetRow(num) as GridEditorItem;
                    ITopologyClass topoClass = (row.Tag as Class6).TopoClass;
                    int            xYRank    = (int)row.Value;
                    try
                    {
                        if ((row.Tag as Class6).IsNew)
                        {
                            this.itopology_0.AddClass(topoClass as IClass, 1.0, xYRank, 1, false);
                            (row.Tag as Class6).IsNew = false;
                        }
                        else if (topoClass.XYRank != xYRank)
                        {
                            this.itopology_0.RemoveClass(topoClass as IClass);
                            int    zRank  = topoClass.ZRank;
                            double weight = topoClass.Weight;
                            bool   eventNotificationOnValidate = topoClass.EventNotificationOnValidate;
                            this.itopology_0.AddClass(topoClass as IClass, weight, xYRank, zRank,
                                                      eventNotificationOnValidate);
                        }
                    }
                    catch (Exception exception1)
                    {
                        exception = exception1;
                        Logger.Current.Error("", exception, "");
                    }
                }
            }
            catch (Exception exception2)
            {
                exception = exception2;
                Logger.Current.Error("", exception, "");
            }
        }
コード例 #8
0
        private void repositoryItemToggleSwitch4_EditValueChanged(object sender, EventArgs e)
        {
            int          irow         = this.gridView1.FocusedRowHandle;
            ToggleSwitch toggleSwitch = (ToggleSwitch)sender;

            if (toggleSwitch.IsOn)
            {
                GridEditorItem editorItem = new GridEditorItem(this.repositoryItemToggleSwitch1, "是否为必选菜:", (v_Category_Items.ismust == 1) ? true : false);
                this.gridEditors.Insert(irow + 3, editorItem);
            }
            else
            {
                this.gridEditors.RemoveAt(irow + 3);
            }
            this.gridView1.RefreshData();
        }
コード例 #9
0
        private void repositoryItemToggleSwitch2_EditValueChanged(object sender, EventArgs e)
        {
            int          irow         = this.gridView1.FocusedRowHandle;
            ToggleSwitch toggleSwitch = (ToggleSwitch)sender;

            if (toggleSwitch.IsOn)
            {
                GridEditorItem editorItem = new GridEditorItem(this.repositoryItemTextEdit1, "打折幅度(注:最大填10,填10为不打折):", "");
                this.gridEditors.Insert(irow + 1, editorItem);
            }
            else
            {
                this.gridEditors.RemoveAt(irow + 1);
            }
            this.gridView1.RefreshData();
        }
コード例 #10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.gridView1.SelectedRowsCount != 0)
                {
                    int[] selectedRows = this.gridView1.GetSelectedRows();
                    for (int i = 0; i < selectedRows.Length; i++)
                    {
                        GridEditorItem row = this.gridView1.GetRow(selectedRows[i]) as GridEditorItem;
                        if (!(row.Tag as Class6).IsNew)
                        {
                            this.ilist_0.Add((row.Tag as Class6).TopoClass);
                        }
                        int index = 0;
                        while (index < TopologyEditHelper.m_pList.Count)
                        {
                            if (TopologyEditHelper.m_pList.get_Element(index) == (row.Tag as Class6).TopoClass)
                            {
                                goto Label_00A9;
                            }
                            index++;
                        }
                        goto Label_00D3;
Label_00A9:
                        TopologyEditHelper.m_pList.Remove(index);
                        TopologyEditHelper.OnDeleteTopolyClass(
                            ((row.Tag as Class6).TopoClass as IObjectClass).ObjectClassID);
Label_00D3:
                        this.vertXtraGrid_0.DeleteRow(row);
                    }
                    this.bool_1 = true;
                    if (this.OnValueChange != null)
                    {
                        this.OnValueChange();
                    }
                }
            }
            catch (Exception exception)
            {
                Logger.Current.Error("", exception, "");
            }
        }
コード例 #11
0
        private void repositoryItemToggleSwitch3_EditValueChanged(object sender, EventArgs e)
        {
            int          irow         = this.gridView1.FocusedRowHandle;
            ToggleSwitch toggleSwitch = (ToggleSwitch)sender;

            if (toggleSwitch.IsOn)
            {
                // GridEditorCollection grid = new GridEditorCollection();
                GridEditorItem editorItem  = new GridEditorItem(this.repositoryItemToggleSwitch1, "是否打印套餐详情:", (v_Category_Items.isprintset == 1) ? true : false);
                GridEditorItem editorItem2 = new GridEditorItem(this.repositoryItemButtonEdit2, "套餐内菜品:", "");
                this.gridEditors.Insert(irow + 2, editorItem2);
                this.gridEditors.Insert(irow + 3, editorItem);
            }
            else
            {
                this.gridEditors.RemoveAt(irow + 2);
                this.gridEditors.RemoveAt(irow + 2);
            }
            this.gridView1.RefreshData();
        }
コード例 #12
0
 private void gridView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     int[] selectedRows = this.gridView1.GetSelectedRows();
     if (selectedRows.Length != 0)
     {
         FieldInfo      info;
         GridEditorItem row  = this.gridView1.GetRow(selectedRows[0]) as GridEditorItem;
         string         name = row.Name;
         if (this.m_IsUseAlias)
         {
             info = this.m_sortAliaslistInfo[name];
         }
         else
         {
             info = this.m_sortnamelistInfo[name];
         }
         this.textBox1.Text = string.Format("{0}\r\n{1}\r\n{2}", info.FieldName, info.TypeDescription,
                                            info.IsNull ? "允许为空" : "不允许为空");
     }
 }
コード例 #13
0
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            GridEditorItem row = this.gridView1.GetRow(e.RowHandle) as GridEditorItem;
            string         key = "";

            if (this.m_IsUseAlias)
            {
                FieldInfo info = this.m_sortAliaslistInfo[row.Name];
                key = info.FieldName;
            }
            else
            {
                key = row.Name;
            }
            if (this.m_changes.ContainsKey(key))
            {
                this.m_changes[key] = row.Value.ToString();
            }
            else
            {
                this.m_changes.Add(key, row.Value.ToString());
            }
        }
コード例 #14
0
 private void txtValue_EditValueChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         int   num2;
         int   num  = (int)this.txtValue.Value;
         IList list = new ArrayList();
         for (num2 = 1; num2 <= num; num2++)
         {
             list.Add(num2);
         }
         for (num2 = 0; num2 < this.gridView1.RowCount; num2++)
         {
             this.vertXtraGrid_0.ChangeItem(num2, ColumnAttribute.CA_COMBOBOX, list, 0.0, 0.0);
             GridEditorItem row  = this.gridView1.GetRow(num2) as GridEditorItem;
             int            num3 = (int)row.Value;
             if (num3 > num)
             {
                 row.Value = num;
             }
         }
     }
 }
コード例 #15
0
 private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     if (this.m_CanDo && (this.m_pObject != null))
     {
         object            obj2;
         IDomain           domain;
         ICodedValueDomain domain2;
         int            num3;
         ISubtypes      subtypes = this.m_pObject.Class as ISubtypes;
         GridEditorItem row      = this.gridView1.GetRow(e.RowHandle) as GridEditorItem;
         int            index    = this.m_pObject.Fields.FindFieldByAliasName(row.Name);
         IField         pField   = this.m_pObject.Fields.get_Field(index);
         this.m_EditFeildName = pField.AliasName;
         if ((subtypes != null) && subtypes.HasSubtype)
         {
             if (subtypes.SubtypeFieldName == pField.Name)
             {
                 IEnumSubtype subtype = subtypes.Subtypes;
                 subtype.Reset();
                 int subtypeCode = 0;
                 for (string str = subtype.Next(out subtypeCode);
                      str != null;
                      str = subtype.Next(out subtypeCode))
                 {
                     if (e.Value.ToString() == str)
                     {
                         this.UpdateFieldValue(pField, subtypeCode);
                         break;
                     }
                 }
             }
             else if (e.Value.ToString() == "<空>")
             {
                 obj2 = DBNull.Value;
                 this.UpdateFieldValue(pField, obj2);
             }
             else
             {
                 domain = subtypes.get_Domain((this.m_pObject as IRowSubtypes).SubtypeCode, pField.Name);
                 if (domain is ICodedValueDomain)
                 {
                     domain2 = domain as ICodedValueDomain;
                     for (num3 = 0; num3 < domain2.CodeCount; num3++)
                     {
                         if (domain2.get_Name(num3) == e.Value.ToString())
                         {
                             this.UpdateFieldValue(pField, domain2.get_Value(num3));
                             break;
                         }
                     }
                 }
                 else
                 {
                     this.UpdateFieldValue(pField, e.Value);
                 }
             }
         }
         else if (e.Value.ToString() == "<空>")
         {
             obj2 = DBNull.Value;
             this.UpdateFieldValue(pField, obj2);
         }
         else
         {
             string       name         = (this.m_pObject.Class as IDataset).Name;
             CodeDomainEx codeDomainEx = CodeDomainManage.GetCodeDomainEx(pField.Name, name);
             if (codeDomainEx != null)
             {
                 if ((codeDomainEx.ParentIDFieldName == null) || (codeDomainEx.ParentIDFieldName.Length == 0))
                 {
                     NameValueCollection codeDomain = codeDomainEx.GetCodeDomain();
                     for (num3 = 0; num3 < codeDomain.Count; num3++)
                     {
                         string str3 = codeDomain.Keys[num3];
                         if (str3 == e.Value.ToString())
                         {
                             this.UpdateFieldValue(pField, codeDomain[str3]);
                             break;
                         }
                     }
                 }
                 else
                 {
                     this.UpdateFieldValue(pField, codeDomainEx.GetCodeByName(e.Value.ToString()));
                 }
             }
             else
             {
                 domain = pField.Domain;
                 if (domain is ICodedValueDomain)
                 {
                     domain2 = domain as ICodedValueDomain;
                     for (num3 = 0; num3 < domain2.CodeCount; num3++)
                     {
                         if (domain2.get_Name(num3) == e.Value.ToString())
                         {
                             this.UpdateFieldValue(pField, domain2.get_Value(num3));
                             break;
                         }
                     }
                 }
                 else if (this.UpdateFieldValue(pField, e.Value))
                 {
                     this.m_CanDo = false;
                     row.Value    = this.m_pObject.get_Value(index);
                     this.m_CanDo = true;
                 }
             }
         }
     }
 }
コード例 #16
0
 private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
 {
     if (this.m_CanDo)
     {
         if (this.m_pFeatLayer == null)
         {
             LayerObject   selectedItem = this.cboLayer.SelectedItem as LayerObject;
             IFeatureLayer layer        = selectedItem.Layer as IFeatureLayer;
             this.m_pFeatLayer = layer;
         }
         if (this.m_pFeatLayer != null)
         {
             object         obj3;
             ISubtypes      featureClass = this.m_pFeatLayer.FeatureClass as ISubtypes;
             GridEditorItem row          = this.gridView1.GetRow(e.RowHandle) as GridEditorItem;
             int            index        = this.m_pFeatLayer.FeatureClass.Fields.FindFieldByAliasName(row.Name);
             IField         pField       = this.m_pFeatLayer.FeatureClass.Fields.get_Field(index);
             if ((featureClass != null) && featureClass.HasSubtype)
             {
                 if (featureClass.SubtypeFieldName == pField.Name)
                 {
                     IEnumSubtype subtypes = featureClass.Subtypes;
                     subtypes.Reset();
                     int subtypeCode = 0;
                     for (string str = subtypes.Next(out subtypeCode);
                          str != null;
                          str = subtypes.Next(out subtypeCode))
                     {
                         if (e.Value.ToString() == str)
                         {
                             this.UpdateFieldValue(pField, subtypeCode);
                             break;
                         }
                     }
                 }
                 else if (e.Value.ToString() == "<空>")
                 {
                     obj3 = DBNull.Value;
                     this.UpdateFieldValue(pField, obj3);
                 }
                 else
                 {
                     this.UpdateFieldValue(pField, e.Value);
                 }
             }
             else if (e.Value.ToString() == "<空>")
             {
                 obj3 = DBNull.Value;
                 this.UpdateFieldValue(pField, obj3);
             }
             else
             {
                 int    num3;
                 string name = (this.m_pFeatLayer.FeatureClass as IDataset).Name;
                 NameValueCollection codeDomain = CodeDomainManage.GetCodeDomain(pField.Name, name);
                 if (codeDomain.Count > 0)
                 {
                     for (num3 = 0; num3 < codeDomain.Count; num3++)
                     {
                         string str3 = codeDomain.Keys[num3];
                         if (str3 == e.Value.ToString())
                         {
                             this.UpdateFieldValue(pField, codeDomain[str3]);
                             break;
                         }
                     }
                 }
                 else
                 {
                     IDomain domain = pField.Domain;
                     if (domain is ICodedValueDomain)
                     {
                         ICodedValueDomain domain2 = domain as ICodedValueDomain;
                         for (num3 = 0; num3 < domain2.CodeCount; num3++)
                         {
                             if (domain2.get_Name(num3) == e.Value.ToString())
                             {
                                 this.UpdateFieldValue(pField, domain2.get_Value(num3));
                                 break;
                             }
                         }
                     }
                     else if (this.UpdateFieldValue(pField, e.Value))
                     {
                         this.m_CanDo = false;
                         this.m_CanDo = true;
                     }
                 }
             }
         }
     }
 }