Ejemplo n.º 1
0
        private void PopulateSelectedAllotment(List <int> spAllotmentID)
        {
            List <int>            lstSPInventory = new List <int>();
            SparePartsAllotmentBL vaBl           = new SparePartsAllotmentBL();
            SparePartsInventoryBL obj            = new SparePartsInventoryBL();
            var allinventory = obj.GetAllSparePartsInventory();
            var filterefInfo = allinventory.Where(i => i.SparePartsInventoryStatusTypeID == 1).ToList();//.Where(x => lstSPInventory.Contains(x.SparePartsInventoryID));

            dgSparePartsInventory.DataSource = filterefInfo;
            foreach (var spaltid in spAllotmentID)
            {
                ComboboxItem item        = new ComboboxItem();
                var          inventoryId = vaBl.GetSPInventoryId(spaltid);
                item.Value = inventoryId;
                var inventorydto = allinventory.Where(x => x.SparePartsInventoryID == inventoryId).FirstOrDefault();
                item.Text = inventorydto.SparePartsModelName;
                lstBoxSPInvlist.Items.Add(item);
            }
        }
        private void PopulateInventorySpareParts(int SparePartsInventoryID)
        {
            SparePartsInventoryBL obj = new SparePartsInventoryBL();
            var          vehInv       = obj.GetAllSparePartsInventory().Where(v => v.SparePartsInventoryID == SparePartsInventoryID).FirstOrDefault();
            ComboboxItem selitem      = new ComboboxItem();

            selitem.Text             = vehInv.SparePartsModelName;
            selitem.Value            = vehInv.SparePartsInfoID;
            ddlModelName.Text        = selitem.Text;
            txtIdentificationNo.Text = vehInv.IdentificationNo;
            txtOtherDescription.Text = vehInv.OtherDescription;
            txtShowRoomPrice.Text    = vehInv.ShowRoomPrice.ToString();
            txtMarginPrice.Text      = vehInv.MarginPrice.ToString();
            //InventoryStatus Populate
            var          vehInvStatus = obj.GetInventoryStatusType().Where(iv => iv.SparePartsInventoryStatusTypeID == vehInv.SparePartsInventoryStatusTypeID).FirstOrDefault();
            ComboboxItem selInvitem   = new ComboboxItem();

            selInvitem.Text           = vehInvStatus.Description;
            selInvitem.Value          = vehInvStatus.SparePartsInventoryStatusTypeID;
            ddlInvStatus.Text         = selInvitem.Text;
            ddlQuantity.SelectedIndex = 0;
        }
Ejemplo n.º 3
0
        private void LoadDefaultValues()
        {
            SparePartsInventoryBL obj = new SparePartsInventoryBL();
            var lst = obj.GetAllSparePartsInventory();

            if (_mode == "ADD")
            {
                lst = lst.Where(i => i.SparePartsInventoryStatusTypeID == 1).ToList();
            }
            dgSparePartsInventory.DataSource = lst;

            //Get All Model Name
            ddlModelName.Items.Clear();
            SparePartsInfoBL obj1 = new SparePartsInfoBL();
            var allVehInfo        = obj1.GetAllSparePartsInfo();

            foreach (var vehInfo in allVehInfo)
            {
                //Load Model Name
                ComboboxItem itemModelName = new ComboboxItem();
                itemModelName.Text  = vehInfo.ModelName;
                itemModelName.Value = vehInfo.SparePartsInfoID;
                ddlModelName.Items.Add(itemModelName);
            }


            //Load Inventory Status
            ddlInventoryStatus.Items.Clear();
            SparePartsInventoryBL obj2 = new SparePartsInventoryBL();

            foreach (var status in obj2.GetInventoryStatusType())
            {
                ComboboxItem itemInventoryStatus = new ComboboxItem();
                itemInventoryStatus.Text  = status.Description;
                itemInventoryStatus.Value = status.SparePartsInventoryStatusTypeID;
                ddlInventoryStatus.Items.Add(itemInventoryStatus);
            }
        }
Ejemplo n.º 4
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //var modelCode = txtModelCode.Text;
            var    modelName       = ddlModelName.SelectedText;
            string inventoryStatus = "";

            if (ddlInventoryStatus.SelectedItem != null)
            {
                inventoryStatus = ddlInventoryStatus.SelectedItem.ToString();
            }
            string identificationNo   = txtIdentificationNo.Text;
            SparePartsInventoryBL obj = new SparePartsInventoryBL();
            var filterefInfo          = obj.GetAllSparePartsInventory()
                                        .Where(
                i => i.SparePartsModelName.ToUpper().Contains(modelName.ToUpper())
                &&
                i.IdentificationNo.ToUpper().Contains(identificationNo.ToUpper())
                &&
                i.SparePartsInventoryStatusName.ToUpper().Contains(inventoryStatus.ToUpper())
                ).ToList();

            dgSparePartsInventory.DataSource = filterefInfo;
        }