Exemple #1
0
      private void BtnMapToBranchOk_Click(object sender, EventArgs e)
      {
          if (string.IsNullOrEmpty(TxtBranch.Text))
          {
              MessageBox.Show("Branch Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
              TxtBranch.Focus();
              return;
          }
          ProductMappingList ObjProductMappingList = null;

          foreach (DataGridViewRow ro in GridBranch.Rows)
          {
              ObjProductMappingList = new ProductMappingList();
              if (Convert.ToBoolean(ro.Cells[0].Value) == true)
              {
                  ObjProductMappingList.ProductId = Convert.ToInt32(ro.Cells["ProductId"].Value.ToString());
                  ObjProductMappingList.BranchId  = Convert.ToInt32(TxtBranch.Tag.ToString());
                  _objProduct.ModelProductMappingList.Add(ObjProductMappingList);
              }
          }

          _objProduct.SaveProductMapping("Branch");
          MessageBox.Show("Your Data Has Been Updated Successfully !", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
          BranchListForProductMapping();
      }
Exemple #2
0
 private void BtnSearchBranch_Click(object sender, EventArgs e)
 {
     Common.PickList frmPickList = new Common.PickList("Branch", _SearchKey);
     if (Common.PickList.dt.Rows.Count > 0)
     {
         frmPickList.ShowDialog();
         if (frmPickList.SelectedList.Count > 0)
         {
             TxtBranch.Text = frmPickList.SelectedList[0]["BranchName"].ToString().Trim();
             TxtBranch.Tag  = frmPickList.SelectedList[0]["BranchId"].ToString().Trim();
             BranchListForProductMapping();
         }
         frmPickList.Dispose();
     }
     else
     {
         MessageBox.Show("No List Available in Branch !", "Mr. Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
         TxtBranch.Focus();
         return;
     }
     TxtBranch.Focus();
 }