protected void loadLocalityDetails(String localId)
        {
            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);

                BackEndObjects.City ctObj = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);

                String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                if (cityId.Equals(localId))
                {
                    ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                }

                String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                if (stateId.Equals(localId))
                {
                    stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                }

                if (cntObj != null && cntObj.getCountryName() != null && !cntObj.getCountryName().Equals(""))
                {
                    Label_Country.Text = cntObj.getCountryName();
                }

                if (stObj != null && stObj.getStateName() != null && !stObj.getStateName().Equals(""))
                {
                    Label_State.Text = stObj.getStateName();
                }

                if (ctObj != null && ctObj.getCityName() != null && !ctObj.getCityName().Equals(""))
                {
                    Label_City.Text = ctObj.getCityName();
                }

                if (lclObj != null && lclObj.getLocalityName() != null && !lclObj.getLocalityName().Equals(""))
                {
                    Label_Locality.Text = lclObj.getLocalityName();
                }
            }
        }
        protected void populateChainData(userDetails udObj)
        {
            if (udObj.getSubEntityId() != null && !udObj.getSubEntityId().Equals(""))
            {
                BackEndObjects.subBusinessEntity subObj = BackEndObjects.subBusinessEntity.getSubBusinessEntitybyIdDB(udObj.getSubEntityId());
                Label_Chain_Name.Text    = subObj.getSubEntityName();
                Label_Chain_Email.Text   = subObj.getSubEmailId();
                Label_Chain_Contact.Text = subObj.getSubPhNo();
                Label_Chain_Regstr.Text  = subObj.getSubRegstrNo();
                Label_Addr1.Text         = subObj.getAddrLine1();

                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(subObj.getLocalityId());
                BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(subObj.getLocalityId());
                BackEndObjects.State      stObj  = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(ctObj.getCityId());
                BackEndObjects.Country    cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stObj.getStateId());

                Label_Country.Text  = cntObj.getCountryName();
                Label_State.Text    = stObj.getStateName();
                Label_City.Text     = ctObj.getCityName();
                Label_Locality.Text = lclObj.getLocalityName();
            }
        }
Exemple #3
0
        protected void fillCustData()
        {
            String[] entId = Request.QueryString.GetValues("entityId");

            Panel_Customer.GroupingText = "Entity Details";

            Dictionary <String, Object> custObj = ActionLibrary.customerDetails.getContactDetails(entId[0], Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            String localId = "";


            if (custObj.ContainsKey(ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS))
            {
                BackEndObjects.Contacts cOBJ = (BackEndObjects.Contacts)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS];
                Label_Cust_Name.Text  = cOBJ.getContactName();
                Label_Email.Text      = cOBJ.getEmailId();
                Label_Contact_No.Text = cOBJ.getMobNo();
                Label_From_Site.Text  = cOBJ.getFromSite();
                localId = cOBJ.getLocalityId();

                //If the contact object is created from the site then get the Main proudct details
                if (cOBJ.getFromSite().Equals("Y"))
                {
                    Dictionary <String, BackEndObjects.ProductCategory> mainProds = BackEndObjects.MainBusinessEntity.getProductDetailsforMainEntitybyIdDB(cOBJ.getContactEntityId());
                    String mainProdList = "";

                    foreach (KeyValuePair <String, BackEndObjects.ProductCategory> kvp in mainProds)
                    {
                        mainProdList = (mainProdList.Equals("") ? ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName() : mainProdList +
                                        "," + ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName());
                    }

                    Label_Main_Business.Text = (!mainProdList.Equals("") ? mainProdList : Label_Main_Business.Text);
                }
            }
            else
            {
                BackEndObjects.MainBusinessEntity mBObj = (BackEndObjects.MainBusinessEntity)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_MAIN_BUSINESS_ENTITY];
                Label_Cust_Name.Text  = mBObj.getEntityName();
                Label_Email.Text      = mBObj.getEmailId();
                Label_Contact_No.Text = mBObj.getPhNo();
                Label_From_Site.Text  = "Y";

                Dictionary <String, BackEndObjects.ProductCategory> mainProds = mBObj.getMainProductServices();
                //BackEndObjects.MainBusinessEntity.getProductDetailsforMainEntitybyIdDB(mBObj.getEntityId());
                String mainProdList = "";

                if (mainProds != null)
                {
                    foreach (KeyValuePair <String, BackEndObjects.ProductCategory> kvp in mainProds)
                    {
                        mainProdList = (mainProdList.Equals("") ? ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName() : mainProdList + "," + ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName());
                    }
                }

                Label_Main_Business.Text = (!mainProdList.Equals("") ? mainProdList : Label_Main_Business.Text);
                if (mBObj.getAddressDetails() != null)
                {
                    localId = mBObj.getAddressDetails().getLocalityId();
                }
            }

            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
                BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
                BackEndObjects.State      stObj  = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(ctObj.getCityId());
                BackEndObjects.Country    cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stObj.getStateId());

                Label_Country.Text  = cntObj.getCountryName();
                Label_State.Text    = stObj.getStateName();
                Label_City.Text     = ctObj.getCityName();
                Label_Locality.Text = lclObj.getLocalityName();
            }
        }
Exemple #4
0
        protected void fillCustData()
        {
            Dictionary <String, Object> custObj = (Dictionary <String, Object>)Session[SessionFactory.ALL_SALE_ALL_POTENTIAL_SELECTED_CUSTOMER_OBJ];
            String localId = "";


            if (custObj.ContainsKey(ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS))
            {
                BackEndObjects.Contacts cOBJ = (BackEndObjects.Contacts)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS];
                Label_Cust_Name.Text  = cOBJ.getContactName();
                Label_Email.Text      = cOBJ.getEmailId();
                Label_Contact_No.Text = cOBJ.getMobNo();
                Label_From_Site.Text  = cOBJ.getFromSite();
                localId = cOBJ.getLocalityId();

                //If the contact object is created from the site then get the Main proudct details
                if (cOBJ.getFromSite().Equals("Y"))
                {
                    Dictionary <String, BackEndObjects.ProductCategory> mainProds = BackEndObjects.MainBusinessEntity.getProductDetailsforMainEntitybyIdDB(cOBJ.getContactEntityId());
                    String mainProdList = "";

                    foreach (KeyValuePair <String, BackEndObjects.ProductCategory> kvp in mainProds)
                    {
                        mainProdList = (mainProdList.Equals("") ? ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName() : mainProdList +
                                        "," + ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName());
                    }

                    Label_Main_Business.Text = (!mainProdList.Equals("") ? mainProdList : Label_Main_Business.Text);
                }
                else
                {
                    String[] prodCatArray = cOBJ.getProdList().Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    String   mainProdList = "";

                    for (int i = 0; i < prodCatArray.Length; i++)
                    {
                        mainProdList = (mainProdList.Equals("") ? BackEndObjects.ProductCategory.getProductCategorybyIdwoFeaturesDB(prodCatArray[i]).getProductCategoryName() : mainProdList +
                                        "," + BackEndObjects.ProductCategory.getProductCategorybyIdwoFeaturesDB(prodCatArray[i]).getProductCategoryName());
                    }

                    Label_Main_Business.Text = (!mainProdList.Equals("") ? mainProdList : Label_Main_Business.Text);
                }
            }
            else
            {
                BackEndObjects.MainBusinessEntity mBObj = (BackEndObjects.MainBusinessEntity)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_MAIN_BUSINESS_ENTITY];
                Label_Cust_Name.Text  = mBObj.getEntityName();
                Label_Email.Text      = mBObj.getEmailId();
                Label_Contact_No.Text = mBObj.getPhNo();
                Label_From_Site.Text  = "Y";

                Dictionary <String, BackEndObjects.ProductCategory> mainProds = mBObj.getMainProductServices();
                //BackEndObjects.MainBusinessEntity.getProductDetailsforMainEntitybyIdDB(mBObj.getEntityId());
                String mainProdList = "";

                if (mainProds != null)
                {
                    foreach (KeyValuePair <String, BackEndObjects.ProductCategory> kvp in mainProds)
                    {
                        mainProdList = (mainProdList.Equals("") ? ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName() : mainProdList + "," + ((BackEndObjects.ProductCategory)kvp.Value).getProductCategoryName());
                    }
                }

                Label_Main_Business.Text = (!mainProdList.Equals("") ? mainProdList : Label_Main_Business.Text);
                if (mBObj.getAddressDetails() != null)
                {
                    localId = mBObj.getAddressDetails().getLocalityId();
                }
            }

            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);

                BackEndObjects.City ctObj = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);

                String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                if (cityId.Equals(localId))
                {
                    ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                }

                String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                if (stateId.Equals(localId))
                {
                    stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                }

                if (cntObj != null && cntObj.getCountryName() != null && !cntObj.getCountryName().Equals(""))
                {
                    Label_Country.Text = cntObj.getCountryName();
                }

                if (stObj != null && stObj.getStateName() != null && !stObj.getStateName().Equals(""))
                {
                    Label_State.Text = stObj.getStateName();
                }

                if (ctObj != null && ctObj.getCityName() != null && !ctObj.getCityName().Equals(""))
                {
                    Label_City.Text = ctObj.getCityName();
                }

                if (lclObj != null && lclObj.getLocalityName() != null && !lclObj.getLocalityName().Equals(""))
                {
                    Label_Locality.Text = lclObj.getLocalityName();
                }
            }
        }
Exemple #5
0
        protected void fillGrid()
        {
            ArrayList mBEList = BackEndObjects.MainBusinessEntity.getMainBusinessEntityListbyNameWithAddrDetailsDB(TextBox_Search_Contact.Text,
                                                                                                                   Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            if (mBEList == null || mBEList.Count == 0)
            {
                Label_Status_Search.Visible   = true;
                Label_Status_Search.ForeColor = System.Drawing.Color.Red;
                Label_Status_Search.Text      = "No company found for the given id";
                GridView1.Visible             = false;
            }

            else
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Name");
                dt.Columns.Add("Country");
                dt.Columns.Add("State");
                dt.Columns.Add("City");
                dt.Columns.Add("Locality");
                dt.Columns.Add("Street Name");
                dt.Columns.Add("Mob");
                dt.Columns.Add("Email");
                dt.Columns.Add("Contact Exists?");
                dt.Columns.Add("localId");
                dt.Columns.Add("ContactEntId");

                for (int i = 0; i < mBEList.Count; i++)
                {
                    //MainBusinessEntity mBEObj = BackEndObjects.MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(TextBox_Search_Contact.Text);
                    MainBusinessEntity mBEObj  = (MainBusinessEntity)mBEList[i];
                    AddressDetails     mBEAddr = mBEObj.getAddressDetails();

                    Contacts contactObj = Contacts.
                                          getContactDetailsforContactEntityDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), mBEObj.getEntityId());

                    Label_Status_Search.Visible = false;

                    BackEndObjects.Localities localObj   = null;
                    BackEndObjects.City       cityObj    = null;
                    BackEndObjects.State      stateObj   = null;
                    BackEndObjects.Country    countryObj = null;

                    if (mBEAddr.getLocalityId() != null && !mBEAddr.getLocalityId().Equals(""))
                    {
                        localObj   = Localities.getLocalitybyIdDB(mBEAddr.getLocalityId());
                        cityObj    = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(mBEAddr.getLocalityId());
                        stateObj   = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityObj.getCityId());
                        countryObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateObj.getStateId());
                        //Session[SessionFactory.CREATE_CONTACT_LOCALITY_ID] = localObj.getLocalityId();
                        //Session[SessionFactory.CREATE_CONTACT_ADDRESS_LINE1] = mBEAddr.getAddrLine1();
                    }


                    dt.Rows.Add();

                    dt.Rows[i]["Name"] = mBEObj.getEntityName();
                    if (mBEAddr.getLocalityId() != null && !mBEAddr.getLocalityId().Equals(""))
                    {
                        dt.Rows[i]["Country"]      = countryObj.getCountryName();
                        dt.Rows[i]["State"]        = stateObj.getStateName();
                        dt.Rows[i]["City"]         = cityObj.getCityName();
                        dt.Rows[i]["Locality"]     = localObj.getLocalityName();
                        dt.Rows[i]["Street Name"]  = mBEAddr.getAddrLine1();
                        dt.Rows[i]["localId"]      = mBEAddr.getLocalityId();
                        dt.Rows[i]["ContactEntId"] = mBEAddr.getMainBusinessId();
                    }
                    else
                    {
                        dt.Rows[i]["Country"]      = "N/A";
                        dt.Rows[i]["State"]        = "N/A";
                        dt.Rows[i]["City"]         = "N/A";
                        dt.Rows[i]["Locality"]     = "N/A";
                        dt.Rows[i]["Street Name"]  = "N/A";
                        dt.Rows[i]["localId"]      = "";
                        dt.Rows[i]["ContactEntId"] = mBEObj.getEntityId();
                    }
                    dt.Rows[i]["Mob"]             = mBEObj.getPhNo();
                    dt.Rows[i]["Email"]           = mBEObj.getEmailId();
                    dt.Rows[i]["Contact Exists?"] = ((contactObj.getContactEntityId() != null && !contactObj.getContactEntityId().Equals("")) ? "Y" : "N");
                }
                GridView1.DataSource = dt;
                GridView1.DataBind();
                GridView1.Visible             = true;
                GridView1.Columns[10].Visible = false;
                GridView1.Columns[11].Visible = false;


                Session[SessionFactory.CREATE_CONTACT_DATA_GRID] = dt;
            }
        }
Exemple #6
0
        protected void loadClientAndVendorDetails(String rfId, String otherEntId)
        {
            String entId   = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString();
            String context = Request.QueryString.GetValues("context")[0];

            context = context.Equals("client") || context.Equals("clientInvoiceGrid") ? "client" : context;

            String localId     = "";
            String vendDetails = "";
            String custDetails = "";
            String vendContact = "";
            String custContact = "";

            //Populate the vendor details
            Dictionary <String, Object> vendObj = ActionLibrary.customerDetails.
                                                  getContactDetails(otherEntId, Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            if (vendObj.ContainsKey(ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS))
            {
                BackEndObjects.Contacts cOBJ = (BackEndObjects.Contacts)vendObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS];

                if (context.Equals("client"))
                {
                    Label_Vendor_Name.Text = cOBJ.getContactName();
                    vendContact            = cOBJ.getMobNo();
                    vendDetails           += cOBJ.getStreetName() + ",";
                    localId = cOBJ.getLocalityId();
                }
                else
                {
                    Label_Client_Name.Text = cOBJ.getContactName();
                    custContact            = cOBJ.getMobNo();
                    custDetails           += cOBJ.getStreetName() + ",";
                    localId = cOBJ.getLocalityId();
                }
            }
            else
            {
                BackEndObjects.MainBusinessEntity mBObj      = (BackEndObjects.MainBusinessEntity)vendObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_MAIN_BUSINESS_ENTITY];
                BackEndObjects.AddressDetails     addrObjEnt = BackEndObjects.AddressDetails.getAddressforMainBusinessEntitybyIdDB(mBObj.getEntityId());
                if (context.Equals("client"))
                {
                    Label_Vendor_Name.Text = mBObj.getEntityName();
                    vendContact            = mBObj.getPhNo();
                    if (addrObjEnt != null)
                    {
                        vendDetails += addrObjEnt.getAddrLine1() + ",";
                    }
                }
                else
                {
                    Label_Client_Name.Text = mBObj.getEntityName();
                    custContact            = mBObj.getPhNo();
                    if (addrObjEnt != null)
                    {
                        custDetails += addrObjEnt.getAddrLine1() + ",";
                    }
                }
                if (mBObj.getAddressDetails() != null)
                {
                    localId = mBObj.getAddressDetails().getLocalityId();
                }
            }

            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
                BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
                String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                if (cityId.Equals(localId))
                {
                    ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                }
                String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                if (stateId.Equals(localId))
                {
                    stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                }

                if (context.Equals("client"))
                {
                    vendDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + vendContact;
                }
                else
                {
                    custDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + custContact;
                }
            }
            if (context.Equals("client"))
            {
                Label_Vendor_Addr.Text = vendDetails;
            }
            else
            {
                Label_Client_Addr.Text = custDetails;
            }

            //Get the customer details
            BackEndObjects.MainBusinessEntity custObj = BackEndObjects.MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(entId);

            if (context.Equals("client"))
            {
                Label_Client_Name.Text = custObj.getEntityName();
                custContact            = custObj.getPhNo();
            }
            else
            {
                Label_Vendor_Name.Text = custObj.getEntityName();
                vendContact            = custObj.getPhNo();
            }

            BackEndObjects.AddressDetails addrObj = BackEndObjects.AddressDetails.getAddressforMainBusinessEntitybyIdDB(entId);

            if (addrObj.getLocalityId() != null && !addrObj.getLocalityId().Equals(""))
            {
                if (context.Equals("client"))
                {
                    custDetails += addrObj.getAddrLine1() + ",";
                }
                else
                {
                    vendDetails += addrObj.getAddrLine1() + ",";
                }

                localId = addrObj.getLocalityId();

                if (localId != null && !localId.Equals(""))
                {
                    BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
                    BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
                    String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                    BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                    if (cityId.Equals(localId))
                    {
                        ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                    }
                    String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                    BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                    if (stateId.Equals(localId))
                    {
                        stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                    }

                    if (context.Equals("client"))
                    {
                        custDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + custContact;
                    }
                    else
                    {
                        vendDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + vendContact;
                    }
                }
            }
            if (context.Equals("client"))
            {
                Label_Client_Addr.Text = custDetails;
            }
            else
            {
                Label_Vendor_Addr.Text = vendDetails;
            }
        }
Exemple #7
0
        protected void loadClientAndVendorDetails()
        {
            String context     = Request.QueryString.GetValues("context")[0];
            String ClientEntId = "";
            String vendorId    = "";

            Label_To.Text = "Vendor Details:";

            if (context.Equals("client"))
            {
                ClientEntId = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString();
                vendorId    = Request.QueryString.GetValues("respCompId")[0];
            }
            else
            {
                Dictionary <String, bool> accessList = (Dictionary <String, bool>)Session[SessionFactory.ACCESSLIST_FOR_USER];

                if (!accessList[BackEndObjects.EntityAccessListRecord.ENTITY_ACCESS_LIST_RECORD_ACCESS_EDIT_POTENTIAL] &&
                    !accessList[BackEndObjects.EntityAccessListRecord.ENTITY_ACCESS_LIST_RECORD_ACCESS_OWNER_ACCESS])
                {
                    Button_Create_PO.Enabled = false;
                }

                ClientEntId = Request.QueryString.GetValues("EntId")[0];
                vendorId    = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString();
                Label1.Text = "Sales Order";
            }

            String localId     = "";
            String vendDetails = "";
            String custDetails = "";
            String vendContact = "";
            String custContact = "";

            //Populate the vendor details
            Dictionary <String, Object> vendObj = ActionLibrary.customerDetails.getContactDetails(vendorId, Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            if (vendObj.ContainsKey(ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS))
            {
                BackEndObjects.Contacts cOBJ = (BackEndObjects.Contacts)vendObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS];

                Label_Vendor_Name.Text = cOBJ.getContactName();
                vendContact            = cOBJ.getMobNo();
                localId = cOBJ.getLocalityId();
            }
            else
            {
                BackEndObjects.MainBusinessEntity mBObj = (BackEndObjects.MainBusinessEntity)vendObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_MAIN_BUSINESS_ENTITY];
                Label_Vendor_Name.Text = mBObj.getEntityName();
                vendContact            = mBObj.getPhNo();

                if (mBObj.getAddressDetails() != null)
                {
                    localId = mBObj.getAddressDetails().getLocalityId();
                }
            }

            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
                BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
                String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                if (cityId.Equals(localId))
                {
                    ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                }
                String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                if (stateId.Equals(localId))
                {
                    stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                }

                vendDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + vendContact;
            }
            Label_Vendor_Addr.Text = vendDetails;

            //Get the customer details
            //BackEndObjects.MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(ClientEntId);
            Dictionary <String, Object> custObj = ActionLibrary.customerDetails.getContactDetails(ClientEntId, Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            if (custObj.ContainsKey(ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS))
            {
                BackEndObjects.Contacts cOBJ = (BackEndObjects.Contacts)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_CONTACT_DETAILS];

                Label_Client_Name.Text = cOBJ.getContactName();
                custContact            = cOBJ.getMobNo();
                localId = cOBJ.getLocalityId();
            }
            else
            {
                BackEndObjects.MainBusinessEntity mBObj = (BackEndObjects.MainBusinessEntity)custObj[ActionLibrary.customerDetails.RETURN_OBJECT_TYPE_MAIN_BUSINESS_ENTITY];
                Label_Client_Name.Text = mBObj.getEntityName();
                custContact            = mBObj.getPhNo();

                if (mBObj.getAddressDetails() != null)
                {
                    localId = mBObj.getAddressDetails().getLocalityId();
                }
            }

            //BackEndObjects.AddressDetails addrObj=BackEndObjects.AddressDetails.getAddressforMainBusinessEntitybyIdDB(ClientEntId);

            /*if (addrObj.getLocalityId() != null && !addrObj.getLocalityId().Equals(""))
             * {
             *  custDetails += addrObj.getAddrLine1() + ",";
             *  localId = addrObj.getLocalityId();
             *
             *  BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
             *  BackEndObjects.City ctObj = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
             *  BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(ctObj.getCityId());
             *  BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stObj.getStateId());
             *
             *  custDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + custContact;
             *
             * }*/
            if (localId != null && !localId.Equals(""))
            {
                BackEndObjects.Localities lclObj = BackEndObjects.Localities.getLocalitybyIdDB(localId);
                BackEndObjects.City       ctObj  = BackEndObjects.Localities.getCityDetailsforLocalitywoOtherAsscLocalitiesDB(localId);
                String cityId = (ctObj != null && ctObj.getCityId() != null && !ctObj.getCityId().Equals("") ? ctObj.getCityId() : localId);
                BackEndObjects.State stObj = BackEndObjects.City.getStateDetailsforCitywoOtherAsscCitiesDB(cityId);
                if (cityId.Equals(localId))
                {
                    ctObj = BackEndObjects.City.getCitybyIdwoLocalitiesDB(localId);
                }
                String stateId = (stObj != null && stObj.getStateId() != null && !stObj.getStateId().Equals("") ? stObj.getStateId() : localId);
                BackEndObjects.Country cntObj = BackEndObjects.State.getCountryDetailsforStatewoOtherAsscStatesDB(stateId);
                if (stateId.Equals(localId))
                {
                    stObj = BackEndObjects.State.getStatebyIdwoCitiesDB(stateId);
                }

                custDetails += lclObj.getLocalityName() + "<br/>" + ctObj.getCityName() + "<br/>" + stObj.getStateName() + "<br/>" + cntObj.getCountryName() + "<br/> Phone:" + custContact;
            }
            Label_Client_Addr.Text = custDetails;
        }