示例#1
0
        public string BindingCrew()
        {
            //kamus
            GridRequestParameters param = GridRequestParameters.Current;

            List <Crew> items = RepoCrew.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters);
            int         total = RepoCrew.Count(param.Filters);

            return(new JavaScriptSerializer().Serialize(new { total = total, data = new CrewPresentationStub().MapList(items) }));
        }
示例#2
0
        public ActionResult _GetCrews(int conveyanceInOutId, bool isCrew)
        {
            //สองตัวนี้ไม่ได้ใช้ ส่งไปให้ครบเท่านั้น
            string cName  = "";
            var    ioDate = DateTime.Today;

            //th20110411 vvv เพิ่ม addRemoveCrews เพื่อดึงไป show ในหน้าคนเรือด้วย PD18-540102 Req 8
            IList <AddRemoveCrew> addRemoveCrews = null;

            if (isCrew)
            {
                var convInout = convInOutRepo.GetOne(conveyanceInOutId);
                if (convInout != null)
                {
                    if (convInout.InOutType == ModelConst.CONVINOUT_OUT) //เอาเฉพาะกรณีออกเท่านั้น
                    {
                        addRemoveCrews = convInout.DiffCrew;
                    }
                }
            }
            //th20440411 ^^^
            var esvm = new CrewViewModel(conveyanceInOutId, isCrew, cName, ioDate,
                                         crewRepo.FindAll(conveyanceInOutId, isCrew).ToList(), addRemoveCrews); //th20110411

            return(View(new GridModel(esvm.vmCrews)));
        }
        public ActionResult Create()
        {
            WhitelistFormStub formStub = new WhitelistFormStub();
            List <object>     newList  = new List <object>();

            foreach (var crew in RepoCrew.FindAll())
            {
                newList.Add(
                    new
                {
                    Id   = crew.barcode,
                    Name = crew.barcode + " " + crew.name
                });
            }
            this.ViewBag.Crew = new SelectList(newList, "Name", "Id");

            return(View("Form", formStub));
        }