Beispiel #1
0
 public void OnEventButtonClick(string id, DynamicParameterType type, int index, object value, ulong attachid, byte[] attachdata, ref object newvalue, ref byte[] newattachdata)
 {
     if (EventButtonClick != null)
     {
         EventButtonClick(id, type, index, value, attachid, attachdata, ref newvalue, ref newattachdata);
     }
 }
Beispiel #2
0
        public void FieldFindAdd(string id, string caption, Type type, object defaultvalue)
        {
            #region Converting type to dynamic parameter type
            DynamicParameterType dtype = DynamicParameterType.Text;
            switch (type.Name)
            {
            case "String":
                dtype = DynamicParameterType.Text;
                break;

            case "DateTime":
                dtype = DynamicParameterType.Date;
                break;

            case "List":
            case "ArrayList":
                dtype = DynamicParameterType.List;
                break;

            default:
                dtype = DynamicParameterType.Decimal;
                break;
            }
            #endregion

            ucParameterPanel1.ItemAdd(id, caption, "", dtype, false);
        }
Beispiel #3
0
        public static string ToFriendlyName(this DynamicParameterType dynamicParameterType)
        {
            switch (dynamicParameterType)
            {
            case DynamicParameterType.ArtistsCount:
                return("add_artist");

            case DynamicParameterType.BuildingIncome:
                return("increase_income");

            case DynamicParameterType.DrawingSpeed:
                return("drawing_speed");

            case DynamicParameterType.ProductionSpeed:
                return("speed_up_income");

            case DynamicParameterType.RunningSpeed:
                return("running_speed");

            case DynamicParameterType.SprayBottleCapacity:
                return("capacity_of_cans");

            case DynamicParameterType.RespectIncomePerBlock:
                return("more_per_block");

            default:
                return("none");
            }
        }
Beispiel #4
0
        private DynamicParameter CreateParameter(DynamicParameterType dynamicParameterType, int level, DynamicParameterData data)
        {
            switch (dynamicParameterType)
            {
            case DynamicParameterType.ArtistsCount:
                return(new ArtistsCount(level, data));

            case DynamicParameterType.DrawingSpeed:
                return(new DrawingSpeed(level, data));

            case DynamicParameterType.RunningSpeed:
                return(new RunSpeed(level, data));

            case DynamicParameterType.SprayBottleCapacity:
                return(new SprayCanCapacity(level, data));

            case DynamicParameterType.RespectIncomePerBlock:
                return(new RespectIncomePerBlock(level, data));

            case DynamicParameterType.BuildingIncome:
                return(new BuildingIncome(level, data));

            case DynamicParameterType.ProductionSpeed:
                return(new ProductionSpeed(level, data));

            default:
                return(null);
            }
        }
Beispiel #5
0
        public DynamicParameter Get(DynamicParameterType parameterType, DynamicParameterData data, int level)
        {
            DynamicParameter parameter = CreateParameter(parameterType, level, data);

            parameter.SetCalculators(GetProgressionCalculator(data.Parameter.progressionType), GetProgressionCalculator(data.Price.progressionType));

            return(parameter);
        }
Beispiel #6
0
 private void ucParameterPanel1_EventButtonClick(string id, DynamicParameterType type, int index, object value, ulong attachid, byte[] attachdata, ref object newvalue, ref byte[] newattachdata)
 {
     switch (type)
     {
     case DynamicParameterType.Picture:
     case DynamicParameterType.File:
         Result res = ReadBlob(ref newattachdata);
         break;
     }
 }
Beispiel #7
0
        public DynamicParameter Get(DynamicParameterType parameterType)
        {
            int level = m_dynamicParametersLevels[(int)parameterType];
            DynamicParameterData data = m_cityData.GetDynamicParameterData(parameterType);

            DynamicParameter parameter = CreateParameter(parameterType, level, data);

            parameter.SetCalculators(GetProgressionCalculator(data.Parameter.progressionType), GetProgressionCalculator(data.Price.progressionType));

            return(parameter);
        }
        public void DynamicParameterUpdated(DynamicParameterType type, int level)
        {
            AnalyticEvent analyticEvent = new AnalyticEvent(StringConstants.AnalyticsEvents.UpgradeDynamicParameter);

            analyticEvent.AddParameter(StringConstants.AnalyticsEventsParameters.ParameterType, type.ToFriendlyName());
            AnalyticsManager.Instance.SendCustomEvent(analyticEvent);

            CityProgressData      cityProgressData        = ServiceLocator.Instance.Get <IUserProfileModel>().CurrentCityProgress;
            Dictionary <int, int> dynamicParametersLevels = cityProgressData.dynamicParametersLevels;

            dynamicParametersLevels[(int)type] = level;
        }
        public DynamicParameter Get(DynamicParameterType type)
        {
            DynamicParameter parameter = default;

            for (int i = 0; i < m_dynamicParameters.Count; i++)
            {
                if (m_dynamicParameters[i].ParameterType == type)
                {
                    return(m_dynamicParameters[i]);
                }
            }

            return(parameter);
        }
Beispiel #10
0
        public DynamicParameterData GetDynamicParameterData(DynamicParameterType parameterType)
        {
            DynamicParameterData dynamicParameterData = default;

            for (int i = 0; i < m_dynamicParameters.Count; i++)
            {
                if (m_dynamicParameters[i].type != parameterType)
                {
                    continue;
                }

                dynamicParameterData = m_dynamicParameters[i];
                break;
            }

            return(dynamicParameterData);
        }
Beispiel #11
0
 public DynamicParameterItem(string Id, string Name, string Name2, object Value, DynamicParameterType ValueType, int ValueLength, object ValueDefault
                             , bool Mandatory, string EditMask, string Description, string DictId, bool DictEditable, string DictValueField, string DictDescField, int Orderno)
 {
     #region Setting Values
     this.Id             = Id;
     this.Name           = Name;
     this.Name2          = Name2;
     this.Value          = Value;
     this.ValueType      = ValueType;
     this.ValueLength    = ValueLength;
     this.ValueDefault   = ValueDefault;
     this.Mandatory      = Mandatory;
     this.EditMask       = EditMask;
     this.Description    = Description;
     this.DictId         = DictId;
     this.DictEditable   = DictEditable;
     this.DictValueField = DictValueField;
     this.DictDescField  = DictDescField;
     this.Orderno        = Orderno;
     #endregion
 }
Beispiel #12
0
        private DynamicParameter GetDynamicParameter(DynamicParameterType type, DynamicParameterData data)
        {
            switch (type)
            {
            case DynamicParameterType.ArtistsCount:
                return(new ArtistsCount(1, data));

            case DynamicParameterType.DrawingSpeed:
                return(new DrawingSpeed(1, data));

            case DynamicParameterType.RunningSpeed:
                return(new RunSpeed(1, data));

            case DynamicParameterType.SprayBottleCapacity:
                return(new SprayCanCapacity(1, data));

            case DynamicParameterType.RespectIncomePerBlock:
                return(new RespectIncomePerBlock(1, data));

            default:
                return(null);
            }
        }
Beispiel #13
0
 public DynamicParameterItem FindItemAdd(string Id, string Name, string Value, DynamicParameterType ValueType, bool Mandatory)
 {
     return(ucParameterPanel1.ItemAdd(Id, Name, Value, ValueType, Mandatory));
 }
Beispiel #14
0
 public DynamicParameterItem FindItemAdd(string Id, string Name, string Value, DynamicParameterType ValueType, bool Mandatory, string EditMask, string Description)
 {
     return(ucParameterPanel1.ItemAdd(Id, Name, Value, ValueType, Mandatory, EditMask, Description));
 }
Beispiel #15
0
 public DynamicParameterItem ItemAdd(string Id, string Name, string Value, DynamicParameterType ValueType, int ValueLength, object ValueDefault, bool Mandatory, string EditMask, string Description)
 {
     return(ItemAdd(Id, Name, null, Value, ValueType, ValueLength, ValueDefault, Mandatory, EditMask, Description, null, true, null, null, 0));
 }
Beispiel #16
0
 public DynamicParameterItem(string Id, string Name, object Value, DynamicParameterType ValueType, int ValueLength, bool Mandatory)
     : this(Id, Name, null, Value, ValueType, ValueLength, null, Mandatory, null, null, null, true, null, null, 0)
 {
 }
Beispiel #17
0
 public DynamicParameterItem ItemAdd(string Id, string Name, string Value, DynamicParameterType ValueType, bool Mandatory)
 {
     return(ItemAdd(Id, Name, null, Value, ValueType, 4000, null, Mandatory, null, null, null, true, null, null, 0));
 }
Beispiel #18
0
 public DynamicParameterItem ItemAdd(string Id, string Name, string Value, DynamicParameterType ValueType, bool Mandatory, string EditMask, string Description)
 {
     return(ItemAdd(Id, Name, null, Value, ValueType, 4000, null, Mandatory, EditMask, Description, null, true, null, null, 0));
 }
Beispiel #19
0
 public DynamicParameterItem(string Id, string Name, object Value, DynamicParameterType ValueType, bool Mandatory, string EditMask, string Description)
     : this(Id, Name, null, Value, ValueType, 4000, null, Mandatory, EditMask, Description, null, true, null, null, 0)
 {
 }
Beispiel #20
0
        public DynamicParameterItem ItemAdd(string Id, string Name, string Name2, string Value, DynamicParameterType ValueType, int ValueLength, object ValueDefault, bool Mandatory, string EditMask, string Description, string DictId, bool DictEditable, string DictValueField, string DictDescField, int Orderno)
        {
            #region Creating new instance of DynamicParameterItem
            DynamicParameterItem pi = new DynamicParameterItem();
            pi.Id             = Id;
            pi.Name           = Name;
            pi.Name2          = Name2;
            pi.Value          = Value;
            pi.ValueType      = ValueType;
            pi.ValueLength    = (ValueLength <= 0 ? 12 : ValueLength);
            pi.ValueDefault   = ValueDefault;
            pi.Mandatory      = Mandatory;
            pi.EditMask       = EditMask;
            pi.Description    = Description;
            pi.DictId         = DictId;
            pi.DictEditable   = DictEditable;
            pi.DictValueField = DictValueField;
            pi.DictDescField  = DictDescField;
            pi.Orderno        = Orderno;
            #endregion

            #region Add item into list
            lock (_hitems.SyncRoot)
            {
                _hitems[Id] = pi;
                _aitems.Add(pi);
            }
            #endregion

            return(pi);
        }
Beispiel #21
0
        private void SetFormatPivot(DataTable objectitem)
        {
            int rowindex = 1;

            gridControl1.RepositoryItems.Clear();
            ParentHash.Clear();
            InverseParentHash.Clear();
            gridView1.Columns[0].Visible = false;

            #region Formatting Fixed Value Columns

            if (_showfixedvalues)
            {
                gridView1.Columns[1].ColumnEdit  = CreateRepositoryCalcEdit(1, "0");                   //status
                gridView1.Columns[2].ColumnEdit  = CreateRepositoryDateEdit();                         //startdate
                gridView1.Columns[3].ColumnEdit  = CreateRepositoryDateEdit();                         //enddate
                gridView1.Columns[4].ColumnEdit  = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //estimateamount
                gridView1.Columns[5].ColumnEdit  = CreateRepositoryLookUpEdit();                       //estimatecurcode
                gridView1.Columns[6].ColumnEdit  = CreateRepositoryLookUpEdit();                       //feetype
                gridView1.Columns[7].ColumnEdit  = CreateRepositoryCalcEdit(3, "###,###,###,##0.00");  //feerate
                gridView1.Columns[8].ColumnEdit  = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //feeamount
                gridView1.Columns[9].ColumnEdit  = CreateRepositoryLookUpEdit();                       //feecurcode
                gridView1.Columns[10].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //currate
                gridView1.Columns[11].ColumnEdit = CreateRepositoryCalcEdit(3, "###,###,###,##0.00");  //discountrate
                gridView1.Columns[12].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //discountamount
                gridView1.Columns[13].ColumnEdit = CreateRepositoryLookUpEdit();                       //discountcurcode
                gridView1.Columns[14].ColumnEdit = CreateRepositoryCalcEdit(10, null);                 //OptionID
                gridView1.Columns[15].ColumnEdit = CreateRepositoryCalcEdit(1, "0");                   //feestatus
                gridView1.Columns[16].ColumnEdit = CreateRepositoryCalcEdit(1, "0");                   //feediscounttype
                gridView1.Columns[17].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //feediscountamount
                gridView1.Columns[18].ColumnEdit = CreateRepositoryCalcEdit(3, "###,###,###,##0.00");  //feediscountrate
                gridView1.Columns[19].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //calcamount
                gridView1.Columns[20].ColumnEdit = CreateRepositoryCalcEdit(3, "###,###,###,##0.00");  //calcrate
                gridView1.Columns[21].ColumnEdit = CreateRepositoryCalcEdit(10, null);                 //UnOptionID
                gridView1.Columns[22].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //ClaimAmount
                gridView1.Columns[23].ColumnEdit = CreateRepositoryCalcEdit(12, "###,###,###,##0.00"); //MarketValue
                gridView1.Columns[24].ColumnEdit = CreateRepositoryCalcEdit(16, null);                 //MarketValue
                for (int i = 0; i < START_INDEX_DYNAMIC_COL; i++)
                {
                    gridControl1.RepositoryItems.Add(gridView1.Columns[i].ColumnEdit);
                }
                rowindex = START_INDEX_DYNAMIC_COL;
            }

            #endregion

            #region Formatting Dynamic Value Columns

            if (objectitem != null)
            {
                foreach (DataRow row in objectitem.Rows)
                {
                    #region Get row values
                    DynamicParameterType ValueType = (DynamicParameterType)Static.ToInt(row["valuetype"]);
                    int    ValueLength             = Static.ToInt(row["valuelength"]);
                    string EditMask    = Static.ToStr(row["editmask"]);
                    bool   IsMandatory = Static.ToInt(row["ismandatory"]) == 1;
                    bool   IsCalculate = Static.ToInt(row["calculate"]) == 1;
                    if (Static.ToInt(row["dictparentobject"]) != 0 && row["dictparentobject"] != null && Static.ToStr(row["dictfilterdesc"]) != "")
                    {
                        ParentHash.Add(gridView1.Columns[rowindex].AbsoluteIndex, Static.ToInt(row["dictparentobject"]));
                        InverseParentHash.Add(Static.ToInt(row["dictparentobject"]), gridView1.Columns[rowindex].AbsoluteIndex);
                        gridView1.Columns[rowindex].AppearanceCell.Name = Static.ToStr(row["dictfilterdesc"]);
                    }
                    #endregion
                    #region Setting property values and types
                    switch (ValueType)
                    {
                    case DynamicParameterType.Text:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryTextEdit(ValueLength, EditMask);
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToStr(row["valuedefault"]);
                        }
                        break;

                    case DynamicParameterType.Decimal:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryCalcEdit(ValueLength, EditMask);
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToDecimal(row["valuedefault"]);
                        }
                        break;

                    case DynamicParameterType.Date:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryDateEdit();
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToDate(row["valuedefault"]);
                        }
                        break;

                    case DynamicParameterType.DateTime:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryDateTimeEdit();
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToDateTime(row["valuedefault"]);
                        }
                        break;

                    case DynamicParameterType.File:
                        RepositoryItemButtonEdit riFileEdit = CreateRepositoryFileEdit();
                        riFileEdit.ButtonPressed += new ButtonPressedEventHandler(riFileEdit_ButtonClick);
                        gridView1.Columns[rowindex].ColumnEdit = riFileEdit;
                        break;

                    case DynamicParameterType.Folder:
                        RepositoryItemButtonEdit riFolderEdit = CreateRepositoryFolderEdit();
                        riFolderEdit.ButtonPressed            += new ButtonPressedEventHandler(riFolderEdit_ButtonClick);
                        gridView1.Columns[rowindex].ColumnEdit = riFolderEdit;
                        break;

                    case DynamicParameterType.Picture:
                        RepositoryItemImageEdit riImageEdit = CreateRepositoryImageEdit();
                        riImageEdit.ButtonPressed += new ButtonPressedEventHandler(riImageEdit_ButtonClick);
                        gridView1.Columns[rowindex].ColumnEdit = riImageEdit;
                        break;

                    case DynamicParameterType.Font:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryFontEdit();
                        break;

                    case DynamicParameterType.Color:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryColorEdit();
                        break;

                    case DynamicParameterType.List:
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryLookUpEdit();
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToStr(row["valuedefault"]);
                        }
                        //gridView1.Columns[rowindex].Tag = "List";
                        break;

                    case DynamicParameterType.Register:
                        RepositoryItemButtonEdit riRegisterEdit = CreateRepositoryRegisterEdit();
                        riRegisterEdit.ButtonPressed          += new ButtonPressedEventHandler(riRegisterEdit_ButtonPressed);
                        gridView1.Columns[rowindex].ColumnEdit = riRegisterEdit;
                        break;

                    default:     // 1 and others is string type
                        gridView1.Columns[rowindex].ColumnEdit = CreateRepositoryTextEdit(4000, "");
                        if (Static.ToStr(row["valuedefault"]) != "")
                        {
                            gridView1.Columns[rowindex].Tag = Static.ToDecimal(row["valuedefault"]);
                        }
                        break;
                    }
                    #endregion

                    gridControl1.RepositoryItems.Add(gridView1.Columns[rowindex].ColumnEdit);
                    if (IsMandatory)
                    {
                        gridView1.Columns[rowindex].AppearanceCell.BackColor = Color.FromKnownColor(KnownColor.Info);
                        gridView1.Columns[rowindex].ToolTip = "mandatory";
                    }
                    if (IsCalculate)
                    {
                        calccolumn.Add(gridView1.Columns[rowindex].ColumnHandle);
                    }
                    rowindex++;
                }
            }
            #endregion

            ISM.Template.FormUtility.SetFormatGrid(ref gridView1, true);
        }
Beispiel #22
0
 public DynamicParameterItem FindItemAdd(string Id, string Name, string Name2, string Value, DynamicParameterType ValueType, int ValueLength, object ValueDefault, bool Mandatory, string EditMask, string Description, string DictId, bool DictEditable, string DictValueField, string DictDescField, int Orderno)
 {
     return(ucParameterPanel1.ItemAdd(Id, Name, Name2, Value, ValueType, ValueLength, ValueDefault, Mandatory, EditMask, Description, DictId, DictEditable, DictValueField, DictDescField, Orderno));
 }