public void OtherInfoProofOfConceptTests(OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair> uPartySharedInformation, int otherInfoLength, string otherInfoPattern, BitString expectedBitString)
        {
            var vPartySharedInformation = new OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair>(
                null,
                new BitString(0),
                new FfcKeyPair(0),
                new FfcKeyPair(0),
                new BitString(0),
                new BitString(0),
                new BitString(0)
                );

            var uPartyOtherInfo = new PartyOtherInfo(uPartySharedInformation.PartyId, uPartySharedInformation.DkmNonce);
            var vPartyotherInfo = new PartyOtherInfo(vPartySharedInformation.PartyId, vPartySharedInformation.DkmNonce);

            _subject = new OtherInfo(
                new EntropyProvider(new Random800_90()),
                otherInfoPattern,
                otherInfoLength,
                KeyAgreementRole.InitiatorPartyU,
                uPartyOtherInfo,
                vPartyotherInfo
                );

            var result = _subject.GetOtherInfo();

            Assert.AreEqual(expectedBitString.ToHex(), result.ToHex());
        }
Exemple #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Aircraft.ToUpper().GetHashCode() * 3)
                + (CruisingSpeed.ToUpper().GetHashCode() * 3)
                + (DepartureAerodrome.GetHashCode() * 3)
                + (CruisingLevel.ToUpper().GetHashCode() * 3)
                + (DestinationAerodrome.GetHashCode() * 3)
                + (DepartureTime.GetHashCode() * 3)
                + (ActualDepartureTime.GetHashCode() * 3)
                + (EETHours.GetHashCode() * 3)
                + (EETMinutess.GetHashCode() * 3)
                + (EnduranceHours.GetHashCode() * 3)
                + (EnduranceMinutes.GetHashCode() * 3)
                + (AlternateAerodrome.GetHashCode() * 3)
                + (SecondAlternateAerodrome.GetHashCode() * 3)
                + (OtherInfo.ToUpper().GetHashCode() * 3)
                + (Route.ToUpper().GetHashCode() * 3)
                + (TypeOfFlight.GetHashCode() * 3)
                + (PersonsOnBoard.GetHashCode() * 3)
                + (Revision.GetHashCode() * 3)
                + (FlightRules.GetHashCode() * 3) * 17);
     }
 }
Exemple #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <OtherInfo> DataTableToList(DataTable dt)
        {
            List <OtherInfo> modelList = new List <OtherInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                OtherInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new OtherInfo();
                    if (dt.Rows[n]["OtherInfoID"].ToString() != "")
                    {
                        model.OtherInfoID = int.Parse(dt.Rows[n]["OtherInfoID"].ToString());
                    }
                    if (dt.Rows[n]["RecordCreateTime"].ToString() != "")
                    {
                        model.RecordCreateTime = DateTime.Parse(dt.Rows[n]["RecordCreateTime"].ToString());
                    }
                    model.ProvCityID = dt.Rows[n]["ProvCityID"].ToString();
                    if (dt.Rows[n]["CardPeriod"].ToString() != "")
                    {
                        model.CardPeriod = DateTime.Parse(dt.Rows[n]["CardPeriod"].ToString());
                    }
                    if (dt.Rows[n]["NotifyAnswerID"].ToString() != "")
                    {
                        model.NotifyAnswerID = int.Parse(dt.Rows[n]["NotifyAnswerID"].ToString());
                    }
                    model.PriceArgsID = dt.Rows[n]["PriceArgsID"].ToString();
                    if (dt.Rows[n]["CreatUserID"].ToString() != "")
                    {
                        model.CreatUserID = int.Parse(dt.Rows[n]["CreatUserID"].ToString());
                    }
                    if (dt.Rows[n]["RecordUpdateUserID"].ToString() != "")
                    {
                        model.RecordUpdateUserID = int.Parse(dt.Rows[n]["RecordUpdateUserID"].ToString());
                    }
                    if (dt.Rows[n]["RecordIsDelete"].ToString() != "")
                    {
                        if ((dt.Rows[n]["RecordIsDelete"].ToString() == "1") || (dt.Rows[n]["RecordIsDelete"].ToString().ToLower() == "true"))
                        {
                            model.RecordIsDelete = true;
                        }
                        else
                        {
                            model.RecordIsDelete = false;
                        }
                    }
                    if (dt.Rows[n]["RecordUpdateTime"].ToString() != "")
                    {
                        model.RecordUpdateTime = DateTime.Parse(dt.Rows[n]["RecordUpdateTime"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #4
0
        ///<summary>
        ///保存数据库面板设置,将所有数据保存
        ///</summary>
        public void SaveDevieceInfoToDB()
        {
            /// delete all old information and refresh the database
            string strsql = string.Format("delete from dbBasicBac where  DIndex={0}", DIndex);

            DataModule.ExecuteSQLDatabase(strsql);

            strsql = string.Format("delete from dbBackNet where  DIndex={0}", DIndex);
            DataModule.ExecuteSQLDatabase(strsql);

            ///save save basic setup of EIB
            #region
            strsql = string.Format("insert into dbBasicBac(DIndex,Remark,strIP,strRouterIP,strMAC,strMaskIP,bytPort,bytSwitch,bytDevID) values({0},'{1}','{2}','{3}','{4}','{5}',{6},{7},{8})",
                                   DIndex, DeviceName, "", "", "", ValidCount.ToString(), intPort, Convert.ToByte(blnSwitch), Address);
            DataModule.ExecuteSQLDatabase(strsql);
            #endregion

            //save bus to EIB command
            #region

            if (otherInfo == null)
            {
                return;
            }
            byte bytI = 0;
            for (int i = 0; i < otherInfo.Count; i++)
            {
                bytI++;
                OtherInfo temp = otherInfo[i];
                System.Diagnostics.Debug.WriteLine(otherInfo[1].Param4);
                string sql = "insert into dbBackNet(DIndex,CurNo,BackNetIDAry,Type,strDevName,Param1,Param2,Param3,Param4,Remark) values(@DIndex,@CurNo,@BackNetIDAry,@Type,@strDevName,@Param1,@Param2,@Param3,@Param4,@Remark)";
                //创建一个OleDbConnection对象
                OleDbConnection conn;
                conn = new OleDbConnection(DataModule.ConString + CsConst.mstrDefaultPath);
                conn.Open();
                OleDbCommand cmdTmp = new OleDbCommand(sql, conn);
                ((OleDbParameter)cmdTmp.Parameters.Add("@DIndex", OleDbType.Integer)).Value      = DIndex;
                ((OleDbParameter)cmdTmp.Parameters.Add("@CurNo", OleDbType.Char)).Value          = temp.ID;
                ((OleDbParameter)cmdTmp.Parameters.Add("@BackNetIDAry", OleDbType.Binary)).Value = temp.BackNetIDAry;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Type", OleDbType.Integer)).Value        = temp.Type;
                ((OleDbParameter)cmdTmp.Parameters.Add("@strDevName", OleDbType.VarChar)).Value  = temp.strDevName;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param1", OleDbType.Char)).Value         = temp.Param1;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param2", OleDbType.Char)).Value         = temp.Param2;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param3", OleDbType.Char)).Value         = temp.Param3;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param4", OleDbType.Char)).Value         = temp.Param4;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Remark", OleDbType.VarChar)).Value      = temp.Remark;
                try
                {
                    cmdTmp.ExecuteNonQuery();
                }
                catch (OleDbException exp)
                {
                    MessageBox.Show(exp.ToString());
                }
                conn.Close();
            }
            #endregion
        }
Exemple #5
0
        ///<summary>
        ///保存数据库面板设置,将所有数据保存
        ///</summary>
        public void SaveDevieceInfoToDB(int DIndex)
        {
            /// delete all old information and refresh the database
            string strsql = string.Format("delete from dbDeviceInfo where  DIndex={0}", DIndex);

            DataModule.ExecuteSQLDatabase(strsql);

            strsql = string.Format("delete from dbEIBDev where  DIndex={0}", DIndex);
            DataModule.ExecuteSQLDatabase(strsql);

            ///save save basic setup of EIB
            #region
            strsql = string.Format("insert into dbDeviceInfo(DIndex,Devname,Address) values({0},'{1}','{2}')", DIndex, Devname, Address);
            DataModule.ExecuteSQLDatabase(strsql);
            #endregion

            //save bus to EIB command
            #region

            if (otherInfo == null)
            {
                return;
            }
            byte bytI = 0;
            for (int i = 0; i < otherInfo.Count; i++)
            {
                bytI++;
                OtherInfo temp = otherInfo[i];
                System.Diagnostics.Debug.WriteLine(otherInfo[1].Param4);
                string sql = "insert into dbEIBDev(DIndex,CurNo,GroupAddress,ControlType,Type,Param1,Param2,Param3,Param4,DestDev) values(@DIndex,@CurNo,@GroupAddress,@ControlType,@Type,@Param1,@Param2,@Param3,@Param4,@DestDev)";
                //创建一个OleDbConnection对象
                OleDbConnection conn;
                conn = new OleDbConnection(DataModule.ConString + CsConst.mstrDefaultPath);
                conn.Open();
                OleDbCommand cmdTmp = new OleDbCommand(sql, conn);
                ((OleDbParameter)cmdTmp.Parameters.Add("@DIndex", OleDbType.Integer)).Value       = DIndex;
                ((OleDbParameter)cmdTmp.Parameters.Add("@CurNo", OleDbType.Char)).Value           = i;
                ((OleDbParameter)cmdTmp.Parameters.Add("@GroupAddress", OleDbType.VarChar)).Value = temp.GroupAddress;
                ((OleDbParameter)cmdTmp.Parameters.Add("@ControlType", OleDbType.Char)).Value     = temp.ControlType;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Type", OleDbType.Char)).Value            = temp.Type;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param1", OleDbType.Char)).Value          = temp.Param1;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param2", OleDbType.Char)).Value          = temp.Param2;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param3", OleDbType.Char)).Value          = temp.Param3;
                ((OleDbParameter)cmdTmp.Parameters.Add("@Param4", OleDbType.Char)).Value          = temp.Param4;
                ((OleDbParameter)cmdTmp.Parameters.Add("@DestDev", OleDbType.VarChar)).Value      = temp.strDevName;
                try
                {
                    cmdTmp.ExecuteNonQuery();
                }
                catch (OleDbException exp)
                {
                    MessageBox.Show(exp.ToString());
                }
                conn.Close();
            }
            #endregion
        }
Exemple #6
0
        public void OrderApply()
        {
            OrderApplyInputModel model = new OrderApplyInputModel();

            model.transNo = UtilityHelper.CommonHelper.OrderNoOne();
            //model.customkey = "bowangjishi";
            model.caseCode          = "0000052178002133";
            model.insurantDateLimit = "365";

            ApplicationData _applicationData = new ApplicationData();

            _applicationData.applicationDate = "2017-09-07 13:00:00";
            _applicationData.startDate       = "2017-09-08";
            _applicationData.endDate         = "2018-09-08";

            ApplicantInfo _applicantInfo = new ApplicantInfo();

            _applicantInfo.cName      = "倪成智";
            _applicantInfo.eName      = "nichengzhi";
            _applicantInfo.cardType   = 1;
            _applicantInfo.cardCode   = "210623199008092631";
            _applicantInfo.sex        = 1;
            _applicantInfo.birthday   = "1990-08-09";
            _applicantInfo.mobile     = "15841505041";
            _applicantInfo.email      = "*****@*****.**";
            _applicantInfo.cardPeriod = "2020-10-01";

            InsurantInfo _insurantInfo = new InsurantInfo();

            _insurantInfo.cName       = "倪成智";
            _insurantInfo.eName       = "nichengzhi";
            _insurantInfo.cardType    = 1;
            _insurantInfo.cardCode    = "210623199008092631";
            _insurantInfo.sex         = 1;
            _insurantInfo.birthday    = "1990-08-09";
            _insurantInfo.mobile      = "15841505041";
            _insurantInfo.relationId  = 1;
            _insurantInfo.count       = 1;
            _insurantInfo.singlePrice = 12;
            _insurantInfo.cardPeriod  = "2020-10-01";

            OtherInfo _otherInfo = new OtherInfo();

            _otherInfo.provCityId     = "510000-511800-511821";
            _otherInfo.cardPeriod     = "2020-10-01";
            _otherInfo.notifyAnswerId = "";
            _otherInfo.priceArgsId    = "";

            model.applicationdata = _applicationData;
            model.applicantinfo   = _applicantInfo;
            model.insurantInfo    = _insurantInfo;
            model.otherInfo       = _otherInfo;

            BaoxianDataBLL baoxianDataBLL = new BaoxianDataBLL();
            var            res            = baoxianDataBLL.OrderApply(model);
        }
Exemple #7
0
        private static List <Recipe> ParseRecipeJson(List <RecipeJson> json)
        {
            var recipes = new List <Recipe>();

            foreach (var item in json)
            {
                var recipe = new Recipe();

                recipe.Id   = item.Id.ObjectIdValue;
                recipe.Name = item.Name;

                foreach (var sessionItem in item.Session)
                {
                    if (sessionItem.Name.Trim() == "Ingredientes")
                    {
                        foreach (var contentItem in sessionItem.Content)
                        {
                            var ingredientItem = new Ingredient();

                            ingredientItem.RecipeId    = item.Id.ObjectIdValue;
                            ingredientItem.Description = contentItem.Trim();
                            recipe.Ingredient.Add(ingredientItem);
                        }
                    }

                    if (sessionItem.Name.Trim() == "Modo de Preparo")
                    {
                        foreach (var contentItem in sessionItem.Content)
                        {
                            var preparationModeItem = new PreparationMode();

                            preparationModeItem.RecipeId    = item.Id.ObjectIdValue;
                            preparationModeItem.Description = contentItem.Trim();
                            recipe.PreparationMode.Add(preparationModeItem);
                        }
                    }

                    if (sessionItem.Name.Trim() == "Outras informações")
                    {
                        foreach (var contentItem in sessionItem.Content)
                        {
                            var otherInfoItem = new OtherInfo();

                            otherInfoItem.RecipeId    = item.Id.ObjectIdValue;
                            otherInfoItem.Description = contentItem.Trim();
                            recipe.OtherInfo.Add(otherInfoItem);
                        }
                    }
                }

                recipes.Add(recipe);
            }

            return(recipes);
        }
        public ActionResult FormAddOtherInfo(OtherInfo otherInfo)
        {
            if (otherInfo == null)
            {
                otherInfo = new OtherInfo();
            }

            MasterModel.OtherInfo = otherInfo;

            return(PartialView("Partials/_AddOtherInfo", otherInfo));
        }
Exemple #9
0
        ///<summary>
        ///读取数据库面板设置,将所有数据读至缓存
        ///</summary>
        public void ReadDevieceInfoFromDB(int intDIndex)
        {
            //read basic information of bacnet
            #region
            string          str = "select * from dbBasicBac where DIndex=" + intDIndex.ToString();
            OleDbDataReader dr  = DataModule.SearchAResultSQLDB(str, CsConst.mstrCurPath);

            if (dr == null)
            {
                return;
            }
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    DeviceName = dr.GetString(1);

                    ValidCount = Convert.ToInt32(dr.GetValue(5).ToString());
                    intPort    = dr.GetInt16(6);
                    blnSwitch  = (dr.GetByte(7) == 1);
                    Address    = dr.GetInt16(8);
                }
                dr.Close();
            }
            #endregion

            //read bacnet to bus
            #region

            str       = string.Format("select * from dbBackNet where DIndex={0}", intDIndex);
            dr        = DataModule.SearchAResultSQLDB(str, CsConst.mstrCurPath);
            otherInfo = new List <OtherInfo>();
            if (dr == null)
            {
                return;
            }
            while (dr.Read())
            {
                OtherInfo tmp = new OtherInfo();
                tmp.ID           = dr.GetByte(1);
                tmp.BackNetIDAry = (byte[])dr[2];
                tmp.Type         = dr.GetInt32(3);
                tmp.strDevName   = dr.GetString(4);
                tmp.Param1       = dr.GetByte(5);
                tmp.Param2       = dr.GetByte(6);
                tmp.Param3       = dr.GetByte(7);
                tmp.Param4       = dr.GetByte(8);
                tmp.Remark       = dr.GetString(9);
                otherInfo.Add(tmp);
            }
            dr.Close();
            #endregion
        }
Exemple #10
0
        public HttpResponseMessage ExtractionProgressInfo(HttpRequestMessage request)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage res = null;

                OtherInfo obj = new OtherInfo();
                ExtractionProgressModel extractionProgressInfo = obj.GetExtractionProgressInfo();

                res = request.CreateResponse(HttpStatusCode.OK, extractionProgressInfo);

                return res;
            }));
        }
        public HttpResponseMessage ProcessProgressInfo(HttpRequestMessage request)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage res = null;

                OtherInfo obj = new OtherInfo();
                ProcessProgressModel processProgressInfo = obj.GetProcessProgressInfo();

                res = request.CreateResponse(HttpStatusCode.OK, processProgressInfo);

                return res;
            }));
        }
        public HttpResponseMessage AccountNumberCustomerName(HttpRequestMessage request, string SearchValue)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage res = null;

                OtherInfo obj = new OtherInfo();
                List <AccountCustomerModel> acctcus = obj.GetAccountCustomerInfo(SearchValue);

                res = request.CreateResponse(HttpStatusCode.OK, acctcus);

                return res;
            }));
        }
        public void ReadTokenInfo(Stream input)
        {
            var entryCount = PosInfo.EntryCount;

            foreach (var line in input.ReadLines(Encoding))
            {
                var entry           = Parse(line);
                var dictionaryEntry = MakeGenericDictionaryEntry(entry);

                var leftId   = dictionaryEntry.LeftId;
                var rightId  = dictionaryEntry.RightId;
                var wordCost = dictionaryEntry.WordCost;

                var allPosFeatures = dictionaryEntry.PartOfSpeechFeatures;

                var posFeatureIds = PosInfo.MapFeatures(allPosFeatures);

                var featureList     = dictionaryEntry.OtherFeatures;
                var otherFeatureIds = OtherInfo.MapFeatures(featureList);

                var bufferEntry = new BufferEntry();
                bufferEntry.TokenInfo.Add(leftId);
                bufferEntry.TokenInfo.Add(rightId);
                bufferEntry.TokenInfo.Add(wordCost);

                if (EntriesFitInAByte(entryCount))
                {
                    var posFeatureIdBytes = CreatePosFeatureIds(posFeatureIds);
                    bufferEntry.PosInfo.AddRange(posFeatureIdBytes);
                }
                else
                {
                    foreach (var posFeatureId in posFeatureIds)
                    {
                        bufferEntry.TokenInfo.Add((short)posFeatureId);
                    }
                }

                bufferEntry.Features.AddRange(otherFeatureIds);

                BufferEntries.Add(bufferEntry);
                Surfaces.Add(dictionaryEntry.Surface);

                if (DictionaryEntries != null)
                {
                    DictionaryEntries.Add(dictionaryEntry);
                }
            }
        }
        public HttpResponseMessage GetMainCAptionFromOtherInfoAndTotalLine(HttpRequestMessage request)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                OtherInfo obj = new OtherInfo();
                List <string> scm = obj.GetMainCAptionFromOtherInfo();

                // notice no need to create a seperate model object since TeamDefinition entity will do just fine
                response = request.CreateResponse(HttpStatusCode.OK, scm);

                return response;
            }));
        }
Exemple #15
0
        ///<summary>
        ///读取数据库面板设置,将所有数据读至缓存
        ///</summary>
        public void ReadDevieceInfoFromDB(int DIndex)
        {
            //read basic information of EIB
            #region
            string          str = "select * from dbDeviceInfo where DIndex=" + DIndex.ToString();
            OleDbDataReader dr  = DataModule.SearchAResultSQLDB(str);

            if (dr == null)
            {
                return;
            }
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Address = dr.GetString(2);
                }
                dr.Close();
            }
            #endregion

            //read EIB to bus
            #region

            str       = string.Format("select * from dbEIBDev where DIndex={0}", DIndex);
            dr        = DataModule.SearchAResultSQLDB(str);
            otherInfo = new List <OtherInfo>();
            if (dr == null)
            {
                return;
            }
            while (dr.Read())
            {
                OtherInfo tmp = new OtherInfo();
                tmp.GroupAddress = dr.GetString(2);
                tmp.ControlType  = dr.GetByte(3);
                tmp.Type         = dr.GetByte(4);
                tmp.Param1       = dr.GetByte(5);
                tmp.Param2       = dr.GetByte(6);
                tmp.Param3       = dr.GetByte(7);
                tmp.Param4       = dr.GetByte(8);
                tmp.strDevName   = dr.GetString(9);
                otherInfo.Add(tmp);
            }
            dr.Close();
            #endregion
        }
Exemple #16
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(OtherInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update OtherInfo set ");
            strSql.Append(" OrderApplyID = @OrderApplyID , ");
            strSql.Append(" ProvCityID = @ProvCityID , ");
            strSql.Append(" CardPeriod = @CardPeriod , ");
            strSql.Append(" NotifyAnswerID = @NotifyAnswerID , ");
            strSql.Append(" PriceArgsID = @PriceArgsID , ");
            strSql.Append(" VisaCity = @VisaCity , ");
            strSql.Append(" Destination = @Destination , ");
            strSql.Append(" TripPurposeId = @TripPurposeId , ");
            strSql.Append(" PropertyAddress = @PropertyAddress , ");
            strSql.Append(" RelatedPersonHouse = @RelatedPersonHouse , ");
            strSql.Append(" RecordUpdateUserID = @RecordUpdateUserID , ");
            strSql.Append(" RecordUpdateTime = GetDate() ");
            strSql.Append(" where OtherInfoID=@OtherInfoID");

            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderApplyID",       model.OrderApplyID),
                new SqlParameter("@OtherInfoID",        model.OtherInfoID),
                new SqlParameter("@ProvCityID",         model.ProvCityID),
                new SqlParameter("@CardPeriod",         model.CardPeriod),
                new SqlParameter("@NotifyAnswerID",     model.NotifyAnswerID),
                new SqlParameter("@PriceArgsID",        model.PriceArgsID),
                new SqlParameter("@VisaCity",           model.VisaCity),
                new SqlParameter("@Destination",        model.Destination),
                new SqlParameter("@TripPurposeId",      model.TripPurposeId),
                new SqlParameter("@PropertyAddress",    model.PropertyAddress),
                new SqlParameter("@RelatedPersonHouse", model.RelatedPersonHouse),
                new SqlParameter("@CreatUserID",        model.CreatUserID),
                new SqlParameter("@RecordUpdateUserID", model.RecordUpdateUserID),
                new SqlParameter("@RecordIsDelete",     model.RecordIsDelete)
            };
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #17
0
        public JsonResult Edit(OtherInfo model)
        {
            var apiResult = new APIResult();

            try
            {
                OtherInfoBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
        //public HttpResponseMessage UpdateIncomeAdjustmentVol(HttpRequestMessage request, int ID, string MISCODE, string ACCTCODE, int PERIOD, int YEAR, string ACCOUNTNUMBER, string PRODUCTCODE, string CATEGORY, string CURRENCY, string CUSTNAME, string CAPTION, string ACCOUNTNUMBER1)
        public HttpResponseMessage UpdateIncomeAdjustmentVol(HttpRequestMessage request, [FromBody] UpdateIncomeAdjustmentVolumeSearchModel updatevolumemodel)
        {
            return(GetHttpResponse(request, () =>
            {
                //IncomeAdjustmentVolumeSearchMtd obj = new IncomeAdjustmentVolumeSearchMtd();
                //obj.UpdateIncomeAdjustmentVolumeSearch(updatevolumemodel);

                OtherInfo latestsetup = new OtherInfo();

                int currentyear = latestsetup.GetLatestIncomeSetUp().Year;
                int currentperiod = latestsetup.GetLatestIncomeSetUp().CurrentPeriod;

                if (updatevolumemodel.YEAR == currentyear && updatevolumemodel.PERIOD == currentperiod)
                {
                    IncomeAdjustmentVolumeSearchMtd obj = new IncomeAdjustmentVolumeSearchMtd();
                    obj.UpdateIncomeAdjustmentVolumeSearch(updatevolumemodel);
                }

                return request.CreateResponse(HttpStatusCode.OK);
            }));
        }
        public static List <OtherInfo> DeserializeOther(HtmlDocument document)
        {
            string[] options = { "兴趣爱好", "获得荣誉", "专业组织", "著作/论文", "专利", "宗教信仰", "特长职业目标", "特殊技能", "社会活动", "荣誉", "推荐售信" };
            var      others  = new List <OtherInfo>();

            foreach (var option in options)
            {
                var node = document.DocumentNode.SelectSingleNode("//h3[text()='" + option + "']");
                if (node != null)
                {
                    var other = new OtherInfo();
                    other.Title = node.InnerText;
                    if (node.NextSibling?.NextSibling != null && node.NextSibling.NextSibling.Name.Equals("div"))
                    {
                        other.Description = node.NextSibling.NextSibling.InnerText;
                        other.Description = other.Description.Replace("\r\n", "").Replace(" ", "");
                        others.Add(other);
                    }
                }
            }
            return(others);
        }
        public void ShouldReturnCorrectOtherInfoCavsTests(
            KeyAgreementRole iutRole,
            OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair> uPartySharedInformation,
            OtherPartySharedInformation <FfcDomainParameters, FfcKeyPair> vPartySharedInformation,
            int otherInfoLength,
            BitString expectedOtherInfo
            )
        {
            string otherInfoPattern = "uPartyInfo||vPartyInfo";

            TestableEntropyProvider entropyProvider = new TestableEntropyProvider();

            // u/v party info comprised of ID, and dkmNonce, find the bitlength of both parties contributed information
            // to determine which bits are the "random" bits to inject into the TestableEntropyProvider.
            var composedBitLength = uPartySharedInformation.PartyId.BitLength +
                                    uPartySharedInformation.DkmNonce.BitLength +
                                    vPartySharedInformation.PartyId.BitLength;

            var entropyBits = expectedOtherInfo.GetLeastSignificantBits(expectedOtherInfo.BitLength - composedBitLength);

            entropyProvider.AddEntropy(entropyBits);

            var uPartyOtherInfo = new PartyOtherInfo(uPartySharedInformation.PartyId, uPartySharedInformation.DkmNonce);
            var vPartyOtherInfo = new PartyOtherInfo(vPartySharedInformation.PartyId, vPartySharedInformation.DkmNonce);

            _subject = new OtherInfo(
                entropyProvider,
                otherInfoPattern,
                otherInfoLength,
                KeyAgreementRole.InitiatorPartyU,
                uPartyOtherInfo,
                vPartyOtherInfo
                );

            var result = _subject.GetOtherInfo();

            Assert.AreEqual(expectedOtherInfo.ToHex(), result.ToHex());
        }
        public IEnumerable <OtherInfo> Index()
        {
            OtherInfo p1 = new OtherInfo
            {
                Job        = "IT",
                Income     = 1000,
                JobAddress = "上海"
            };

            OtherInfo p2 = new OtherInfo
            {
                Job        = "IT运维",
                Income     = 2000,
                JobAddress = "上海"
            };

            List <OtherInfo> list = new List <OtherInfo>();

            list.Add(p1);
            list.Add(p2);

            return(list.AsEnumerable());
        }
Exemple #22
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(OtherInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into OtherInfo(");
            strSql.Append("OrderApplyID , ProvCityID , CardPeriod , NotifyAnswerID , PriceArgsID , VisaCity , Destination , TripPurposeId  , PropertyAddress , RelatedPersonHouse  , CreatUserID   , RecordUpdateUserID   , RecordIsDelete    , RecordUpdateTime   , RecordCreateTime");
            strSql.Append(") values (");
            strSql.Append("@OrderApplyID  , @ProvCityID  , @CardPeriod  , @NotifyAnswerID  , @PriceArgsID   , @VisaCity , @Destination  , @TripPurposeId  , @PropertyAddress , @RelatedPersonHouse  , @CreatUserID  , @RecordUpdateUserID  , @RecordIsDelete   ,  GETDATE() ,  GETDATE()");
            strSql.Append(") ");
            strSql.Append(";select SCOPE_IDENTITY()");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderApplyID",       model.OrderApplyID),
                new SqlParameter("@ProvCityID",         model.ProvCityID),
                new SqlParameter("@CardPeriod",         model.CardPeriod),
                new SqlParameter("@NotifyAnswerID",     model.NotifyAnswerID),
                new SqlParameter("@PriceArgsID",        model.PriceArgsID),
                new SqlParameter("@VisaCity",           model.VisaCity),
                new SqlParameter("@Destination",        model.Destination),
                new SqlParameter("@TripPurposeId",      model.TripPurposeId),
                new SqlParameter("@PropertyAddress",    model.PropertyAddress),
                new SqlParameter("@RelatedPersonHouse", model.RelatedPersonHouse),
                new SqlParameter("@CreatUserID",        model.CreatUserID),
                new SqlParameter("@RecordUpdateUserID", model.RecordUpdateUserID),
                new SqlParameter("@RecordIsDelete",     model.RecordIsDelete)
            };
            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemple #23
0
        public HttpResponseMessage DeleteIncomeAdjustmentCommFeesSearch(HttpRequestMessage request, [FromBody] int Id, [FromBody] IncomeAdjustmentCommFeesSearchModel updatecfmodel)
        {
            return(GetHttpResponse(request, () =>
            {
                //IncomeAdjustmentVolumeSearchMtd obj = new IncomeAdjustmentVolumeSearchMtd();
                //obj.DeleteIncomeAdjustmentVolumeSearch(Id);

                OtherInfo latestsetup = new OtherInfo();

                int currentyear = latestsetup.GetLatestIncomeSetUp().Year;
                int currentperiod = latestsetup.GetLatestIncomeSetUp().CurrentPeriod;

                if (updatecfmodel.Year == currentyear && updatecfmodel.Period == currentperiod)
                {
                    IncomeAdjustmentCommFeesSearchMtd obj = new IncomeAdjustmentCommFeesSearchMtd();
                    if (updatecfmodel.Year == DateTime.Now.Year)
                    {
                        obj.DeleteIncomeAdjustmentCommFeesSearch(Id);
                    }
                }

                return request.CreateResponse(HttpStatusCode.OK);
            }));
        }
Exemple #24
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(OtherInfo model)
 {
     return(dal.Add(model));
 }
Exemple #25
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public OtherInfo GetModel(int OtherInfoID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select OrderApplyID, OtherInfoID,ProvCityID, CardPeriod, NotifyAnswerID, PriceArgsID, VisaCity, Destination, TripPurposeId, PropertyAddress, RelatedPersonHouse, CreatUserID, RecordUpdateUserID, RecordIsDelete, RecordUpdateTime, RecordCreateTime");
            strSql.Append("  from OtherInfo ");
            strSql.Append(" where OtherInfoID=@OtherInfoID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OtherInfoID", SqlDbType.Int, 4)
            };
            parameters[0].Value = OtherInfoID;


            OtherInfo model = new OtherInfo();
            DataSet   ds    = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["OrderApplyID"].ToString() != "")
                {
                    model.OrderApplyID = int.Parse(ds.Tables[0].Rows[0]["OrderApplyID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OtherInfoID"].ToString() != "")
                {
                    model.OtherInfoID = int.Parse(ds.Tables[0].Rows[0]["OtherInfoID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RecordCreateTime"].ToString() != "")
                {
                    model.RecordCreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["RecordCreateTime"].ToString());
                }
                model.ProvCityID = ds.Tables[0].Rows[0]["ProvCityID"].ToString();
                if (ds.Tables[0].Rows[0]["CardPeriod"].ToString() != "")
                {
                    model.CardPeriod = DateTime.Parse(ds.Tables[0].Rows[0]["CardPeriod"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NotifyAnswerID"].ToString() != "")
                {
                    model.NotifyAnswerID = int.Parse(ds.Tables[0].Rows[0]["NotifyAnswerID"].ToString());
                }
                model.PriceArgsID = ds.Tables[0].Rows[0]["PriceArgsID"].ToString();
                if (ds.Tables[0].Rows[0]["CreatUserID"].ToString() != "")
                {
                    model.CreatUserID = int.Parse(ds.Tables[0].Rows[0]["CreatUserID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RecordUpdateUserID"].ToString() != "")
                {
                    model.RecordUpdateUserID = int.Parse(ds.Tables[0].Rows[0]["RecordUpdateUserID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["RecordIsDelete"].ToString() != "")
                {
                    if ((ds.Tables[0].Rows[0]["RecordIsDelete"].ToString() == "1") || (ds.Tables[0].Rows[0]["RecordIsDelete"].ToString().ToLower() == "true"))
                    {
                        model.RecordIsDelete = true;
                    }
                    else
                    {
                        model.RecordIsDelete = false;
                    }
                }
                if (ds.Tables[0].Rows[0]["RecordUpdateTime"].ToString() != "")
                {
                    model.RecordUpdateTime = DateTime.Parse(ds.Tables[0].Rows[0]["RecordUpdateTime"].ToString());
                }

                return(model);
            }
            else
            {
                return(null);
            }
        }
 public OhterCardItemBase()
 {
     serBean = CDNResourceMoveConfig.Instance().otherInfo;
     Init();
 }
Exemple #27
0
        public static SourceResume ConvertTo_Dtl_V5(string content)
        {
            var dto    = new SourceResume();
            var source = JsonConvert.DeserializeObject <dynamic>(content);

            dto.Id = source.resumeNo;
            var Dtl = JsonConvert.DeserializeObject <dynamic>(source.detialJSonStr.ToString());

            if (source.userDetials != null)
            {
                dto.Name               = source.userDetials.userName;
                dto.Gender             = source.userDetials.gender;
                dto.MaritalStatus      = source.userDetials.maritalStatus;
                dto.Cellphone          = source.userDetials.mobilePhone;
                dto.Email              = source.userDetials.email;
                dto.Birthday           = source.userDetials.birthStr;
                dto.CurrentResidence   = source.userDetials.cityId;
                dto.RegisteredResidenc = source.userDetials.hUKOUCityId;
            }
            else
            {
                dto.Name          = Dtl.UserMasterName;
                dto.Gender        = Dtl.Gender;
                dto.MaritalStatus = Dtl.MaritalStatus;
                dto.Birthday      = Dtl.BirthYear;
            }
            dto.ResumeId        = Dtl.ResumeId;
            dto.ResumeName      = Dtl.Name;
            dto.UserMasterId    = Dtl.UserMasterId;
            dto.UserMasterExtId = Dtl.UserMasterExtId;
            dto.ResumeNumber    = Dtl.ResumeNumber;
            dto.WorkStarts      = Dtl.WorkYearsRangeId;
            dto.Degree          = Dtl.CurrentEducationLevel;

            dto.JobStatus = Dtl.DesiredPosition[0].CurrentCareerStatus;
            dto.Intention = new ResumeIntention();
            if (Dtl.DesiredPosition != null && Dtl.DesiredPosition.Count > 0)
            {
                dto.Intention.JobType  = Dtl.DesiredPosition[0].DesiredEmploymentType;
                dto.Intention.Salary   = Dtl.DesiredPosition[0].DesiredSalaryScope;
                dto.Intention.Industry = Dtl.DesiredPosition[0].DesiredIndustry;
                dto.Intention.Function = Dtl.DesiredPosition[0].DesiredJobType;
                dto.Intention.Location = Dtl.DesiredPosition[0].DesiredCity;
            }
            else
            {
                dto.Intention.JobType  = "默认";
                dto.Intention.Salary   = "面议";
                dto.Intention.Industry = "默认";
                dto.Intention.Function = "中国";
                dto.Intention.Location = "中国";
            }

            if (Dtl.SelfEvaluate != null && Dtl.SelfEvaluate.Count > 0)
            {
                dto.Intention.Evaluation = Dtl.SelfEvaluate[0]?.CommentContent;
            }
            else
            {
                dto.Intention.Evaluation = "";
            }

            #region 工作经验

            if (Dtl.WorkExperience != null && Dtl.WorkExperience.Count > 0)
            {
                dto.Works = new List <ResumeWork>();
                foreach (var o in Dtl.WorkExperience)
                {
                    var work = new ResumeWork();
                    work.Begin       = o.DateStart;
                    work.End         = o.DateEnd;
                    work.Company     = o.CompanyName;
                    work.Industry    = o.CompanyIndustry;
                    work.Size        = o.CompanySize;
                    work.Nature      = o.CompanyProperty;
                    work.Department  = o.ResideDepartment;
                    work.Position    = o.JobTitle;
                    work.Description = o.WorkDescription;
                    dto.Works.Add(work);
                }
            }

            #endregion

            #region 项目经验

            if (Dtl.ProjectExperience != null && Dtl.ProjectExperience.Count > 0)
            {
                dto.Projects = new List <ResumeProject>();
                foreach (var o in Dtl.ProjectExperience)
                {
                    var project = new ResumeProject();
                    project.Begin       = o.DateStart;
                    project.End         = o.DateEnd;
                    project.Company     = "";
                    project.Name        = o.ProjectName;
                    project.Description = o.ProjectDescription;
                    project.Duty        = o.ProjectResponsibility;
                    dto.Projects.Add(project);
                }
            }

            #endregion

            #region 教育经历

            if (Dtl.EducationExperience != null && Dtl.EducationExperience.Count > 0)
            {
                dto.Educations = new List <ResumeEducation>();
                foreach (var o in Dtl.EducationExperience)
                {
                    var edu = new ResumeEducation();
                    edu.Begin       = o.DateStart;
                    edu.End         = o.DateEnd;
                    edu.School      = o.SchoolName;
                    edu.Degree      = o.EducationLevel;
                    edu.Description = "";
                    edu.Major       = o.MajorName;
                    dto.Educations.Add(edu);
                }
            }

            #endregion

            #region 培训经历

            if (Dtl.Training != null && Dtl.Training.Count > 0)
            {
                dto.Trainings = new List <ResumeTraining>();
                foreach (var o in Dtl.Training)
                {
                    var train = new ResumeTraining();
                    train.Begin       = o.DateStart;
                    train.End         = o.DateEnd;
                    train.Course      = o.Course;
                    train.Institution = o.Institution;
                    train.Description = o.TrainingDescription;
                    train.Location    = o.Location;
                    dto.Trainings.Add(train);
                }
            }

            #endregion

            #region 技能/语言
            if (Dtl.ProfessionnalSkill != null && Dtl.ProfessionnalSkill.Count > 0)
            {
                dto.Skills = new List <ResumeSkill>();
                foreach (var o in Dtl.ProfessionnalSkill)
                {
                    var skill = new ResumeSkill {
                        Name = o.SkillName, Level = o.MasterDegree.ToString() + "|" + o.UsedMonths.ToString() + "个月", Description = ""
                    };
                    dto.Skills.Add(skill);
                }
            }
            if (Dtl.LanguageSkill != null && Dtl.LanguageSkill.Count > 0)
            {
                if (dto.Skills == null)
                {
                    dto.Skills = new List <ResumeSkill>();
                }
                foreach (var o in Dtl.LanguageSkill)
                {
                    var skill = new ResumeSkill {
                        Name = o.LanguageName, Level = "听说" + o.HearSpeakSkill.ToString() + "|读写" + o.ReadWriteSkill.ToString(), Description = ""
                    };
                    dto.Skills.Add(skill);
                }
            }
            #endregion

            #region 证书

            if (Dtl.AchieveCertificate != null && Dtl.AchieveCertificate.Count > 0)
            {
                dto.Certificates = new List <ResumeCertificate>();
                foreach (var o in Dtl.AchieveCertificate)
                {
                    try
                    {
                        var cert = new ResumeCertificate {
                            Time = Convert.ToDateTime(o.AchieveDate), CertName = o.CertificateName, Description = o.CertificateDescription
                        };

                        dto.Certificates.Add(cert);
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }
            #endregion

            #region 校内荣誉
            if (Dtl.AchieveAward != null && Dtl.AchieveAward.Count > 0)
            {
                dto.Honors = new List <SchoolHonor>();
                foreach (var o in Dtl.AchieveAward)
                {
                    try
                    {
                        var cert = new SchoolHonor {
                            Time = o.AchieveDate, Honor = o.AwardName, Description = o.Description
                        };

                        dto.Honors.Add(cert);
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }
            #endregion

            #region 校内实践

            if (Dtl.PracticeExperience != null && Dtl.PracticeExperience.Count > 0)
            {
                dto.Practices = new List <SchoolPractice>();
                foreach (var o in Dtl.PracticeExperience)
                {
                    try
                    {
                        var cert = new SchoolPractice {
                            Name = o.PracticeName, Begin = o.DateStart, End = o.DateEnd, Description = o.PracticeDescription
                        };

                        dto.Practices.Add(cert);
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }
            #endregion

            #region 其他

            if (Dtl.Other != null && Dtl.Other.Count > 0)
            {
                dto.Others = new List <OtherInfo>();
                foreach (var o in Dtl.Other)
                {
                    try
                    {
                        var cert = new OtherInfo {
                            Title = o.Name, Description = o.Description
                        };

                        dto.Others.Add(cert);
                    }
                    catch
                    {
                        // ignored
                    }
                }
            }
            #endregion
            return(dto);
        }
Exemple #28
0
 public OtherInfoDAL()
 {
     _dataContext = new MDKDBMLDataContext();
     entity = new OtherInfo();
     tOtherInfoData = new TOtherInfoData();
 }
Exemple #29
0
        /// <summary>
        /// 下载所有数据
        /// </summary>
        /// <param name="DevName"></param>
        /// <returns></returns>
        public bool DownloadEIBInforsFrmDevice(string DevName, int wdDeviceType, int intActivePage, int num1, int num2)
        {
            string strMainRemark = DevName.Split('\\')[1].Trim();

            DevName = DevName.Split('\\')[0].Trim();

            byte bytSubID = byte.Parse(DevName.Split('-')[0].ToString());
            byte bytDevID = byte.Parse(DevName.Split('-')[1].ToString());

            byte[] ArayTmp = new byte[0];
            if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x000E, bytSubID, bytDevID, false, true, true, false) == false)
            {
                return(false);
            }
            else
            {
                byte[] arayRemark = new byte[20];
                for (int intI = 0; intI < 20; intI++)
                {
                    arayRemark[intI] = CsConst.myRevBuf[25 + intI];
                }
                DevName          = bytSubID.ToString() + "-" + bytDevID.ToString() + "-" + HDLPF.Byte2String(arayRemark);
                CsConst.myRevBuf = new byte[1200];
            }
            if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
            {
                CsConst.calculationWorker.ReportProgress(1);
            }

            if (intActivePage == 0)
            {
                // 读取基本信息bacnet地址设置
                #region
                if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xBACE, bytSubID, bytDevID, false, true, true, false) == true)
                {
                    Address = CsConst.myRevBuf[25] * 256 * 256 * 256
                              + CsConst.myRevBuf[26] * 256 * 256
                              + CsConst.myRevBuf[27] * 256
                              + CsConst.myRevBuf[28];
                    CsConst.myRevBuf = new byte[1200];
                }
                else
                {
                    return(false);
                }
                if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
                {
                    CsConst.calculationWorker.ReportProgress(3);
                }
                #endregion

                //读取bacnet端口
                #region
                if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x180D, bytSubID, bytDevID, false, true, true, false) == true)
                {
                    blnSwitch = (CsConst.myRevBuf[26] == 1);
                    intPort   = CsConst.myRevBuf[31] * 256 + CsConst.myRevBuf[32];
                }
                else
                {
                    return(false);
                }
                if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
                {
                    CsConst.calculationWorker.ReportProgress(3);
                }
                #endregion

                // 读取转换信息列表
                //读取bacnet个数
                #region

                if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xBAC6, bytSubID, bytDevID, false, true, true, false) == true)
                {
                    ValidCount       = CsConst.myRevBuf[25] * 256 + CsConst.myRevBuf[26];
                    CsConst.myRevBuf = new byte[1200];
                }
                else
                {
                    return(false);
                }
                if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
                {
                    CsConst.calculationWorker.ReportProgress(3);
                }
                #endregion
            }
            if (intActivePage == 0 || intActivePage == 1)
            {
                #region
                ArayTmp   = new byte[1];
                otherInfo = new List <OtherInfo>();
                for (int i = num1; i <= num2; i++)
                {
                    OtherInfo ch = new OtherInfo();

                    ArayTmp[0] = (byte)(i);
                    if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xBAC4, bytSubID, bytDevID, false, true, true, false) == true)
                    {
                        if (CsConst.myRevBuf != null)
                        {
                            ch.ID = CsConst.myRevBuf[26];
                            ch.BackNetIDAry[0] = CsConst.myRevBuf[27];
                            ch.BackNetIDAry[1] = CsConst.myRevBuf[28];
                            ch.BackNetIDAry[2] = CsConst.myRevBuf[29];
                            ch.BackNetIDAry[3] = CsConst.myRevBuf[30];
                            ch.Type            = CsConst.myRevBuf[32] * 256 + CsConst.myRevBuf[31];
                            ch.strDevName      = CsConst.myRevBuf[39].ToString() + " / " + CsConst.myRevBuf[40].ToString();
                            ch.Param1          = CsConst.myRevBuf[41];
                            ch.Param2          = CsConst.myRevBuf[42];
                            ch.Param3          = CsConst.myRevBuf[43];
                            ch.Param4          = CsConst.myRevBuf[44];
                            byte[] arayRemark = new byte[40];
                            for (int intJ = 0; intJ < 40; intJ++)
                            {
                                arayRemark[intJ] = CsConst.myRevBuf[49 + intJ];
                            }
                            ch.Remark = HDLPF.Byte2String(arayRemark);
                        }
                        CsConst.myRevBuf = new byte[1200];
                        HDLUDP.TimeBetwnNext(10);
                        otherInfo.Add(ch);
                    }
                    else
                    {
                        return(false);
                    }
                    if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
                    {
                        CsConst.calculationWorker.ReportProgress(i / 3, null);
                    }
                }
                #endregion
            }
            MyRead2UpFlags[0] = true;
            if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
            {
                CsConst.calculationWorker.ReportProgress(100, null);
            }
            return(true);
        }
Exemple #30
0
        /// <summary>
        /// 下载所有数据
        /// </summary>
        /// <param name="DevName"></param>
        /// <returns></returns>
        public bool DownloadEIBInforsFrmDevice(string DevName)
        {
            string strMainRemark = DevName.Split('\\')[1].Trim();

            DevName = DevName.Split('\\')[0].Trim();

            byte bytSubID = byte.Parse(DevName.Split('-')[0].ToString());
            byte bytDevID = byte.Parse(DevName.Split('-')[1].ToString());

            byte[] ArayTmp = new byte[0];
            if (CsConst.mySends.AddBufToSndList(ArayTmp, 0x000E, bytSubID, bytDevID, false, true, true, false) == false)
            {
                return(false);
            }
            else
            {
                byte[] arayRemark = new byte[20];
                for (int intI = 0; intI < 20; intI++)
                {
                    arayRemark[intI] = CsConst.myRevBuf[25 + intI];
                }
                DevName          = bytSubID.ToString() + "-" + bytDevID.ToString() + "\\" + HDLPF.Byte2String(arayRemark);
                CsConst.myRevBuf = new byte[1200];
            }
            if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
            {
                CsConst.calculationWorker.ReportProgress(1);
            }
            // 读取基本信息物理地址设置
            if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xF255, bytSubID, bytDevID, false, true, true, false) == true)
            {
                Address = (CsConst.myRevBuf[25] & 0xF0 >> 4).ToString() + " / "
                          + (CsConst.myRevBuf[25] & 0x0F).ToString()
                          + CsConst.myRevBuf[26].ToString();
                CsConst.myRevBuf = new byte[1200];
            }
            else
            {
                return(false);
            }
            if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
            {
                CsConst.calculationWorker.ReportProgress(2);
            }

            // 读取转换信息列表
            #region
            otherInfo = new List <OtherInfo>();
            for (int i = 0; i < 254; i++)
            {
                ArayTmp = new byte[1];
                OtherInfo ch = new OtherInfo();

                ArayTmp[0] = (byte)(i);
                if (CsConst.mySends.AddBufToSndList(ArayTmp, 0xC080, bytSubID, bytDevID, false, true, true, false) == true)
                {
                    if (CsConst.myRevBuf != null)
                    {
                        ch.GroupAddress = (CsConst.myRevBuf[26] & 0x78 >> 3).ToString()
                                          + (CsConst.myRevBuf[26] & 0x07).ToString()
                                          + CsConst.myRevBuf[27];
                        ch.Type        = CsConst.myRevBuf[28];
                        ch.strDevName  = CsConst.myRevBuf[29].ToString() + " / " + CsConst.myRevBuf[30].ToString();
                        ch.ControlType = CsConst.myRevBuf[31];
                        ch.Param1      = CsConst.myRevBuf[32];
                        ch.Param2      = CsConst.myRevBuf[33];
                        ch.Param3      = CsConst.myRevBuf[34];
                        ch.Param4      = CsConst.myRevBuf[35];
                    }
                    CsConst.myRevBuf = new byte[1200];
                    HDLUDP.TimeBetwnNext(10);
                    otherInfo.Add(ch);
                }
                else
                {
                    return(false);
                }
                if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
                {
                    CsConst.calculationWorker.ReportProgress(i / 3, null);
                }
            }
            #endregion
            if (CsConst.calculationWorker != null && CsConst.calculationWorker.IsBusy)
            {
                CsConst.calculationWorker.ReportProgress(100, null);
            }
            MyRead2UpFlags[0] = true;
            return(true);
        }
Exemple #31
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(OtherInfo model)
 {
     return(dal.Update(model));
 }