Ejemplo n.º 1
0
        private void UnlockAllYotogiClasses(object sender, EventArgs e)
        {
            MaidInfo maid = SelectedMaid;

            foreach (int yotogiClass in EnumHelper.EnabledYotogiClasses)
            {
                maid.SetYotogiClassValue(yotogiClass, TABLE_COLUMN_HAS, true);
            }
        }
        private void UpdateMaid_YotogiClassValue <T>(DataGridView table, int col, int row)
        {
            MaidInfo maid = SelectedMaid;

            if (maid == null)
            {
                return;
            }

            object val = table[col, row].Value;

            if (val is bool)
            {
                val = !((bool)val);
            }

            if (table == dataGridView_maid_classes)
            {
                if (!updateMaidClassField)
                {
                    if (val is T)
                    {
                        maid.SetMaidClassValue(row, col, val);
                    }
                    else
                    {
                        maid.UpdateField(MaidChangeType.MaidClassType, row);
                    }
                }
                updateMaidClassField = false;
            }
            else if (table == dataGridView_yotogi_classes)
            {
                if (!updateYotogiClassField)
                {
                    if (val is T)
                    {
                        maid.SetYotogiClassValue(EnumHelper.EnabledYotogiClasses[row], col, val);
                    }
                    else
                    {
                        maid.UpdateField(MaidChangeType.YotogiClassType, EnumHelper.EnabledYotogiClasses[row]);
                    }
                }
                updateYotogiClassField = false;
            }
        }