/// <summary> /// This method will check the status of an item. /// </summary> protected void btnCheckStatus_Click(object sender, EventArgs e) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); showItemList.DataSource = objBLL.CheckStatusOfInventory(Convert.ToInt32(ddlCategory.SelectedValue)); showItemList.DataBind(); }
protected void DataBind() { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvReportCategoryWise.DataSource = objBLL.GenerateCategoryWiseReport(); gvReportCategoryWise.DataBind(); }
/// <summary> /// This is the page load method of ViewReportOfItemNotAvailable page /// </summary> protected void Page_Load(object sender, EventArgs e) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvItemDetailList.DataSource = objBLL.ViewRportGeneratedBySP(); gvItemDetailList.DataBind(); }
protected void DataBind() { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvCrossCheck.DataSource = objBLL.CrossCheckInventoryWithSales(); gvCrossCheck.DataBind(); }
/// <summary> /// Function to bind the data. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void DataBind() { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvVendorDetailList.DataSource = objBLL.GetVendorDetails(); gvVendorDetailList.DataBind(); }
protected void PricewiseDataBind() { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvPriceWiseReport.DataSource = objBLL.GeneratePriceWiseReport(); gvPriceWiseReport.DataBind(); }
/// <summary> /// This method will bind the data. /// </summary> protected void DataBind() { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvItemDetailList.DataSource = objBLL.ViewRportGeneratedBySP(); gvItemDetailList.DataBind(); }
/// <summary> /// This is the page load method for report price wise. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvPriceWiseReport.DataSource = objBLL.GeneratePriceWiseReport(); gvPriceWiseReport.DataBind(); } }
{ /// <summary> /// This is the page load method for view vendor list. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvVendorDetailList.DataSource = objBLL.GetVendorDetails(); gvVendorDetailList.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvCrossCheck.DataSource = objBLL.CrossCheckInventoryWithSales(); gvCrossCheck.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); gvItemDetailList.DataSource = objBLL.ViewRportGeneratedBySP(); gvItemDetailList.DataBind(); lblDisplayDate.Text = (date).ToString(); ItemList.Clear(); } }
/// <summary> /// This is the page load for Check status of an items /// </summary> protected void Page_Load(object sender, EventArgs e) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); List <IItemCategory> itemList = objBLL.GetItemCategory(); if (!IsPostBack) { ddlCategory.DataSource = itemList; ddlCategory.DataTextField = "CategoryName"; ddlCategory.DataValueField = "CategoryID"; ddlCategory.DataBind(); } }
/// <summary> /// This method will bind the gridview /// </summary> protected void OnGridViewDataBinding(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //skip header row { IItem objItem = (IItem)e.Row.DataItem; IInventoryManagerBLL objInventoryManagerBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); List <IVendor> objVendorColl = objInventoryManagerBLL.GetVendorDetailsCategoryWise(objItem.ItemCategory); DropDownList drpVendor = (DropDownList)e.Row.FindControl("ddlVendor"); if (drpVendor != null) { drpVendor.DataSource = objVendorColl; drpVendor.DataTextField = "NameOfContactPerson"; drpVendor.DataValueField = "VendorId"; drpVendor.DataBind(); } } }
/// <summary> /// Function to delete a vendor. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btndelVendor_Click(object sender, EventArgs e) { bool isDeleted = false; IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); try { bool isVendorSelected = false; List <int> selectedItemList1 = new List <int>(); //loop through the grid to find the selected item for (int i = 0; i < gvVendorDetailList.Rows.Count; i++) { GridViewRow gvVendorRow = gvVendorDetailList.Rows[i]; isVendorSelected = ((CheckBox)gvVendorRow.FindControl("chkVendorID")).Checked; if (isVendorSelected) { selectedItemList1.Add(Convert.ToInt32(gvVendorDetailList.Rows[i].Cells[1].Text)); } } isDeleted = objBLL.DeleteVendor(selectedItemList1); gvVendorDetailList.DataSource = objBLL.GetVendorDetails(); gvVendorDetailList.DataBind(); if (isDeleted) { lblMessage.Text = "Deleted Successfully"; lblMessage.Visible = true; } } catch (Exception ex) { lblMessage.Text = ex.Message; } }
/// <summary> /// This method displays highest and lowest rolling item /// </summary> protected void btnSubmit_Click(object sender, EventArgs e) { frm = Convert.ToDateTime(txtFrom.Text); to = Convert.ToDateTime(txtTo.Text); //if (!IsPostBack) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); List <IHRLR> hrl = new List <IHRLR>(); List <IHRLR> lrl = new List <IHRLR>(); if (to < frm) { lblMessage.Text = "End Date cannot be greater than From Date."; } else { lblHigh.Visible = true; lblLow.Visible = true; hrl = objBLL.GetHighestAndLowestRollingItems(frm, to, out lrl); gvHighestRolling.DataSource = hrl; gvHighestRolling.DataBind(); gvLowestRolling.DataSource = lrl; gvLowestRolling.DataBind(); if (hrl.Count == 0) { lblMessage.Text = "No Items to Display "; } } } }
protected void Page_Load(object sender, EventArgs e) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); IItemCategory objcategory1 = ItemCategotyBOFactory.CreateItemCategoryObject(); //List<IVendor> vendorList = objBLL.GetVendorDetails(); List <IItemCategory> cateogies = new List <IItemCategory>(); int vendorid = Convert.ToInt32(Request.QueryString["VendorID"]); if (!IsPostBack) { cateogies = objBLL.GetItemCategory(); chkVendorItemCategory.DataSource = cateogies; chkVendorItemCategory.DataTextField = "CategoryName"; chkVendorItemCategory.DataValueField = "CategoryID"; chkVendorItemCategory.DataBind(); if (vendorid != 0)//update { IVendor objVendor = VendorBOFactory.CreateVendorObject(); objVendor = objBLL.GetVendorByVendorId(vendorid); lblMessage2.Text = "Vendor Id is:" + objVendor.VendorId; vendorid = Convert.ToInt32(Request.QueryString["VendorID"]); objVendor.VendorId = vendorid; txtOrganization.Text = Convert.ToString(objVendor.NameOfOrganisation); objVendor.CategoryList = objBLL.getVendorCategoryList(objVendor.VendorId); for (int i = 0; i < chkVendorItemCategory.Items.Count; i++) { int categoryId = objVendor.CategoryList.Find(delegate(int cID) { return(cID == Convert.ToInt32(chkVendorItemCategory.Items[i].Value)); }); if (categoryId != 0) { chkVendorItemCategory.Items[i].Selected = true; } } chkVendorItemCategory.SelectedValue = Convert.ToString(objVendor.CategoryList); txtName.Text = Convert.ToString(objVendor.NameOfContactPerson); txtAddress.Text = Convert.ToString(objVendor.Address); txtEmail.Text = Convert.ToString(objVendor.EmailId); ddlState.SelectedItem.Text = Convert.ToString(objVendor.State); ddlState_SelectedIndexChanged(sender, e); ddlCity.SelectedItem.Text = Convert.ToString(objVendor.City); txtContact.Text = Convert.ToString(objVendor.ContactNumber); ddlType.SelectedItem.Text = Convert.ToString(objVendor.VendorType); } else//add { chkVendorItemCategory.SelectedValue = Convert.ToString(objVendor.CategoryList); txtOrganization.Text = Convert.ToString(objVendor.NameOfOrganisation); txtName.Text = Convert.ToString(objVendor.NameOfContactPerson); txtAddress.Text = Convert.ToString(objVendor.Address); txtEmail.Text = Convert.ToString(objVendor.EmailId); ddlState.SelectedValue = Convert.ToString(objVendor.State); ddlCity.SelectedValue = Convert.ToString(objVendor.City); txtContact.Text = Convert.ToString(objVendor.ContactNumber); ddlType.SelectedValue = Convert.ToString(objVendor.VendorType); } } }
/// <summary> /// This method displays the non available item details based on category in the database /// </summary> protected void btnAddCart_Click(object sender, EventArgs e) { IInventoryManagerBLL objBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); bool isSelected = false; List <IItem> selectedItemList = new List <IItem>(); List <int> selectedCat = new List <int>(); for (int i = 0; i < gvItemDetailList.Rows.Count; i++) { GridViewRow gvItemRow = gvItemDetailList.Rows[i]; isSelected = ((CheckBox)gvItemRow.FindControl("chkItemID")).Checked; if (isSelected) { IItem billItem = ViewItemBOFactory.CreateItemobject(); billItem.ItemID = Convert.ToInt32(gvItemRow.Cells[1].Text); billItem.ItemName = (gvItemRow.Cells[2].Text); billItem.ItemPrice = Convert.ToDouble(gvItemRow.Cells[4].Text); billItem.ItemCategory = Convert.ToInt32(gvItemRow.Cells[3].Text); //vendorListForDDL.Add(objBLL.GetVendorDetailsCategoryWise(billItem.ItemCategory)); selectedItemList.Add(billItem); } } foreach (IItem item in selectedItemList) { IItem items = ItemList.Find(x => (x.ItemID == item.ItemID)); if (ItemList.Contains(items)) { lblMessage.Visible = true; lblMessage.Text = "Item Already Selected"; continue; } else { lblMessage.Visible = false; ItemList.Add(item); } } gvShowItems.DataSource = ItemList; gvShowItems.DataBind(); // gvshowItems.Controls.AddAt(5, ); btnPlaceOrder.Visible = true; btnReset.Visible = true; btnDelete.Visible = true; btnCalcAmnt.Visible = true; btnCancel.Visible = true; if (gvShowItems.Rows.Count == 0) { btnPlaceOrder.Visible = false; btnReset.Visible = false; btnDelete.Visible = false; btnCalcAmnt.Visible = false; btnCancel.Visible = false; lblMessage.Visible = true; lblMessage.Text = "No Items Available"; } }
/// <summary> /// This method will place an order for the selected item. /// </summary> protected void btnPlaceOrder_Click(object sender, EventArgs e) { IInventoryManagerBLL objInventoryManagerBLL = InventoryManagerBLLFactory.CreateInventoryManagerBLLObject(); // Iorder objOrder = BOFactory.OrderBOFactory.CreateOrderObject(); //for (int j = 0; j < gvshowItems.Rows.Count; j++) //objOrder.OrderDate = date; bool isPlaced = false; List <Iorder> lstOrders = new List <Iorder>(); List <IOrderedItems> lstOrderItems = new List <IOrderedItems>(); try { for (int i = 0; i < gvShowItems.Rows.Count; i++) { GridViewRow gvEmployeeRow = gvShowItems.Rows[i]; Iorder objOrders = OrderBOFactory.CreateOrderObject(); objOrders.VendorId = Convert.ToInt32(((DropDownList)gvEmployeeRow.FindControl("ddlVendor")).SelectedItem.Value); //objOrders.OrderDate = (gvEmployeeRow.Cells[2].Text); objOrders.OrderDate = date; //objOrders. = (gvEmployeeRow.Cells[3].Text); //objEmployee.MobileNumber = Convert.ToInt64(gvEmployeeRow.Cells[5].Text); lstOrders.Add(objOrders); } for (int i = 0; i < gvShowItems.Rows.Count; i++) { GridViewRow gvEmployeeRow = gvShowItems.Rows[i]; IOrderedItems objOrderItems = OrderedItemsBOFactory.CreateOrderedItemsObject(); objOrderItems.ItemCategory = Convert.ToInt32(gvEmployeeRow.Cells[3].Text); objOrderItems.ItemId = Convert.ToInt32(gvEmployeeRow.Cells[1].Text); objOrderItems.ItemName = gvEmployeeRow.Cells[2].Text; objOrderItems.ItemQuantity = Convert.ToInt32(((TextBox)gvEmployeeRow.FindControl("txtOrderQuantity")).Text); //objOrders. = (gvEmployeeRow.Cells[3].Text); //objEmployee.MobileNumber = Convert.ToInt64(gvEmployeeRow.Cells[5].Text); lstOrderItems.Add(objOrderItems); } isPlaced = objInventoryManagerBLL.PlaceOrder(lstOrders, lstOrderItems); if (isPlaced) { LabelMessage.Visible = true; LabelMessage.Text = "Ordered Placed Successfully"; } //List<Iorder> list = new List<Iorder>(); //list = lstOrders.Distinct().ToList(); //for (int i = 0; i < list.Count;i++ ) //{ // List<IOrderedItems> orderList = new List<IOrderedItems>(); // foreach (IOrderedItems item in lstOrderItems) // { // } //} //objEmployee.RoleId =Convert.ToInt32(ddlNewRole.SelectedValue); } catch (Exception ex) { lblMessage.Text = "An error occurred while updating Employee details"; } finally { //objOrder = null; objInventoryManagerBLL = null; } }