private void BtnMapToProductSubGroup_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtProGroup.Text)) { MessageBox.Show("Product Group Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtProGroup.Focus(); return; } if (string.IsNullOrEmpty(TxtProductSubGroup.Text)) { MessageBox.Show("Product Sub Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtProductSubGroup.Focus(); return; } ProductMappingList ObjProductMappingList = null; foreach (DataGridViewRow ro in GridProductSubGroup.Rows) { ObjProductMappingList = new ProductMappingList(); if (Convert.ToBoolean(ro.Cells[0].Value) == true) { ObjProductMappingList.ProductId = Convert.ToInt32(ro.Cells["ProductId"].Value.ToString()); ObjProductMappingList.ProductGrpId = Convert.ToInt32(TxtProGroup.Tag.ToString()); ObjProductMappingList.ProductSubGrpId = Convert.ToInt32(TxtProductSubGroup.Tag.ToString()); _objProduct.ModelProductMappingList.Add(ObjProductMappingList); } } _objProduct.SaveProductMapping("ProductSubGroup"); MessageBox.Show("Your Data Has Been Updated Successfully !", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); ProductSubGroupListForProductMapping(); }
private void BtnSearchProductSubGroup_Click(object sender, EventArgs e) { Common.PickList frmPickList = new Common.PickList("ProductSubGroup." + TxtProGroup.Tag, _SearchKey); if (Common.PickList.dt.Rows.Count > 0) { frmPickList.ShowDialog(); if (frmPickList.SelectedList.Count > 0) { TxtProductSubGroup.Text = frmPickList.SelectedList[0]["ProductSubGrpDesc"].ToString().Trim(); TxtProductSubGroup.Tag = frmPickList.SelectedList[0]["ProductSubGrpId"].ToString().Trim(); ProductSubGroupListForProductMapping(); } frmPickList.Dispose(); } else { MessageBox.Show("No List Available in Product Sub Group !", "Mr. Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtProductSubGroup.Focus(); return; } TxtProductSubGroup.Focus(); }