当前位置: 首页>>代码示例>>C#>>正文


C# Query.AddParam方法代码示例

本文整理汇总了C#中Query.AddParam方法的典型用法代码示例。如果您正苦于以下问题:C# Query.AddParam方法的具体用法?C# Query.AddParam怎么用?C# Query.AddParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Query的用法示例。


在下文中一共展示了Query.AddParam方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetModel

        public OfficialMatchRank GetModel(int gmid, int userid)
        {
            Query query = new Query();

            query.Where = string.Format("gmid={0} and UserId={1}", dal.BuildParameterName("gmid"), dal.BuildParameterName("UserId"));
            query.AddParam("gmid", gmid);
            query.AddParam("UserId", userid);

            return dal.Get(query);
        }
开发者ID:,项目名称:,代码行数:10,代码来源:

示例2: AddGift

        public string AddGift(int giftID,int userID)
        {
            //if (giftID == 1 || giftID == 2 || giftID == 3||giftID ==4)
            //{
                Query query = new Query();
                query.AddParam("UserID", userID);
                query.AddParam("GiftID", giftID);

                DataSet ds=Gateway.Default.ExecuteSPForDS("AddGift", query);

                return ds.Tables[0].Rows[0][0].ToString();
            //}
            //return "有该领奖活动吗?";
        }
开发者ID:dalinhuang,项目名称:myxx,代码行数:14,代码来源:bizGift.cs

示例3: ResultSet

        public void ResultSet(int id, int deid)
        {
            bizGGuess gm = new bizGGuess();
            bizGGuessDe gg = new bizGGuessDe();
            List<GGuessDe> list = gg.ListByGGuessID(id);
            GGuess modelMain = gm.Get(id);
            int allNum = list.Sum(p => p.JinbiNum);
            decimal peilv;
            GGuessDe model = list.First(p => p.GGuessDeID == deid);
            if (allNum == 0 || model.JinbiNum==0)
                peilv = 1;
            else
                peilv = Math.Round((decimal)allNum / model.JinbiNum, 2);

            Query query = new Query();
            query.AddParam("GGuessID", id);
            query.AddParam("GGuessDeID",deid);
            query.AddParam("Peilv", peilv);

            Gateway.Default.ExecuteSPForNonQuery("GGuessResultSet",query);

            //List<GGuessUsers> listGUser = ListByGGuessID(deid);
            //int i = 0;
            //foreach (GGuessUsers item in listGUser)
            //{
            //    i++;
            //    if (item.Status == 0)
            //    {
            //        Users modelUser = bu.Get(item.UserID);
            //        modelUser.Attach();
            //        modelUser.Jinbi = modelUser.Jinbi + int.Parse((decimal.Parse(item.Jinbi.ToString()) * peilv).ToString());
            //        modelUser.Detach();
            //        bu.Update(modelUser);
            //        item.Attach();
            //        item.Status = 1;
            //        item.Detach();
            //        Update(item);
            //    }
            //}
            //modelMain.Attach();
            //modelMain.ResultItem = model.ItemName;
            //modelMain.ResultUserNum = i;
            //modelMain.Status = 2;
            //modelMain.Detach();
            //gm.Update(modelMain);
        }
开发者ID:dalinhuang,项目名称:myxx,代码行数:46,代码来源:bizGGuessUsers.cs

示例4: button8_Click

 private void button8_Click(object sender, EventArgs e)
 {
     LeanCloudRepository<RegUsers> rep = new LeanCloudRepository<RegUsers>();
     rep.FindAllEvent+=rep_FindAllEvent;
     Query query = new Query();
     query.AddParam(new QueryParam("UserName", "6", QuerySign.LIKE, ConnectSign.AND, true));
     rep.FindAllByCondition(query);
 }
开发者ID:canglognqisu,项目名称:LQTank,代码行数:8,代码来源:Form1.cs

示例5: button7_Click

 private void button7_Click(object sender, EventArgs e)
 {
     LeanCloudRepository<RegUsers> rep = new LeanCloudRepository<RegUsers>();
     rep.FindEvent+=rep_FindEvent;
     Query query=new Query();
     query.AddParam(new QueryParam("UserName", "haha1", QuerySign.EQ, ConnectSign.AND, true))
         .AddParam(new QueryParam("Password", "222222", QuerySign.EQ, ConnectSign.AND, true));
     rep.FindByCondition(query);
 }
开发者ID:canglognqisu,项目名称:LQTank,代码行数:9,代码来源:Form1.cs

示例6: SetUserRecord

        public void SetUserRecord(int gmid, int userid, string username, decimal score)
        {
            Query query = new Query();

            query.Where = string.Format("gmid={0} and UserId={1}", dal.BuildParameterName("gmid"), dal.BuildParameterName("UserId"));
            query.AddParam("gmid", gmid);
            query.AddParam("UserId", userid);

            OfficialMatchRank rank = dal.Get(query);

            bizOfficialMatch biz = bizOfficialMatch.Instance();

            FlashGame game = bizFlashGame.Instance().GetModel(biz.GetModel(gmid).fid);

            bool isExist = false;
            bool isUpdate = false;

            if (rank != null)
            {
                isExist = true;
                rank.Attach();
            }
            else
            {
                rank = new OfficialMatchRank();
                rank.gmid = gmid;
                rank.GameTime = DateTime.Now;
                rank.UserId = userid;
                rank.UserName = username;
            }

            if (game.IsAsc == 0)
            {
                if (rank.Score < score)
                {
                    rank.Score = score;
                    rank.GameTime = DateTime.Now;
                    isUpdate = true;
                }

            }
            else
            {
                if (rank.Score > score)
                {
                    rank.Score = score;
                    rank.GameTime = DateTime.Now;
                    isUpdate = true;
                }
            }

            if (isExist)
            {
                if (isUpdate)
                {
                    dal.Update(rank);
                }
            }
            else
            {
                dal.Add(rank);
            }
        }
开发者ID:,项目名称:,代码行数:63,代码来源:

示例7: DeleteAll

 public void DeleteAll(int id)
 {
     Query query = new Query();
     query.AddParam("guessid", id);
     Gateway.Default.ExecuteSPForNonQuery("GGuessDelete", query);
 }
开发者ID:dalinhuang,项目名称:myxx,代码行数:6,代码来源:bizGGuess.cs


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