private CorpClient GetCorpClientItem() { try { CorpClient client = new CorpClient { BranchCode = paramsGridView.Rows[0].Cells[1].Value.ToString(), Rnk = paramsGridView.Rows[1].Cells[1].Value.ToString(), ChangeDate = paramsGridView.Rows[2].Cells[1].Value.ToString(), CreateDate = paramsGridView.Rows[3].Cells[1].Value.ToString(), ClientTypeCode = paramsGridView.Rows[4].Cells[1].Value.ToString(), ClientName = paramsGridView.Rows[5].Cells[1].Value.ToString(), Inn_Edrpou = paramsGridView.Rows[6].Cells[1].Value.ToString(), UserLogin = paramsGridView.Rows[7].Cells[1].Value.ToString(), UserFio = paramsGridView.Rows[8].Cells[1].Value.ToString(), ActualizeDate = paramsGridView.Rows[9].Cells[1].Value.ToString(), ActualizeBy = paramsGridView.Rows[10].Cells[1].Value.ToString(), //ThirdPerson = paramsGridView.Rows[11].Cells[1].Value.ToString() }; //int i = 11; for (int i = 11; i < paramsGridView.Rows.Count; i++) { if (paramsGridView.Rows[i].Cells[2].Value.ToString().StartsWith("LinkedPerson")) { LinkedPerson lk = new LinkedPerson(); lk.Rnk = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; lk.PersonState = paramsGridView.Rows[i].Cells[1].Value.ToString(); client.LinkedPersons.Add(lk); if (i == paramsGridView.Rows.Count) break; } if (paramsGridView.Rows[i].Cells[2].Value.ToString().StartsWith("NoClient")) { var noClient = new NoClient(); noClient.PersonNumber = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; noClient.StateId = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; noClient.FullName = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; noClient.ClientType = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; noClient.Ipn = paramsGridView.Rows[i].Cells[1].Value.ToString(); client.NoClients.Add(noClient); if (i == paramsGridView.Rows.Count) break; } } _userHistory.CurrentItem = client; return client; } catch (Exception ex) { //throw; return null; } }
private Agreement GetAgreementItem() { Agreement agreement = new Agreement(); agreement.AgrCode = paramsGridView.Rows[0].Cells[1].Value.ToString(); agreement.Rnk = paramsGridView.Rows[1].Cells[1].Value.ToString(); agreement.ChangeDate = paramsGridView.Rows[2].Cells[1].Value.ToString(); agreement.CreateDate = paramsGridView.Rows[3].Cells[1].Value.ToString(); agreement.BranchCode = paramsGridView.Rows[4].Cells[1].Value.ToString(); agreement.UserLogin = paramsGridView.Rows[5].Cells[1].Value.ToString(); agreement.UserFio = paramsGridView.Rows[6].Cells[1].Value.ToString(); agreement.AgrTypeCode = paramsGridView.Rows[7].Cells[1].Value.ToString(); agreement.AgrStatusCode = paramsGridView.Rows[8].Cells[1].Value.ToString(); agreement.AgrNumber = paramsGridView.Rows[9].Cells[1].Value.ToString(); agreement.AgrOpenDate = paramsGridView.Rows[10].Cells[1].Value.ToString(); agreement.AccountNumber = paramsGridView.Rows[11].Cells[1].Value.ToString(); agreement.AgrCloseDate = paramsGridView.Rows[12].Cells[1].Value.ToString(); for (int i = 13; i < paramsGridView.Rows.Count; i++) { LinkedPerson lk = new LinkedPerson(); lk.Rnk = paramsGridView.Rows[i].Cells[1].Value.ToString(); i++; lk.PersonState = paramsGridView.Rows[i].Cells[1].Value.ToString(); agreement.LinkedPersons.Add(lk); } _userHistory.CurrentItem = agreement; return agreement; }