Example #1
0
        //this is old one code
        //public List<MdlADDRESSS> GetAllAddress()
        //{

        //    var query = _dbFirms.ADDRESSSes.ToList();

        // //   List<MdlADDRESSS> modleobj = new List<MdlADDRESSS>();
        //    //AdressID, OrgDoc_ID, AdressType_ID, AdressDetails, Tehsil_ID, EnterByUser_ID, EntryDate, ModifyByUser_ID, ModifyByDate, IsActive, IsActiveDate
        //    var list = new List<MdlADDRESSS>();
        //    foreach (var item in query)
        //    {
        //        list.Add(new MdlADDRESSS()
        //        {

        //            AdressID=item.AdressID,
        //            OrgDoc_ID=item.OrgDoc_ID,
        //         AdressType_ID = item.AdressType_ID,
        //         AdressDetails = item.AdressDetails,
        //         Tehsil_ID = item.Tehsil_ID,
        //         EnterByUser_ID = item.EnterByUser_ID,
        //         //   EntryDateString = Convert.ToDateTime(item.EntryDate).ToShortDateString(),
        //        // ModifyByUser_ID = int.Parse(item.ModifyByUser_ID.ToString()),
        //        // ModifyByDate =DateTime.Parse(item.ModifyByDate.ToString()),
        //         IsActive = item.IsActive,
        //        // IsActiveDate =DateTime.Parse(item.IsActiveDate.ToString())

        //        });

        //    }
        //    return list;
        //}

        public List <MdlADDRESSS> GetAllAddress(int id)
        {
            var query = _dbFirms.usp_GetAddressesofOrgType(id);
            //   List<MdlADDRESSS> modleobj = new List<MdlADDRESSS>();
            //AdressID, OrgDoc_ID, AdressType_ID, AdressDetails, Tehsil_ID, EnterByUser_ID, EntryDate, ModifyByUser_ID, ModifyByDate, IsActive, IsActiveDate
            var list = new List <MdlADDRESSS>();

            foreach (var item in query)
            {
                list.Add(new MdlADDRESSS()
                {
                    AdressID       = item.AdressID,
                    OrgDoc_ID      = item.OrgDoc_ID,
                    AdressType_ID  = item.AdressType_ID,
                    AdressDetails  = item.AdressDetails,
                    Tehsil_ID      = item.Tehsil_ID,
                    EnterByUser_ID = item.EnterByUser_ID,
                    AdressTypeName = item.AdressTypeName,
                    TehsilName     = item.TehsilName,
                    OrgName        = item.OrgName,
                    UserName       = item.UserName,
                    //   EntryDateString = Convert.ToDateTime(item.EntryDate).ToShortDateString(),
                    // ModifyByUser_ID = int.Parse(item.ModifyByUser_ID.ToString()),
                    // ModifyByDate =DateTime.Parse(item.ModifyByDate.ToString()),
                    IsActive = item.IsActive,
                    // IsActiveDate =DateTime.Parse(item.IsActiveDate.ToString())
                });
            }
            return(list);
        }