예제 #1
0
        public void FillOlv(int machineId)
        {
            var objects = _dmr.FilterByMachine(machineId).ToList();

            olvDetails.SetObjects(objects);
            MachineId = machineId;

            if (!objects.Any())
            {
                olvDetails_FormatRow(this, null);
            }
        }
예제 #2
0
        private DataTable GetDataTable(int machineId)
        {
            var dmr = new DetailMachineRepository();

            var dt = new DataTable {
                TableName = "Details"
            };

            dt.Columns.Add("PartNumber", typeof(string));
            dt.Columns.Add("Material", typeof(string));
            dt.Columns.Add("Length", typeof(double));
            dt.Columns.Add("Ps", typeof(double));
            dt.Columns.Add("Machine", typeof(string));
            dt.Columns.Add("Price", typeof(string));
            dt.Columns.Add("Remark", typeof(string));


            foreach (var model in dmr.FilterByMachine(machineId))
            {
                dt.Rows.Add(model.Detail, model.Material, model.Length, model.Qty, model.Machine, model.Price, model.Remark);
            }

            return(dt);
        }