private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (this.dataGridView1.CurrentCell.OwningColumn.Name != Column5.Name) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } Business.Models.SalesOrderModelForSalesOrderReturn r = this.dataGridView1.Rows[e.RowIndex].DataBoundItem as Business.Models.SalesOrderModelForSalesOrderReturn; Models.OutInventory[] outin = this.PharmacyDatabaseService.GetOutInventoryByOrderID(out msg, r.Id); Models.OutInventory outInv = outin.First(); if (outin.Count() > 1) { outInv.SalesOutInventoryDetails.Clear(); foreach (var c in outin) { foreach (var d in c.SalesOutInventoryDetails) { outInv.SalesOutInventoryDetails.Add(d); } } } FormSalesOrderReturn form = new FormSalesOrderReturn(outInv); form.ShowDialog(); }
public System.Collections.Generic.IEnumerable <Business.Models.OutInventoryMode> GetOutInventorySpecialDrugs(Models.OutInventory outInve) { string specialDrug = string.Empty; var c = from i in outInve.SalesOutInventoryDetails join j in RepositoryProvider.Db.DrugInventoryRecords on i.DrugInventoryRecordID equals j.Id join k in RepositoryProvider.Db.DrugInfos on j.DrugInfoId equals k.Id where k.IsSpecialDrugCategory select new Business.Models.OutInventoryMode { productName = i.productName, BatchNumber = j.BatchNumber, FactoryName = i.FactoryName, SpecificationCode = k.DictionarySpecificationCode }; return(c); }
public System.Collections.Generic.IEnumerable <Business.Models.OutInventoryMode> GetOutInventorySpecialDrugs(Models.OutInventory outInve) { var c = from i in RepositoryProvider.OutInventoryRepository.Queryable join d in RepositoryProvider.OutInventoryDetailRepository.Queryable on i.Id equals d.SalesOutInventoryID join j in RepositoryProvider.Db.DrugInventoryRecords on d.DrugInventoryRecordID equals j.Id join k in RepositoryProvider.Db.DrugInfos on j.DrugInfoId equals k.Id where k.IsSpecialDrugCategory && i.Id == outInve.Id select new Business.Models.OutInventoryMode { productName = d.productName, BatchNumber = j.BatchNumber, FactoryName = d.FactoryName, SpecificationCode = k.DictionarySpecificationCode }; return(c); }