예제 #1
0
        /// <summary>
        /// 通过显示耳号取得受孕天数
        /// </summary>
        /// <param name="displayEarNum"></param>
        /// <returns></returns>
        public JsonResult GetDaysOfPregnant(string displayEarNum)
        {
            int     earNum         = CowBLL.ConvertDislayEarNumToEarNum(displayEarNum, UserBLL.Instance.CurrentUser.Pasture.ID);
            CowInfo cow            = new CowInfo(earNum);
            int     daysOfPregnant = cow.DaysOfPregnant;

            return(Json(new { DaysOfPregnant = daysOfPregnant }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public JsonResult GetCowInfo(string displayEarNum)
        {
            int earNum = CowBLL.ConvertDislayEarNumToEarNum(displayEarNum, UserBLL.Instance.CurrentUser.Pasture.ID);

            CowInfo myCow = new CowInfo(earNum);


            return(Json(myCow, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        public JsonResult GetFatherSemon()
        {
            string motherEarNum = Request.Form["motherDisplayEarNum"].ToString();
            int    temp         = CowBLL.ConvertDislayEarNumToEarNum(motherEarNum, UserBLL.Instance.CurrentUser.Pasture.ID);

            if (temp == -1)
            {
                return(Json(new { SemenNum = "" }));
            }
            else
            {
                CowInfo cow = new CowInfo(temp);
                string  s   = cow.LatestInsemination.SemenNum;
                return(Json(new { SemenNum = s }));
            }
        }
예제 #4
0
        public JsonResult InsertDryMilk(string earNum, string dryDate, string drySitudation, string dryReason, string operatorID)
        {
            DryMilk dry = new DryMilk();

            dry.EarNum       = CowBLL.ConvertDislayEarNumToEarNum(earNum, UserBLL.Instance.CurrentUser.Pasture.ID);
            dry.DryDate      = DateTime.Parse(dryDate);
            dry.DrySituation = Int32.Parse(drySitudation);
            dry.OperatorID   = Int32.Parse(operatorID);
            dry.DryReason    = dryReason;
            int temp   = CowInfo.InsertDryMilk(dry);
            var result = new
            {
                count = temp
            };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
 public void AddToScene(CowInfo info)
 {
     stillHasMapObject = true;
     blinking          = false;
     this.SetTimeToNextBlink();
     this.SetupAnimations();
     renderInFrontOfPlayer = true;
     position    = info.position;
     velocity    = info.velocity;
     mapObject   = (Globals.g_world.game).GetMapObject(info.mapObjectId);
     mapObjectId = info.mapObjectId;
     this.SetState(CowState.e_Active);
     nowAnim = anim[(int)CowAnimation.n_Walk];
     nowAnim.PlayLooping();
     knockedOver = false;
     noGoZoneId  = info.noGoZoneId;
     movement    = info.movement;
     //mapObject.SetTexture(nowAnim.GetTexture());
 }