Beispiel #1
0
        public long SaveDomesticIns(DomesticModel objDomesticIns)
        {
            long returnCode = -1;

            using (TransactionScope transactionScope = new TransactionScope())
            {
                try
                {
                    returnCode = objMotorAppDAL.SaveDomesticIns(objDomesticIns);
                    transactionScope.Complete();
                    transactionScope.Dispose();
                }
                catch (Exception ex)
                {
                    transactionScope.Dispose();
                    throw ex;
                }

                return(returnCode);
            }
        }
        public DataTable ConvertToDomestic(DomesticModel _objDomesticIns)
        {
            try
            {
                DataTable _dt = new DataTable();
                _dt.Columns.Add("DraftNo", typeof(string));
                _dt.Columns.Add("PolicyNo", typeof(string));
                _dt.Columns.Add("IssueDate", typeof(DateTime));
                _dt.Columns.Add("Branch", typeof(string));
                _dt.Columns.Add("PolicyStartDate", typeof(DateTime));
                _dt.Columns.Add("PolicyEndDate", typeof(DateTime));
                _dt.Columns.Add("NoofYears", typeof(int));
                _dt.Columns.Add("Marketer", typeof(string));
                _dt.Columns.Add("Broker_AgentCode", typeof(string));
                _dt.Columns.Add("IssueFrom", typeof(string));
                _dt.Columns.Add("SpecialDiscount", typeof(string));
                _dt.Columns.Add("Amount", typeof(long));
                _dt.Columns.Add("AssuredName", typeof(string));
                _dt.Columns.Add("AssuredName_Arabic", typeof(string));
                _dt.Columns.Add("CivilID", typeof(long));
                _dt.Columns.Add("PostBox", typeof(long));
                _dt.Columns.Add("PostalCode", typeof(long));
                _dt.Columns.Add("City", typeof(string));
                _dt.Columns.Add("ResPhoneNo", typeof(long));
                _dt.Columns.Add("OfficePhoneNo", typeof(long));
                _dt.Columns.Add("MobileNo", typeof(long));
                _dt.Columns.Add("HelperProfession", typeof(string));
                _dt.Columns.Add("Gender", typeof(string));
                _dt.Columns.Add("DateofBirth", typeof(DateTime));
                _dt.Columns.Add("Age", typeof(int));
                _dt.Columns.Add("PassportNo", typeof(long));
                _dt.Columns.Add("Nationality", typeof(string));
                _dt.Columns.Add("MazayaCard", typeof(string));
                _dt.Columns.Add("SameasHouseMaidAddress", typeof(string));
                _dt.Columns.Add("Sponsor_ProposerName", typeof(string));
                _dt.Columns.Add("SponsorPostBox", typeof(long));
                _dt.Columns.Add("SponsorPostalCode", typeof(long));
                _dt.Columns.Add("SponsorCity", typeof(string));
                _dt.Columns.Add("SponsorMobileNo", typeof(long));
                _dt.Columns.Add("SponsorOfficePhone", typeof(long));
                _dt.Columns.Add("SponsorNationality", typeof(string));
                _dt.Columns.Add("VIPCustomer", typeof(string));
                _dt.Columns.Add("Email", typeof(string));

                DataRow _dr;
                _dr = _dt.NewRow();

                _dr["DraftNo"]            = _objDomesticIns.DraftNo;
                _dr["PolicyNo"]           = _objDomesticIns.PolicyNo;
                _dr["IssueDate"]          = _objDomesticIns.IssueDate;
                _dr["Branch"]             = _objDomesticIns.Branch;
                _dr["PolicyStartDate"]    = _objDomesticIns.PolicyStartDate;
                _dr["PolicyEndDate"]      = _objDomesticIns.PolicyEndDate;
                _dr["NoofYears"]          = _objDomesticIns.NoofYears;
                _dr["Marketer"]           = _objDomesticIns.Marketer;
                _dr["Broker_AgentCode"]   = _objDomesticIns.Broker_AgentCode;
                _dr["IssueFrom"]          = _objDomesticIns.IssueFrom;
                _dr["SpecialDiscount"]    = _objDomesticIns.SpecialDiscount;
                _dr["Amount"]             = _objDomesticIns.Amount;
                _dr["AssuredName"]        = _objDomesticIns.AssuredName;
                _dr["AssuredName_Arabic"] = _objDomesticIns.AssuredName_Arabic;
                _dr["CivilID"]            = _objDomesticIns.CivilID;
                _dr["PostBox"]            = _objDomesticIns.PostBox;
                _dr["PostalCode"]         = _objDomesticIns.PostalCode;
                _dr["City"]             = _objDomesticIns.City;
                _dr["ResPhoneNo"]       = _objDomesticIns.ResPhoneNo;
                _dr["OfficePhoneNo"]    = _objDomesticIns.OfficePhoneNo;
                _dr["MobileNo"]         = _objDomesticIns.MobileNo;
                _dr["HelperProfession"] = _objDomesticIns.HelperProfession;
                _dr["Gender"]           = _objDomesticIns.Gender;
                _dr["DateofBirth"]      = _objDomesticIns.DateofBirth;
                _dr["Age"]                    = _objDomesticIns.Age;
                _dr["PassportNo"]             = _objDomesticIns.PassportNo;
                _dr["Nationality"]            = _objDomesticIns.Nationality;
                _dr["MazayaCard"]             = _objDomesticIns.MazayaCard;
                _dr["SameasHouseMaidAddress"] = _objDomesticIns.SameasHouseMaidAddress;
                _dr["Sponsor_ProposerName"]   = _objDomesticIns.Sponsor_ProposerName;
                _dr["SponsorPostBox"]         = _objDomesticIns.SponsorPostBox;
                _dr["SponsorPostalCode"]      = _objDomesticIns.SponsorPostalCode;
                _dr["SponsorCity"]            = _objDomesticIns.SponsorCity;
                _dr["SponsorMobileNo"]        = _objDomesticIns.SponsorMobileNo;
                _dr["SponsorOfficePhone"]     = _objDomesticIns.SponsorOfficePhone;
                _dr["SponsorNationality"]     = _objDomesticIns.SponsorNationality;
                _dr["VIPCustomer"]            = _objDomesticIns.VIPCustomer;
                _dr["Email"]                  = _objDomesticIns.Email;



                _dt.Rows.Add(_dr);
                return(_dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }