Ejemplo n.º 1
0
 public OrderLineDialog(SessionInfo _session, IEnumerable<OrderDetailModel> model)
 {
     InitializeComponent();
     _repo = new SaleOrderRepo();
     _selected = new OrderDetailModel();
     this.listAll = new List<OrderDetailModel>();
     listAll = model;
     epiSession = _session;
 }
Ejemplo n.º 2
0
        private void butSelect_Click(object sender, EventArgs e)
        {
            if (dgvList.Rows.Count >= 1)
            {
                int iRow = dgvList.CurrentRow.Index;
                string orderID = dgvList.Rows[iRow].Cells["ordernum"].Value.ToString();
                string lineID = dgvList.Rows[iRow].Cells["orderline"].Value.ToString();

                if (!string.IsNullOrEmpty(orderID))
                {
                    _selected = _repo.GetOrderDtlByID(orderID, Convert.ToInt32(lineID));
                    this.Close();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ordDtl"></param>
        /// <param name="lineID"></param>
        /// <returns></returns>
        public IList<CutDesignModel> UpdateCuttingByLine(OrderDetailModel ordDtl, int lineID)
        {
            for (int i = 0; i < CuttingDesign.Count; i++)
            {
                if (CuttingDesign[i].LineID == lineID)
                {
                    CuttingDesign[i].SOLine = ordDtl.OrderLine;
                    CuttingDesign[i].NORNum = ordDtl.NORNo;
                    CuttingDesign[i].CommodityCode = ordDtl.CommodityCode;
                    CuttingDesign[i].SpecCode = ordDtl.SpecCode;
                    CuttingDesign[i].CoatingCode = ordDtl.CoatingCode;
                    CuttingDesign[i].Thick = ordDtl.Thick;
                    CuttingDesign[i].Width = ordDtl.Width;
                    CuttingDesign[i].Length = ordDtl.Length;
                    CuttingDesign[i].SOWeight = ordDtl.SOWeight;
                    CuttingDesign[i].SOQuantity = ordDtl.SOQuantity;
                    CuttingDesign[i].QtyPack = ordDtl.QtyPack;
                    CuttingDesign[i].Pack = ordDtl.Pack;
                    CuttingDesign[i].BussinessType = ordDtl.BussinessType;
                }
            }

            return CuttingDesign;
        }
Ejemplo n.º 4
0
        private IList<CutDesignModel> addSOLine(int lineID, string soNumber)
        {
            string risk = string.Empty;
            string msg = string.Empty;

            //Load data from current selected row to rowData.
            var rowData = (from item in HeaderContent.CuttingDesign
                           where item.LineID == Convert.ToInt32(lineID)
                           select item).FirstOrDefault();

            OrderDetailModel resultLine = new OrderDetailModel();
            IEnumerable<OrderDetailModel> resultParam = new List<OrderDetailModel>();
            SetDirectionPattern();

            resultParam = _repoSale.GetOrderDtlByFilter(soNumber, HeaderContent);
            using (OrderLineDialog frm = new OrderLineDialog(epiSession, resultParam))
            {
                frm.ShowDialog();
                resultLine = frm._selected;
                if (resultLine.OrderNum == null)
                {
                    return HeaderContent.CuttingDesign;
                }
            }

            HeaderContent.ClassID = resultLine.ClassID;
            HeaderContent.Possession = Convert.ToString(resultLine.Possession);
            HeaderContent.BussinessType = resultLine.BussinessType;

            rowData.SONo = soNumber;
            rowData.CustID = resultLine.CustID;
            rowData.SOLine = resultLine.OrderLine;
            rowData.NORNum = resultLine.NORNo;
            rowData.CommodityCode = resultLine.CommodityCode;
            rowData.SpecCode = resultLine.SpecCode;
            rowData.CoatingCode = resultLine.CoatingCode;
            rowData.Thick = resultLine.Thick;
            rowData.Width = resultLine.Width;
            rowData.Length = resultLine.Length;
            rowData.Status = "";
            rowData.SOWeight = resultLine.SOWeight;
            rowData.SOQuantity = resultLine.SOQuantity;
            rowData.QtyPack = resultLine.QtyPack;
            rowData.Pack = resultLine.Pack;
            rowData.BussinessType = resultLine.BussinessType;
            rowData.CompleteRow = rowData.ValidateByRow(HeaderContent, out risk, out msg);
            return _repo.SaveLineCutting(epiSession, HeaderContent, rowData).ToList();
        }