示例#1
0
        public DeliveryAddressModel.CustAddressDetailsList AddressDairy(string custid)
        {
            DeliveryAddressModel.CustAddressDetailsList Objlistaddr = new DeliveryAddressModel.CustAddressDetailsList();
            try
            {
                string Insertdata = "select (select Tagname from TagMaster where TagMaster.Id=CustomerAddress.TagId) as Tagname,(Select StateName from StateMaster where StateMaster.Id=CustomerAddress.StateId) as statename,(Select CountryName from CountryMaster where CountryMaster.Id=CustomerAddress.CountryId) as CountryName,(Select CityName from CityMaster where CityMaster.Id=CustomerAddress.CityId) as CityName,* from CustomerAddress where IsActive=1 and IsDeleted=0 ";

                DataTable dtdata = dbc.GetDataTable(Insertdata);

                if (dtdata != null && dtdata.Rows.Count > 0)
                {
                    Objlistaddr.Response        = CommonString.successresponse;
                    Objlistaddr.Message         = CommonString.successmessage;
                    Objlistaddr.CustAddressList = new List <DeliveryAddressModel.CustAddressDataList>();

                    for (int i = 0; i < dtdata.Rows.Count; i++)
                    {
                        string custid1  = (dtdata.Rows[i]["CustomerId"] != null ? dtdata.Rows[i]["CustomerId"].ToString() : "");
                        string fnaem1   = (dtdata.Rows[i]["FirstName"] != null ? dtdata.Rows[i]["FirstName"].ToString() : "");
                        string lname1   = "";// dtdata.Rows[i]["LastName"].ToString();
                        string tagname1 = (dtdata.Rows[i]["Tagname"] != null ? dtdata.Rows[i]["Tagname"].ToString() : "");
                        string country1 = (dtdata.Rows[i]["CountryName"] != null ? dtdata.Rows[i]["CountryName"].ToString() : "");
                        string state1   = (dtdata.Rows[i]["statename"] != null ? dtdata.Rows[i]["statename"].ToString() : "");
                        string city1    = (dtdata.Rows[i]["CityName"] != null ? dtdata.Rows[i]["CityName"].ToString() : "");
                        string addr1    = (dtdata.Rows[i]["Address"] != null ? dtdata.Rows[i]["Address"].ToString() : "");
                        string mob1     = (dtdata.Rows[i]["MobileNo"] != null ? dtdata.Rows[i]["MobileNo"].ToString() : "");
                        string pin1     = (dtdata.Rows[i]["PinCode"] != null ? dtdata.Rows[i]["PinCode"].ToString() : "");

                        Objlistaddr.CustAddressList.Add(new DeliveryAddressModel.CustAddressDataList
                        {
                            Custid      = custid1,
                            fname       = fnaem1,
                            lname       = lname1,
                            tagname     = tagname1,
                            countryName = country1,
                            statename   = state1,
                            cityname    = city1,
                            addr        = addr1,
                            mob         = mob1,
                            pcode       = pin1
                        });
                    }
                }
                else
                {
                    Objlistaddr.Response = CommonString.DataNotFoundResponse;
                    Objlistaddr.Message  = CommonString.DataNotFoundMessage;
                }

                return(Objlistaddr);
            }
            catch (Exception ee)
            {
                Objlistaddr.Response = CommonString.Errorresponse;
                Objlistaddr.Message  = ee.StackTrace;
                return(Objlistaddr);
            }
        }
示例#2
0
        public DeliveryAddressModel.CustAddressDetailsList CustomenrInfo(string custid)
        {
            DeliveryAddressModel.CustAddressDetailsList Objlistaddr = new DeliveryAddressModel.CustAddressDetailsList();
            try
            {
                // string Insertdata = "select isnull((select Tagname from TagMaster where TagMaster.Id=CustomerAddress.TagId),'') as Tagname,isnull((Select StateName from StateMaster where StateMaster.Id=CustomerAddress.StateId),'') as statename,isnull((Select CountryName from CountryMaster where CountryMaster.Id=CustomerAddress.CountryId),'') as CountryName,isnull((Select CityName from CityMaster where CityMaster.Id=CustomerAddress.CityId),'') as CityName,* from CustomerAddress where IsActive=1 and IsDeleted=0 and CustomerAddress.CustomerId=" + custid;

                string    Insertdata = "SELECT ISNULL ((SELECT StateName FROM  dbo.StateMaster WHERE (StateMaster.Id = dbo.Customer.StateId)), '') AS statename, ISNULL ((SELECT CityName FROM dbo.CityMaster WHERE (CityMaster.Id = dbo.Customer.CityId)), '') AS CityName, * FROM  dbo.Customer WHERE Customer.Id = " + custid;
                DataTable dtdata     = dbc.GetDataTable(Insertdata);

                if (dtdata != null && dtdata.Rows.Count > 0)
                {
                    Objlistaddr.Response        = CommonString.successresponse;
                    Objlistaddr.Message         = CommonString.successmessage;
                    Objlistaddr.CustAddressList = new List <DeliveryAddressModel.CustAddressDataList>();

                    for (int i = 0; i < dtdata.Rows.Count; i++)
                    {
                        //string custid1 = (dtdata.Rows[i]["CustomerId"] != null ? dtdata.Rows[i]["CustomerId"].ToString() : "");
                        //string fnaem1 = (dtdata.Rows[i]["FirstName"] != null ? dtdata.Rows[i]["FirstName"].ToString() : "");
                        //string lname1 = "";// dtdata.Rows[i]["LastName"].ToString();
                        //string tagname1 = (dtdata.Rows[i]["Tagname"] != null ? dtdata.Rows[i]["Tagname"].ToString() : "");
                        //string country1 = (dtdata.Rows[i]["CountryName"] != null ? dtdata.Rows[i]["CountryName"].ToString() : "");
                        //string state1 = (dtdata.Rows[i]["statename"] != null ? dtdata.Rows[i]["statename"].ToString() : "");
                        //string city1 = (dtdata.Rows[i]["CityName"] != null ? dtdata.Rows[i]["CityName"].ToString() : "");
                        //string addr1 = (dtdata.Rows[i]["Address"] != null ? dtdata.Rows[i]["Address"].ToString() : "");
                        //string mob1 = (dtdata.Rows[i]["MobileNo"] != null ? dtdata.Rows[i]["MobileNo"].ToString() : "");
                        //string pin1 = (dtdata.Rows[i]["PinCode"] != null ? dtdata.Rows[i]["PinCode"].ToString() : "");



                        string custid1 = (dtdata.Rows[i]["Id"] != null ? dtdata.Rows[i]["Id"].ToString() : "");
                        string fnaem1  = (dtdata.Rows[i]["FirstName"] != null ? dtdata.Rows[i]["FirstName"].ToString() : "");
                        string lname1  = (dtdata.Rows[i]["LastName"] != null ? dtdata.Rows[i]["LastName"].ToString() : "");
                        string state1  = (dtdata.Rows[i]["statename"] != null ? dtdata.Rows[i]["statename"].ToString() : "");
                        string city1   = (dtdata.Rows[i]["CityName"] != null ? dtdata.Rows[i]["CityName"].ToString() : "");
                        string addr1   = (dtdata.Rows[i]["Address"] != null ? dtdata.Rows[i]["Address"].ToString() : "");
                        string mob1    = (dtdata.Rows[i]["Mobile"] != null ? dtdata.Rows[i]["Mobile"].ToString() : "");
                        string pin1    = (dtdata.Rows[i]["PinCode"] != null ? dtdata.Rows[i]["PinCode"].ToString() : "");
                        string emailid = (dtdata.Rows[i]["Email"] != null ? dtdata.Rows[i]["Email"].ToString() : "");

                        Objlistaddr.CustAddressList.Add(new DeliveryAddressModel.CustAddressDataList
                        {
                            Custid    = custid1,
                            fname     = fnaem1,
                            lname     = lname1,
                            statename = state1,
                            email     = emailid,
                            cityname  = city1,
                            addr      = addr1,
                            mob       = mob1,
                            pcode     = pin1
                        });
                    }
                }
                else
                {
                    Objlistaddr.Response = CommonString.DataNotFoundResponse;
                    Objlistaddr.Message  = CommonString.DataNotFoundMessage;
                }

                return(Objlistaddr);
            }
            catch (Exception ee)
            {
                Objlistaddr.Response = CommonString.Errorresponse;
                Objlistaddr.Message  = ee.Message;
                return(Objlistaddr);
            }
        }
示例#3
0
        public DeliveryAddressModel.CustAddressDetailsList AddressDairy_V4(string custid)
        {
            DeliveryAddressModel.CustAddressDetailsList Objlistaddr = new DeliveryAddressModel.CustAddressDetailsList();
            try
            {
                string Insertdata = "select isnull((select Tagname from TagMaster where TagMaster.Id=CustomerAddress.TagId),'') as Tagname, " +
                                    " isnull((Select StateName from StateMaster where StateMaster.Id=CustomerAddress.StateId),'') as statename, " +
                                    " isnull((Select Area from ZipCode where ZipCode.Id=CustomerAddress.AreaId),'') as Area, " +
                                    " isnull((Select Building from tblBuilding where tblBuilding.Id=CustomerAddress.BuildingId),'') as Building, " +
                                    " isnull((Select CountryName from CountryMaster where CountryMaster.Id=CustomerAddress.CountryId),'') as CountryName, " +
                                    " isnull((Select CityName from CityMaster where CityMaster.Id=CustomerAddress.CityId),'') as CityName,*" +
                                    " from CustomerAddress where IsActive=1 and IsDeleted=0 and CustomerAddress.CustomerId=" + custid;

                DataTable dtdata = dbc.GetDataTable(Insertdata);
                Objlistaddr.CustAddressList = new List <DeliveryAddressModel.CustAddressDataList>();
                if (dtdata != null && dtdata.Rows.Count > 0)
                {
                    Objlistaddr.Response = CommonString.successresponse;
                    Objlistaddr.Message  = CommonString.successmessage;


                    for (int i = 0; i < dtdata.Rows.Count; i++)
                    {
                        string custaddid   = (dtdata.Rows[i]["Id"] != null ? dtdata.Rows[i]["Id"].ToString() : "");
                        string custid1     = (dtdata.Rows[i]["CustomerId"] != null ? dtdata.Rows[i]["CustomerId"].ToString() : "");
                        string fnaem1      = (dtdata.Rows[i]["FirstName"] != null ? dtdata.Rows[i]["FirstName"].ToString() : "");
                        string lname1      = "";// dtdata.Rows[i]["LastName"].ToString();
                        string tagname1    = (dtdata.Rows[i]["Tagname"] != null ? dtdata.Rows[i]["Tagname"].ToString() : "");
                        string country1    = (dtdata.Rows[i]["CountryName"] != null ? dtdata.Rows[i]["CountryName"].ToString() : "");
                        string state1      = (dtdata.Rows[i]["statename"] != null ? dtdata.Rows[i]["statename"].ToString() : "");
                        string city1       = (dtdata.Rows[i]["CityName"] != null ? dtdata.Rows[i]["CityName"].ToString() : "");
                        string addr1       = (dtdata.Rows[i]["Address"] != null ? dtdata.Rows[i]["Address"].ToString() : "");
                        string mob1        = (dtdata.Rows[i]["MobileNo"] != null ? dtdata.Rows[i]["MobileNo"].ToString() : "");
                        string email       = (dtdata.Rows[i]["Email"] != null ? dtdata.Rows[i]["Email"].ToString() : "");
                        string pin1        = (dtdata.Rows[i]["PinCode"] != null ? dtdata.Rows[i]["PinCode"].ToString() : "");
                        string buildingId  = (dtdata.Rows[i]["BuildingId"] != null ? dtdata.Rows[i]["BuildingId"].ToString() : "");
                        string building    = (dtdata.Rows[i]["Building"] != null ? dtdata.Rows[i]["Building"].ToString() : "");
                        string AreaId      = (dtdata.Rows[i]["AreaId"] != null ? dtdata.Rows[i]["AreaId"].ToString() : "");
                        string Area        = (dtdata.Rows[i]["Area"] != null ? dtdata.Rows[i]["Area"].ToString() : "");
                        string buildingNo  = (dtdata.Rows[i]["BuildingNo"] != null ? dtdata.Rows[i]["BuildingNo"].ToString() : "");
                        string landmark    = (dtdata.Rows[i]["LandMark"] != null ? dtdata.Rows[i]["LandMark"].ToString() : "");
                        string otherdetail = (dtdata.Rows[i]["OtherDetail"] != null ? dtdata.Rows[i]["OtherDetail"].ToString() : "");
                        string stateId     = (dtdata.Rows[i]["Id"] != null ? dtdata.Rows[i]["StateId"].ToString() : "");
                        string cityId      = (dtdata.Rows[i]["Id"] != null ? dtdata.Rows[i]["CityId"].ToString() : "");
                        string countryId   = (dtdata.Rows[i]["Id"] != null ? dtdata.Rows[i]["CountryId"].ToString() : "");
                        ;



                        Objlistaddr.CustAddressList.Add(new DeliveryAddressModel.CustAddressDataList
                        {
                            CustomerAddressId = custaddid,
                            Custid            = custid1,
                            fname             = fnaem1,
                            lname             = lname1,
                            tagname           = tagname1,
                            countryId         = countryId,
                            countryName       = country1,
                            stateId           = stateId,
                            statename         = state1,
                            cityId            = cityId,
                            cityname          = city1,
                            addr        = addr1,
                            email       = email,
                            mob         = mob1,
                            pcode       = pin1,
                            AreaId      = AreaId,
                            Area        = Area,
                            BuildingId  = buildingId,
                            Building    = building,
                            BuildingNo  = buildingNo,
                            LandMark    = landmark,
                            OtherDetail = otherdetail
                        });
                    }
                }
                else
                {
                    Objlistaddr.Response = CommonString.DataNotFoundResponse;
                    Objlistaddr.Message  = CommonString.DataNotFoundMessage;
                }

                return(Objlistaddr);
            }
            catch (Exception ee)
            {
                Objlistaddr.Response = CommonString.Errorresponse;
                Objlistaddr.Message  = ee.Message;
                return(Objlistaddr);
            }
        }