コード例 #1
0
      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();
      }
コード例 #2
0
 private void BtnSearchProGroup_Click(object sender, EventArgs e)
 {
     TxtProductSubGroup.Text = "";
     TxtProductSubGroup.Tag  = 0;
     Common.PickList frmPickList = new Common.PickList("ProductGroup", _SearchKey);
     if (Common.PickList.dt.Rows.Count > 0)
     {
         frmPickList.ShowDialog();
         if (frmPickList.SelectedList.Count > 0)
         {
             TxtProGroup.Text = frmPickList.SelectedList[0]["ProductGrpDesc"].ToString().Trim();
             TxtProGroup.Tag  = frmPickList.SelectedList[0]["ProductGrpId"].ToString().Trim();
         }
         frmPickList.Dispose();
     }
     else
     {
         MessageBox.Show("No List Available in Product Group !", "Mr. Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TxtProGroup.Focus();
         return;
     }
     TxtProGroup.Focus();
 }