private void Populate(DataRow row) { myCardType = new CardType(int.Parse(row["CardTypeId"].ToString())); myCardStatus = new CardStatus(int.Parse(row["CardStatusId"].ToString())); myCardNumber = row["CardNumber"].ToString(); myPIN = row["PIN"].ToString(); myPan = row["PAN"].ToString(); if (row["OrderDate"].ToString().Length > 0) { myOrderDate = DateTime.Parse(row["OrderDate"].ToString()); } if (row["ActivationDate"].ToString().Length > 0) { myActivationDate = DateTime.Parse(row["ActivationDate"].ToString()); } if (row["ExpiryDate"].ToString().Length > 0) { myExpiryDate = DateTime.Parse(row["ExpiryDate"].ToString()); } myEnableFleet = bool.Parse(row["EnableFleet"].ToString()); myEnablePrepaid = bool.Parse(row["EnablePrepaid"].ToString()); myEnableLoyalty = bool.Parse(row["EnableLoyalty"].ToString()); myEnableMembership = bool.Parse(row["EnableMembership"].ToString()); myCeatedBy = row["CardTypeId"].ToString(); myCardId = int.Parse(row["CardId"].ToString()); if (row["MerchantGroupId"].ToString().Length > 0) { myMerchantGroup = new MerchantGroup(int.Parse(row["MerchantGroupId"].ToString())); } if (row["CustomerIssuedToId"].ToString().Length > 0) { myCustomerIssuedToId = int.Parse(row["CustomerIssuedToId"].ToString()); } if (row["CustomerGroupId"].ToString().Length > 0) { myCustomerGroupId = int.Parse(row["CustomerGroupId"].ToString()); } if (row["ISONumber"].ToString().Length > 0) { myISONumber = row["ISONumber"].ToString(); } }
private void InitialiseVariables() { myCardType = new CardType(); myCardStatus = new CardStatus(); myCardNumber = string.Empty; myPIN = string.Empty; myPan = string.Empty; myOrderDate = DateTime.Now; myActivationDate = DateTime.Now; myExpiryDate = DateTime.Now; myEnableFleet = false; myEnablePrepaid = false; myEnableLoyalty = false; myEnableMembership = false; myCeatedBy = string.Empty; myCardId = 0; myMerchantGroup = new MerchantGroup(); myCustomerIssuedToId = 0; myCustomerGroupId = 0; myISONumber = string.Empty; myDriverId = 0; }