Пример #1
0
        private void Inventory_ProductSpareMapping_GetById()
        {
            Business.Inventory.ProductMaster objServiceBook = new Business.Inventory.ProductMaster();
            DataTable dt = objServiceBook.ProductSpareMapping_GetById(Business.Common.Context.ProductId, Entity.Inventory.ItemType.Spare);

            gvSpareList.DataSource = dt;
            gvSpareList.DataBind();
        }
        private void LoadProductSpareMapping()
        {
            LoadSpare();
            Business.Inventory.ProductMaster objProductMaster = new Business.Inventory.ProductMaster();
            DataTable dt = objProductMaster.ProductSpareMapping_GetById(long.Parse(ddlProduct.SelectedValue), Entity.Inventory.ItemType.None);

            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    foreach (GridViewRow gvr in gvSpare.Rows)
                    {
                        if (dr["SpareId"].ToString() == gvSpare.DataKeys[gvr.RowIndex].Values[0].ToString())
                        {
                            CheckBox chkMap = (CheckBox)gvr.FindControl("chkMap");
                            chkMap.Checked = true;
                        }
                    }
                }
            }
        }