public void CarregarAUTHPERPERSON(HzConexao connection, string _cmpIDPERSON) { lstAUTHPERPERSON = new List <tblAUTHPERPERSON>(); DataTable dtAuto = tblAUTHPERPERSON.GETAutorizacaoPessoa(connection, _cmpIDPERSON); for (int i = 0; i < dtAuto.Rows.Count; i++) { tblAUTHPERPERSON autp = new tblAUTHPERPERSON(); autp.cmpAUTHID = dtAuto.Rows[i]["cmpAUTHID"].ToString(); autp.cmpAUTHPERSON = int.Parse(dtAuto.Rows[i]["cmpAUTHPERSON"].ToString()); autp.cmpIDPERSON = int.Parse(dtAuto.Rows[i]["cmpIDPERSON"].ToString()); autp.cmpVALIDFROM = DateTime.Parse(dtAuto.Rows[i]["cmpVALIDFROM"].ToString()); autp.cmpVALIDUNTIL = DateTime.Parse(dtAuto.Rows[i]["cmpVALIDUNTIL"].ToString()); autp.SHORTNAME = dtAuto.Rows[i]["SHORTNAME"].ToString(); lstAUTHPERPERSON.Add(autp); } }
public static List <tblAUTHPERPERSON> GetlstAUTHPERPERSON(HzConexao connection, string _cmpIDPERSON) { List <tblAUTHPERPERSON> lst = new List <tblAUTHPERPERSON>(); DataTable dt = GETAutorizacaoPessoa(connection, _cmpIDPERSON); for (int i = 0; i < dt.Rows.Count; i++) { tblAUTHPERPERSON auto = new tblAUTHPERPERSON(); auto.cmpAUTHID = dt.Rows[0]["cmpAUTHID"].ToString(); auto.cmpAUTHPERSON = int.Parse(dt.Rows[0]["cmpAUTHPERSON"].ToString()); auto.cmpIDPERSON = int.Parse(dt.Rows[0]["cmpIDPERSON"].ToString()); auto.cmpVALIDFROM = DateTime.Parse(dt.Rows[0]["cmpVALIDFROM"].ToString()); auto.cmpVALIDUNTIL = DateTime.Parse(dt.Rows[0]["cmpVALIDUNTIL"].ToString()); auto.SHORTNAME = dt.Rows[0]["SHORTNAME"].ToString(); lst.Add(auto); } return(lst); }