Пример #1
0
 protected override string[] GetContent()
 {
     return(new[]
     {
         ID.ToString(),
         CurrencyID.ToString(),
         UnitID.ToString(),
         OriginID.ToString(),
         IncotermID.ToString(),
         PlaceID.ToString()
     });
 }
        public string SetCache(OnOff state, bool quiet)
        {
            var parameter = quiet ? TW_CLI_ParameterType.UnitSetCacheQuiet : TW_CLI_ParameterType.UnitSetCache;

            return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, parameter, CtlID, UnitID.ToString(), state.ToString().ToLower()));
        }
 public string SetName(string name)
 {
     return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.UnitSetName, CtlID, UnitID.ToString(), name));
 }
 public string SetIgnoreECC(OnOff state)
 {
     return(ExecuteCommand(AMCC_3Ware_State.TW_CLI_path, TW_CLI_ParameterType.UnitSetIgnoreECC, CtlID, UnitID.ToString(), state.ToString().ToLower()));
 }
Пример #5
0
        public XmlNode exportXMLnode()
        {
            XmlDocument   xmlDoc        = new XmlDocument();
            StringWriter  stringWriter  = new StringWriter();
            XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter);
            XmlNode       rootNode      = null;

            if (isNodeComment)
            {
                rootNode = xmlDoc.CreateComment(comment);
                xmlDoc.AppendChild(rootNode);
                return(rootNode);
            }
            rootNode = xmlDoc.CreateElement(aimnType.ToString());
            xmlDoc.AppendChild(rootNode);

            #region IEC61850Server
            if (slaveType == SlaveTypes.IEC61850Server)
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
                XmlAttribute attr2 = xmlDoc.CreateAttribute("ReportingIndex");
                attr2.Value = iec61850reportingindex.ToString();
                rootNode.Attributes.Append(attr2);

                XmlAttribute attrDataType = xmlDoc.CreateAttribute("DataType");
                attrDataType.Value = DataType.ToString();
                rootNode.Attributes.Append(attrDataType);

                XmlAttribute attrCommandType = xmlDoc.CreateAttribute("CommandType");
                attrCommandType.Value = CommandType.ToString();
                rootNode.Attributes.Append(attrCommandType);

                XmlAttribute attrDeadband = xmlDoc.CreateAttribute("Deadband");
                attrDeadband.Value = Deadband.ToString();
                rootNode.Attributes.Append(attrDeadband);

                XmlAttribute attrMultiplier = xmlDoc.CreateAttribute("Multiplier");
                attrMultiplier.Value = Multiplier.ToString();
                rootNode.Attributes.Append(attrMultiplier);

                XmlAttribute attrConstant = xmlDoc.CreateAttribute("Constant");
                attrConstant.Value = Multiplier.ToString();
                rootNode.Attributes.Append(attrConstant);

                XmlAttribute attrDescription = xmlDoc.CreateAttribute("Description");
                attrDescription.Value = Description.ToString();
                rootNode.Attributes.Append(attrDescription);
            }
            #endregion IEC61850Server

            #region GDisplaySlave
            if (slaveType == SlaveTypes.GRAPHICALDISPLAYSLAVE)
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
                XmlAttribute attrCellNo = xmlDoc.CreateAttribute("CellNo");
                attrCellNo.Value = CellNo.ToString();
                rootNode.Attributes.Append(attrCellNo);

                XmlAttribute attrWidget = xmlDoc.CreateAttribute("Widget");
                attrWidget.Value = Widget.ToString();
                rootNode.Attributes.Append(attrWidget);

                XmlAttribute attrUnit = xmlDoc.CreateAttribute("Unit");
                attrUnit.Value = UnitID.ToString();
                rootNode.Attributes.Append(attrUnit);

                XmlAttribute attrDescription = xmlDoc.CreateAttribute("Description");
                attrDescription.Value = Description.ToString();
                rootNode.Attributes.Append(attrDescription);
            }
            #endregion GDisplaySlave

            #region OtherSlave
            if ((slaveType == SlaveTypes.DNP3SLAVE) || (slaveType == SlaveTypes.IEC101SLAVE) || (slaveType == SlaveTypes.IEC104) || (slaveType == SlaveTypes.MODBUSSLAVE) || (slaveType == SlaveTypes.UNKNOWN) || (slaveType == SlaveTypes.SPORTSLAVE) || (slaveType == SlaveTypes.MQTTSLAVE) || (slaveType == SlaveTypes.SMSSLAVE))
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
            }
            #endregion OtherSlave

            return(rootNode);
        }
Пример #6
0
        protected void lvMDUnit_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 UnitID;

            Int64.TryParse(e.CommandArgument.ToString(), out UnitID);

            if (UnitID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _UnitID = UnitID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDUnitEntity.FLD_NAME_UnitID, UnitID.ToString(), SQLMatchType.Equal);

                        MDUnitEntity mDUnitEntity = new MDUnitEntity();


                        result = FCCMDUnit.GetFacadeCreate().Delete(mDUnitEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _UnitID       = 0;
                            _MDUnitEntity = new MDUnitEntity();
                            PrepareInitialView();
                            BindMDUnitList();

                            MiscUtil.ShowMessage(lblMessage, "Unit has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Unit.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }