Purs.DataSets.Suppliers_Second_Lists SPDS = new Purs.DataSets.Suppliers_Second_Lists(); var R = M.PO_Masters.Where(c => c.PO_Date.Value.Date >= dateTimePicker1.Value.Date && c.PO_Date.Value.Date <= dateTimePicker2.Value.Date).OrderBy(c => c.PO_ID).Select(c => c.PO_ID).Distinct(); int i = 1; foreach (var item in R) { string FromSub = M.PO_Masters.Where(c => c.PO_ID == item).Single().Supplier.Supplier_Name; string ContactName = M.PO_Masters.Where(c => c.PO_ID == item).Single().Supplier.Supplier_Contact_Name; string Fax = M.PO_Masters.Where(c => c.PO_ID == item).Single().Supplier.Supplier_Fax; string Po_Delivery = M.PO_Masters.Where(c => c.PO_ID == item).Single().PO_Delivery_Date.Value.Date.ToShortDateString(); string Po_Condition = M.PO_Masters.Where(c => c.PO_ID == item).Single().PO_Conditions; string Po_Date = M.PO_Masters.Where(c => c.PO_ID == item).Single().PO_Date.Value.Date.ToShortDateString(); string Pro_No = M.PO_Dets.Where(c => c.PO_ID == item).Single().PO_Product_ID; string Pro_Name = M.PO_Dets.Where(c => c.PO_ID == item).Single().Product_Description.Product_Name; string Unit = M.PO_Dets.Where(c => c.PO_ID == item).Single().Product_Description.Product_Unit; decimal Qty = M.PO_Dets.Where(c => c.PO_ID == item).Single().PO_Qty.Value; decimal Price = M.PO_Dets.Where(c => c.PO_ID == item).Single().PO_Price.Value; object[] MyLine = { Po_Date, FromSub,ContactName,Fax,item,textBox2.Text,Po_Delivery,Po_Condition, i++, Pro_No,Pro_Name,Unit,Qty,Price,Qty * Price, }; SPDS.Tables["Current_PO"].Rows.Add(MyLine); Suppliers_Printing_Form MyForm = new Suppliers_Printing_Form(); MyForm.current_PO1.SetDataSource(SPDS.Tables["Current_PO"]); MyForm.crystalReportViewer1.ReportSource = MyForm.current_PO1; MyForm.crystalReportViewer1.Refresh(); MyForm.Show();i = 1; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)