public CompanyDetailsModel(CompanyDetails companyDetails)
        {
            // TODO: Complete member initialization
            if (companyDetails.ListCompanydetails!=null)
            this.CompanyList = (from b in companyDetails.ListCompanydetails
                                select new CompanyDetailsModel
                                {
                                     Id = b.Id == null ? b.Id : encryptdecrypt.Encrypt(b.Id),
                                     Name = b.Name,
                                     Address = b.Address,
                                     City=b.City,
                                     State = b.State,
                                     Country =b.Country,
                                     Email = b.Email,
                                     Phone = b.Phone,
                                     ContactName = b.ContactName,
                                     ContactEmail =b.ContactEmail,
                                     ContactPhone = b.ContactPhone,
                                     About =b.About,
                                     MarketingCollatrial = b.MarketingCollatrial,
                                     Username = b.Username,
                                     Password = encryptdecrypt.Decrypt(b.Password),
                                     Status=b.Status,
                                     SignUpDate=b.SignUpDate
                                }).ToList();

            this.Id = companyDetails.Id == null ? companyDetails.Id : encryptdecrypt.Encrypt(companyDetails.Id);
            this.Name = companyDetails.Name;
            this.Address = companyDetails.Address;
            this.City=companyDetails.City;
            this.State = companyDetails.State;
            this.Country = companyDetails.Country;
            this.Email = companyDetails.Email;
            this.Phone = companyDetails.Phone;
            this.ContactName = companyDetails.ContactName;
            this.ContactEmail = companyDetails.ContactEmail;
            this.ContactPhone = companyDetails.ContactPhone;
            this.About = companyDetails.About;
            this.MarketingCollatrial = companyDetails.MarketingCollatrial;
            this.Username = companyDetails.Username;
            this.Password = encryptdecrypt.Decrypt(companyDetails.Password);
            this.Status = companyDetails.Status;
            this.SignUpDate = companyDetails.SignUpDate;
        }
        /// <summary>
        /// List All Company
        /// </summary>
        ///<param name="action">showing company basedon action </param>
        /// <param name="id">company id</param>
        /// <returns></returns>
        public CompanyDetails GetCompany(string action,string id)
        {
            var result = new CompanyDetails();
            string[,] str = new string[2, 2];
            str[0, 0] = "@action";
            str[0, 1] = action;
            str[1, 0] = "@id";
            str[1, 1] = id == "" ? id : encryptdecrypt.Decrypt(id);
            string xmlResult = db.StoreprocedureExecuteQueryReturned("usp_Company_GetCompany", str);
            var serializer = new XmlSerializer(typeof(CompanyDetails));
            if (!string.IsNullOrEmpty(xmlResult))
            {
                using (var reader = new StringReader(xmlResult))
                {
                    result = (CompanyDetails)serializer.Deserialize(reader);
                }
            }

            return result;
        }