• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Results类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Results的典型用法代码示例。如果您正苦于以下问题:C# Results类的具体用法?C# Results怎么用?C# Results使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Results类属于命名空间,在下文中一共展示了Results类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: searchUserEmail

 public object searchUserEmail(string user, string Email)
 {
     Results<string> result = new Results<string>();
     HelperData h = new HelperData();
     try
     {
         result.Value = h.searchUserEmail(user, Email);
         if (result.Value != "0" && result.Value != "-1")
         {
             result.IsSuccessfull = true;
             result.Message = "";
         }
         else
         {
             result.IsSuccessfull = false;
             result.Message = "نام کاربری یا آدرس ایمیل وارد شده اشتباه میباشد";
         }
         return result;
     }
     catch
     {
         result.IsSuccessfull = false;
         result.Message = "ارتباط با پایگاه داده برقرار نشد. خطای شماره 190";
         return result;
     }
 }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:26,代码来源:loginBLL.cs


示例2: sendEmail

        public object sendEmail(string user, string email)
        {
            Results<string> result = new Results<string>();
            try
            {
                SmtpClient smtp = new SmtpClient("smtp.mail.yahoo.com");
                smtp.EnableSsl = true;
                smtp.Credentials = new NetworkCredential("[email protected]", "sally_bam66");
                MailMessage m = new MailMessage();
                m.SubjectEncoding = System.Text.Encoding.UTF8;
                m.BodyEncoding = System.Text.Encoding.UTF8;
                m.From = new MailAddress("[email protected]");
                m.To.Add(email);
                m.Subject = "تغییر رمز عبور سامانه ";
                m.Body = "با سلام.رمز عبور جدید شما برای ورود به سامانه ثبت شناسنامه ی نرم افزارها عبارت : "+user+" میباشد. ";
                smtp.Send(m);
                result.IsSuccessfull = true;
                return result;
            }

            catch (Exception error)
            {
                result.IsSuccessfull = false;
                result.Message = "امکان ارسال ایمیل نمیباشد. خطای شماره 192" + Environment.NewLine + error.Message;
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:27,代码来源:loginBLL.cs


示例3: changPass

        public object changPass(string userName)
        {
            Results<string> result = new Results<string>();
            HelperData h = new HelperData();
            try
            {
                string  newPass = new CustomMembershipProvider().EncryptPassword(userName);
                result.Value = h.changPass(userName, newPass);
                if (result.Value != "0")
                {
                    result.IsSuccessfull = true;
                    result.Message = "";
                }
                else
                {
                    result.IsSuccessfull = false;

                }
                return result;
            }
            catch
            {
                result.IsSuccessfull = false;
                result.Message = "ارتباط با پایگاه داده برقرار نشد. خطای شماره 190";
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:27,代码来源:loginBLL.cs


示例4: VisibleAppliedFilters_Should_Return_Only_Visible_Filters

        public void VisibleAppliedFilters_Should_Return_Only_Visible_Filters()
        {
            var visibleFilter1 = new Slice
                                     {
                                         Name = "Filtro 1",
                                         Visible = true
                                     };
            var visibleFilter2 = new Slice
                                     {
                                         Name = "Filtro 2",
                                         Visible = true
                                     };
            var invisibleFilter = new Slice
                                      {
                                          Name = "Filtro Invisible",
                                          Visible = false
                                      };

            var results = new Results<Publication>(1, 10);
            results.AddAppliedFilter(visibleFilter1);
            results.AddAppliedFilter(visibleFilter2);
            results.AddAppliedFilter(invisibleFilter);

            Assert.Contains(visibleFilter1, results.VisibleAppliedFilters);
            Assert.Contains(visibleFilter2, results.VisibleAppliedFilters);
            Assert.IsFalse(results.VisibleAppliedFilters.Contains(invisibleFilter));
        }
开发者ID:pampero,项目名称:cgFramework,代码行数:27,代码来源:ResultTest.cs


示例5: creatReq

        public object creatReq(fieldInfo rn, List<tendencyInfo> rgr)
        {
            Results<string> result = new Results<string>();

            try
            {
                HelperData h = new HelperData();
              //  db.Connection.Open();
              //  using (db.Transaction = db.Connection.BeginTransaction())
                rn.deleted = false;
                int t = h.AddFieldInfo(rn);
                if (t != 0)
                {
                    bool s = h.AddTendency(rgr, t);
                    if (s)
                    {
                        //  db.Transaction.Commit();
                        result.IsSuccessfull = true;
                    }
                }
                else
                {
                    result.Message = "خطا!نام رشته وارد شده قبلا در سیستم ثبت شده است";
                }
            }
            catch (Exception error)
            {
              //  db.Transaction.Rollback();
                result.IsSuccessfull = false;
                result.Message = error.Message;
            }
            return result;
        }
开发者ID:saeedehsaneei,项目名称:educationDegree,代码行数:33,代码来源:manageBLL.cs


示例6: NewResult_WithEmptyPoiList_ContainsZeroPoisInResult

 public void NewResult_WithEmptyPoiList_ContainsZeroPoisInResult()
 {
     var pois = new List<Poi>();
     var result = new Results(pois);
     result.Value.Should().NotBeNull();
     result.Value.Should().HaveCount(0);
 }
开发者ID:genecyber,项目名称:Junaio.Net-Framework,代码行数:7,代码来源:ResultTests.cs


示例7: checkUserName

        public object checkUserName(string userName)
        {
            Results<DataTable> result = new Results<DataTable>();
            try
            {

                HelperSearch h = new HelperSearch();
                int list = h.checkUniqUser(userName);

                if (list == 1)
                {
                    result.Message = "";
                    result.IsSuccessfull = true;
                }
                else if (list == 2)
                {
                    result.Message = "نام کاربری تکراری است.";
                    result.IsSuccessfull = false;
                }
                return result;
            }
            catch
            {
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:educationDegree,代码行数:26,代码来源:manageBLL.cs


示例8: SecondPass

 private static void SecondPass(VersionHandler handler, int[] maxCharacters, List<DeviceResult> initialResults, Results results)
 {
     int lowestScore = int.MaxValue;
     foreach (DeviceResult current in initialResults)
     {
         // Calculate the score for this device.
         int deviceScore = 0;
         for (int segment = 0; segment < handler.VersionRegexes.Length; segment++)
         {
             deviceScore += (maxCharacters[segment] - current.Scores[segment].CharactersMatched + 1)*
                            (current.Scores[segment].Difference + maxCharacters[segment] -
                             current.Scores[segment].CharactersMatched);
         }
         // If the score is lower than the lowest so far then reset the list
         // of best matching devices.
         if (deviceScore < lowestScore)
         {
             results.Clear();
             lowestScore = deviceScore;
         }
         // If the device score is the same as the lowest score so far then add this
         // device to the list.
         if (deviceScore == lowestScore)
         {
             results.Add(current.Device);
         }
     }
 }
开发者ID:irobinson,项目名称:51DegreesDNN,代码行数:28,代码来源:Matcher.cs


示例9: Run

		public async override Task<Results> Run ()
		{
			var location = Location;
			if (location == null)
				return null;

			var container = CKContainer.DefaultContainer;
			var publicDB = container.PublicCloudDatabase;
			var query = new CKQuery ("Items", NSPredicate.FromValue (true)) {
				SortDescriptors = new NSSortDescriptor [] {
					new CKLocationSortDescriptor ("location", location)
				}
			};

			var defaultZoneId = new CKRecordZoneID (CKRecordZone.DefaultName, CKContainer.OwnerDefaultName);
			CKRecord [] recordArray = await publicDB.PerformQueryAsync (query, defaultZoneId);
			var results = new Results (alwaysShowAsList: true);

			var len = recordArray.Length;
			if(len == 0)
				ListHeading = "No matching items";
			else if (len == 1)
				ListHeading = "Found 1 matching item:";
			else
				ListHeading = $"Found {recordArray.Length} matching items:";

			results.Items.AddRange (recordArray.Select (r => new CKRecordWrapper (r)));
			return results;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:29,代码来源:PerformQuerySample.cs


示例10: deleteVahed

        public object deleteVahed(short vahedCode)
        {
            Results<DataTable> result = new Results<DataTable>();
            try
            {

                HelperData sHelper = new HelperData();
                int list = sHelper.DeleteVahedInfo(vahedCode);

                if (list == 1)
                {
                    result.Message = "";
                    result.IsSuccessfull = true;
                }
                else
                {

                    result.IsSuccessfull = false;
                }
                return result;
            }
            catch
            {
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:26,代码来源:VahedReqBLL.cs


示例11: ReportCardFacade

 public ReportCardFacade(Student aStudent)
 {
     student = aStudent;
     studentResult = new Results(aStudent);
     studentBehavior = new Behavior(aStudent);
     studentAttendance = new Attendance(aStudent);
 }
开发者ID:hajirazin,项目名称:DesignPatternsDotNet,代码行数:7,代码来源:ReportCardFacade.cs


示例12: GetFunctionalRatio

        /// <summary>
        /// Returns the coefficient to be used in order to display the results according to the preferences of the IResult
        /// object used to create the instance of this object. Returns the prefered functional unit divided by the functional unit.
        /// 
        /// In case of the FunctionalUnit is null or the PreferedUnit is null, this method returns a ratio of 1. This is usefull to
        /// display the Inputs results and the TransportationSteps results which are accounted for all outputs and not a specific one.
        /// In these cases instead of defining a PreferedUnit for each output we prefer to define none to make things simpler (see InputResult.GetResults)
        /// 
        /// Before display all results must be multiplied by this coefficient
        /// 
        /// May return a NullReferenceExeption if the IResult object does not define FunctinoalUnit, PreferedDisplayedUnit or PreferedDisplayedAmount
        /// </summary>
        /// <param name="results"></param>
        /// <returns></returns>
        internal static double GetFunctionalRatio(GData data, Results results, int producedResourceId)
        {
            if (results != null && results.CustomFunctionalUnitPreference != null && results.CustomFunctionalUnitPreference.PreferredUnitExpression != null)
            {
                LightValue functionalUnit = new LightValue(1.0, results.BottomDim);
                LightValue preferedFunctionalUnit = GetPreferedVisualizationFunctionalUnit(data, results, producedResourceId);

                switch (preferedFunctionalUnit.Dim)
                {
                    case DimensionUtils.MASS: // HARDCODED
                        {
                            functionalUnit = data.ResourcesData[producedResourceId].ConvertToMass(functionalUnit);
                        } break;
                    case DimensionUtils.ENERGY: // HARDCODED
                        {
                            functionalUnit = data.ResourcesData[producedResourceId].ConvertToEnergy(functionalUnit);
                        } break;
                    case DimensionUtils.VOLUME: // HARDCODED
                        {
                            functionalUnit = data.ResourcesData[producedResourceId].ConvertToVolume(functionalUnit);
                        } break;
                }
                return preferedFunctionalUnit.Value / functionalUnit.Value;
            }
            else
                return 1;
        }
开发者ID:jckelly,项目名称:GREETAPI,代码行数:41,代码来源:Program.cs


示例13: SearchInTable

        public object SearchInTable(string Name, int firstRow)
        {
            DataTable list = new DataTable();
            Results<DataTable> result = new Results<DataTable>();
            try
            {

                helperSearch sHelper = new helperSearch();
                list = sHelper.searchVahed(Name, firstRow, firstRow +6 -1);

                if (list.Rows.Count == 0)
                {
                    result.Message = "";
                    result.IsSuccessfull = false;
                }
                else
                {
                    result.Value = list;
                    result.IsSuccessfull = true;
                }
                return result;
            }
            catch
            {
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:27,代码来源:VahedReqBLL.cs


示例14: changePass

        public object changePass(string oldPass, string newPass)
        {
            Results<string> result = new Results<string>();
            HelperData h = new HelperData();

            try
            {
                newPass = new CustomMembershipProvider().EncryptPassword(newPass);
                oldPass = new CustomMembershipProvider().EncryptPassword(oldPass);
                result.Value = h.changePass(oldPass, newPass, Convert.ToInt32(System.Web.HttpContext.Current.Session["userCode"]));
                if (result.Value == "1")
                {
                    result.IsSuccessfull = true;
                }
                else if (result.Value == "0")
                {
                    result.IsSuccessfull = false;
                    result.Message = "رمز عبور فعلی، اشتباه وارد شده است";
                }
                else
                {
                    result.IsSuccessfull = false;
                    result.Message = "امکان ویرایش اطلاعات نمیباشد/ خطای شماره 100";
                }
                return result;
            }
            catch (Exception error)
            {
                result.Message = error.Message;
                result.IsSuccessfull = false;
                return result;
            }
        }
开发者ID:saeedehsaneei,项目名称:educationDegree,代码行数:33,代码来源:manageBLL.cs


示例15: displayQuestionResults

    /**
     * Tells the GUI what the current question's results are and to display them on the screen.
     * The results will contain each player's question, answer, and correctness of the answer.
     * The GUI will first display each player's answer along with the correct answeyth vhur.
     * A dramatic pause between the player's answer and correct answer can be added.
     * The GUI should signify which questions are correct and which ones aren't.
     *
     * The GUI should then enable a button to let the player continue to the next question.
     * When the button is pressed, the GUI will report to the Core.
     * Once all players are ready to move on, the Core will call nextQuestion for the GUI to ask the next question.
     * If there are no more questions, the Core will call displayFinalResults instead
     *
     * Just a note: This uses the viewNextButton, which currently has pretty bad ways of hiding
     * the button. We may need to refactor this code in the future to efficiently and more elegantly
     * hide and make the button appear.
     */
    public void displayQuestionResults(Results theResults)
    {
        // Audio to play on question load
        GameObject myViewGradeResult = GameObject.Find ("viewGradeResult");
        // Gives feedback on correctness
        GameObject myViewGradeText = GameObject.Find ("viewGradeText");
        // Moves on to next question ("Onwards!")
        GameObject myViewNextButton = GameObject.Find ("viewNextButton");

        //Image myViewGradeResultImage = myViewGradeResult.GetComponents<Image> ();
        Text myViewGradeTextComponent = myViewGradeText.GetComponent<Text> ();

        // Update the contents depending on whether you got it right or not
        if (theResults.isCorrect [0]) {
            myViewGradeTextComponent.text = "Hey, " + theResults.players [0].playerName + " got this correct!";
            myViewGradeTextComponent.color = Color.green;
            // Change the graphic to HAPPY
            //(GameObject.Find ("playerReaction")).GetComponent<Image>().sprite = Resources.Load("Cerulean_Happy") as Sprite;
        } else {
            myViewGradeTextComponent.text = theResults.players [0].playerName + " got this wrong. You suck.";
            myViewGradeTextComponent.color = Color.red;
            // Change the graphic to SAD
            //(GameObject.Find ("playerReaction")).GetComponent<Image>().sprite = Resources.Load ("Cerulean_Sad") as Sprite;
        }
        // Make things appear.
        // TODO: REFACTORING, I CALL DIBS, HANDS OFF NICK -- Watson
        myViewGradeTextComponent.enabled = true;
        (myViewNextButton.GetComponent<Image> ()).enabled = true;
        ((GameObject.Find ("viewNextButtonText")).GetComponent<Text>()).enabled = true;
    }
开发者ID:starrodkirby86,项目名称:better-quiz-app,代码行数:46,代码来源:GUI.cs


示例16: creatSoftReq

        public Results<string> creatSoftReq(softwareInfo rn,upgrade up)
        {
            Results<string> result = new Results<string>();
            try
            {
                HelperData h = new HelperData();
                rn.userCode = Convert.ToInt16(System.Web.HttpContext.Current.Session["userCode"]);
                rn.deleted = false;
                up.deleted = false;
                Int16 t = h.AddSoftwareInfo(rn);
                if (t != 0)
                {
                    result.IsSuccessfull = true;
                    up.softwareCode = rn.softwareCode;
                    h.AddUpgrade(up);

                }
            }
            catch (Exception error)
            {
                result.IsSuccessfull = false;
                result.Message = error.Message;
            }
            return result;
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:25,代码来源:AddSoftwareBLL+(saeedeh+saneei's+conflicted+copy+2015-09-27).cs


示例17: Match

        protected internal override Results Match(string userAgent)
        {
            bool isMobile = false;

            // Use RIS to find a match first.
            Results results = base.Match(userAgent);

            // If no match with RIS then try edit distance.
            if (results == null || results.Count == 0)
                results = Matcher.Match(userAgent, this);

            // If a match other than edit distance was used then we'll have more confidence
            // and return the mobile version of the device.
            if (results.GetType() == typeof (Results))
                isMobile = true;

            Results newResults = new Results();

            // Look at the results for one that matches our isMobile setting based on the
            // matcher used.
            foreach (Result result in results)
            {
                if (result.Device.IsMobileDevice == isMobile)
                    newResults.Add(result.Device);
            }

            // Return the new results if any values are available.
            return newResults;
        }
开发者ID:irobinson,项目名称:51DegreesDNN,代码行数:29,代码来源:CatchAllHandler.cs


示例18: DeleteZone

        public object DeleteZone(short zoneCode)
        {
            Results<DataTable> result = new Results<DataTable>();
               try
               {

               HelperData sHelper = new HelperData();
               int i = sHelper.DeleteZoneInfo(zoneCode);
               if (i == 1)
               {
                   result.Message = "";
                   result.IsSuccessfull = true;
               }
               else
               {
                   result.Message = "";
                   result.IsSuccessfull = false;
               }
                   return result;
               }
               catch
               {
               return result;
               }
        }
开发者ID:saeedehsaneei,项目名称:TestSoftware,代码行数:25,代码来源:ZoneReqBLL.cs


示例19: ProcessResult

		Results ProcessResult (CKRecord record)
		{
			var results = new Results ();
			if (record != null)
				results.Items.Add (new CKRecordWrapper (record));

			return results;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:8,代码来源:SaveRecordSample.cs


示例20: ResponseBuyItem

 public static void ResponseBuyItem(Client client, Results results)
 {
     using (var packet = new PacketWriter(Operation.MatchResponseBuyItem, CryptFlags.Decrypt))
     {
         packet.Write((Int32)results);
         client.Send(packet);
     }
 }
开发者ID:Theoretical,项目名称:bunnyemu,代码行数:8,代码来源:Match.cs



注:本文中的Results类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RetryPolicy类代码示例发布时间:2022-05-24
下一篇:
C# ResultType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap