public bool GetISIR(ISIRModel im) { try { var ps = (from p in DB.PRD_MAST join r in DB.PRD_CIREF on p.PART_NO equals r.PART_NO join i in DB.DDCI_INFO on r.CI_REF equals i.CI_REFERENCE join c in DB.DDCUST_MAST on i.CUST_CODE equals c.CUST_CODE where p.PART_NO == im.PART_NO && r.CURRENT_CIREF == true select new { c.CUST_NAME, p.PART_DESC, }).FirstOrDefault(); if (ps != null) { im.CUST_NAME = ps.CUST_NAME; im.DESCRIPTION = ps.PART_DESC; } return(true); } catch (Exception ex) { throw ex.LogException(); } }
public frmISIR(UserInformation userInformation, ISIRModel im) { InitializeComponent(); ISIRViewModel vm = new ISIRViewModel(userInformation, im); this.DataContext = vm; if (vm.CloseAction == null) { vm.CloseAction = new Action(() => this.Close()); } }
public ISIRViewModel(UserInformation userInformation, ISIRModel im) { isir = new ISIRBll(userInformation); Isirmodel = new ISIRModel(); Isirmodel.PART_NO = im.PART_NO; Isirmodel = im; isir.GetISIR(Isirmodel); Isirmodel.DATE = isir.ServerDateTime(); Isirmodel.DATE1 = Isirmodel.DATE.ToFormattedDateAsString(); Isirmodel.NOOFSAMPLE = Convert.ToString(10); #region Event Init this.iSIRPrintCommand = new DelegateCommand(this.ISIRPrintReport); this.iSIRCancelCommand = new DelegateCommand(this.ISIRCancelReport); #endregion }