public static List <Items> GetItems(string prefixText) { List <string> ar = new List <string>(); IItemMaster _iMGR = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); //filling data from database int?consumableItemTypeID = null; if (System.Web.HttpContext.Current.Session["ConsumableTypeID"] != null) { consumableItemTypeID = Convert.ToInt32(System.Web.HttpContext.Current.Session["ConsumableTypeID"].ToString()); } // int.TryParse(System.Web.HttpContext.Current.Session["ConsumableTypeID"].ToString(), out consumableItemTypeID); DataTable dataTable = _iMGR.FindItems(prefixText, null, null, DateTime.Now, false); List <Items> custItem = new List <Items>(); //string[] custItem = new string[dataTable.Rows.Count+1]; int i = 0; foreach (DataRow theRow in dataTable.Rows)//.Select("ItemTypeName <> 'Consumables'")) { Items item = new Items(); item.ItemId = (int)theRow["ItemID"]; item.ItemName = (string)theRow["ItemName"]; custItem.Add(item); } return(custItem); }
public static List <string> SearchConsumableItems(string prefixText, int count) { List <string> ar = new List <string>(); int consumableItemTypeID = -1; int.TryParse(System.Web.HttpContext.Current.Session["ConsumableTypeID"].ToString(), out consumableItemTypeID); DateTime issueDate = DateTime.Now; DateTime.TryParse(System.Web.HttpContext.Current.Session["SelectedDate"].ToString(), out issueDate); int?SCMFlag = null; if (System.Web.HttpContext.Current.Session["SCMModule"] != null) { SCMFlag = 1; } IItemMaster _iMGR = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); //DataTable dataTable = _iMGR.FindItems(prefixText, consumableItemTypeID, null, DateTime.Parse(issueDate.ToString("yyyy-MM-dd")), false); DataTable dataTable = _iMGR.FindItems(prefixText, consumableItemTypeID, null, DateTime.Parse(issueDate.ToString("dd-MMM-yyyy")), false, SCMFlag); //Bug ID 158... string custItem = string.Empty; foreach (DataRow theRow in dataTable.Rows) { custItem = AutoCompleteExtender.CreateAutoCompleteItem(theRow["ItemName"].ToString(), String.Format("{0};{1};{2}", theRow["ItemID"], theRow["ItemTypeID"], theRow["SellingPrice"])); ar.Add(custItem); } return(ar); }
/// <summary> /// Sets the consumable item type identifier. /// </summary> void SetConsumableItemTypeID() { IItemMaster bMgr = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); // IItemMaster bMgr = (IBilling)ObjectFactory.CreateInstance("BusinessProcess.SCM.BBilling,BusinessProcess.SCM"); Session["ConsumableTypeID"] = bMgr.GetItemTypeIDByName("Consumables").ToString(); }
private void btnSave_Click(object sender, EventArgs e) { DataTable theBillableItems = (DataTable)lstSelectedItems.DataSource; if (theBillableItems != null) { // IBilling objProgramlist = (IBilling)ObjectFactory.CreateInstance("BusinessProcess.SCM.BBilling, BusinessProcess.SCM"); IItemMaster objProgramlist = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); objProgramlist.SaveBillablesItems((int)ddlBillable.SelectedValue, GblIQCare.AppUserId, theBillableItems); MessageBox.Show("Saved Successfully.", "IQCare", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Binds the item type dropdown. /// </summary> private void BindItemTypeDropdown() { IQCareUtils theUtils = new IQCareUtils(); ddlItemType.Items.Clear(); IItemMaster objProgramlist = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); //("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM"); DataTable theDT = objProgramlist.GetItemTypes; DataView theDV = new DataView(theDT); theDV.RowFilter = "DeleteFlag= 0 And (ItemName = 'Billables' OR ItemName = 'Consumables' OR ItemName = 'Pharmaceuticals' OR ItemName = 'Lab Tests' OR ItemName = 'Visit Type' OR ItemName= 'Ward Admission' ) "; theDV.Sort = "ItemName Asc"; BindFunctions theBind = new BindFunctions(); theBind.Win_BindCombo(ddlItemType, theDV.ToTable(), "ItemName", "ItemTypeID"); }
/// <summary> /// Populates the type of the item. /// </summary> void PopulateItemType() { try { IItemMaster objProgramlist = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); DataTable theDT = objProgramlist.GetItemTypes; DataView theDV = new DataView(theDT); //theDV.RowFilter = "DeleteFlag= 0 And (ItemName = 'Billables' OR ItemName = 'Consumables' OR ItemName = 'Pharmaceuticals' OR ItemName = 'Lab Tests' OR ItemName = 'Visit Type' OR ItemName= 'Ward Admission' ) "; theDV.RowFilter = "DeleteFlag= 0 And (ItemName = 'Billables' OR ItemName = 'Lab Tests' OR ItemName = 'Visit Type' OR ItemName= 'Ward Admission' ) "; theDV.Sort = "ItemName Asc"; ddlItemType.DataTextField = "ItemName"; ddlItemType.DataValueField = "ItemTypeID"; ddlItemType.DataSource = theDV.ToTable(); ddlItemType.DataBind(); ddlItemType.Items.Insert(0, new ListItem("Select", "-1")); } catch (Exception ex) { this.showErrorMessage(ref ex); } }
public static List <string> SearchItems(string prefixText, int count) { List <string> ar = new List <string>(); IItemMaster itemManager = (IItemMaster)ObjectFactory.CreateInstance("BusinessProcess.Administration.BItemMaster, BusinessProcess.Administration"); //filling data from database int excludeItemID = -1; //exclude billables int.TryParse(System.Web.HttpContext.Current.Session["MainItemType"].ToString(), out excludeItemID); int?filterItemID = null; if (System.Web.HttpContext.Current.Session["SearchContextKey"].ToString() != "") { filterItemID = Convert.ToInt32(System.Web.HttpContext.Current.Session["SearchContextKey"].ToString()); } else { return(ar); } DataTable dataTable = itemManager.FindItems(prefixText, filterItemID, excludeItemID, null, false); string custItem = string.Empty; foreach (DataRow theRow in dataTable.Select("ItemTypeName <> 'Billables'")) // double check to remove billables { custItem = AutoCompleteExtender.CreateAutoCompleteItem(theRow[1].ToString(), String.Format("{0};{1};{2}", theRow["ItemID"], theRow["ItemTypeID"], theRow["ItemTypeName"])); //theRow[0], theRow[2], theRow[3])); ar.Add(custItem); } return(ar); }