Example #1
0
        public JsonResult LoadTask(string taskID)
        {
            TaskBLL   bll = new TaskBLL();
            DairyTask v;

            v = bll.GetTaskByID(Int32.Parse(taskID));
            string displayEarNum = CowBLL.ConvertEarNumToDisplayEarNum(v.EarNum);

            GroupingRecordBLL grbBLL   = new GroupingRecordBLL();
            GroupingRecord    gr       = grbBLL.GetGroupingRecordByTaskID(Int32.Parse(taskID));
            CowGroupBLL       cgBLL    = new CowGroupBLL();
            HouseBLL          hBLL     = new HouseBLL();
            CowGroup          oldgroup = cgBLL.GetCowGroupInfo(gr.OriginalGroupID);
            CowGroup          newgroup = cgBLL.GetCowGroupInfo(gr.TargetGroupID);
            House             oldhouse = hBLL.GetHouseByID(UserBLL.Instance.CurrentUser.Pasture.ID, gr.OriginalHouseID);
            House             newhouse = hBLL.GetHouseByID(UserBLL.Instance.CurrentUser.Pasture.ID, gr.TargetHouseID);

            return(Json(new
            {
                EarNum = v.EarNum,
                DisplayEarNum = displayEarNum,
                ArrivalTime = v.ArrivalTime.ToString("yyyy-MM-dd"),
                Operator = v.OperatorID,
                OldGroup = oldgroup.Name,
                OldHouse = oldhouse.Name,
                NewGroup = newgroup.Name,
                NewHouse = newhouse.Name
            }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        public JsonResult GetHouses(int groupID)
        {
            HouseBLL     hBLL   = new HouseBLL();
            List <House> houses = hBLL.GetHouseListByGroup(UserBLL.Instance.CurrentUser.Pasture.ID, groupID);

            return(Json(houses, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        private void LoadHouse()
        {
            HouseBLL houseBll = new HouseBLL();

            // load house
            dgvHouseInfor.DataSource = houseBll.findById(houseId);
            //houseId = int.Parse(dgvHouseInfor.Rows[0].Cells[0].Value.ToString());
            dgvHouseInfor.Columns["Id"].Visible       = false;
            dgvHouseInfor.Columns["UserId"].Visible   = false;
            dgvHouseInfor.Columns[1].HeaderCell.Value = "Tên nhà";
            dgvHouseInfor.Columns[2].HeaderCell.Value = "Địa chỉ";
            dgvHouseInfor.Columns[3].HeaderCell.Value = "Mô tả";

            dgvHouseInfor.AllowUserToAddRows = false;
            dgvRoom.AllowUserToAddRows       = false;

            dgvHouseInfor.DefaultCellStyle.WrapMode            = DataGridViewTriState.True;
            dgvHouseInfor.Columns[0].AutoSizeMode              = DataGridViewAutoSizeColumnMode.DisplayedCells;
            dgvHouseInfor.Columns[0].DefaultCellStyle.WrapMode = DataGridViewTriState.True;
        }