In this class you can have a global variable called _hid.
int _hid = 0;
Its better to initialize it to 0 in the constructor or as you declare it globally.
Then as you are getting the hid in the 1st method just save it to _hid and then use it later.
_hid = hid;
Inside the second method:
<pre lang="cs">for (int i = 0; i < str.Length; i++)
{
model.GroupMemberID = 0;
model.MessageGroupID = _hid;
model.MemberID = Convert.ToInt32(str[i]);
model.MemberType = "test";
dal.InsertUpdate_MessageGroupMembers(model);
}
In the second method maybe have a if statement to check if _hid is 0 and do something with the value.