protected void fillListDropDown() { if (DropDownList_BroadCast_List != null && DropDownList_BroadCast_List.Items.Count > 0) { DropDownList_BroadCast_List.Items.Clear(); } ListItem lt1 = new ListItem(); lt1.Text = BackEndObjects.RFQBroadcastList.RFQ_BROADCAST_TO_ALL; lt1.Value = BackEndObjects.RFQBroadcastList.RFQ_BROADCAST_TO_ALL; ListItem lt2 = new ListItem(); lt2.Text = BackEndObjects.RFQBroadcastList.RFQ_BROADCAST_TO_ALL_INTERESTED; lt2.Value = BackEndObjects.RFQBroadcastList.RFQ_BROADCAST_TO_ALL_INTERESTED; DropDownList_BroadCast_List.Items.Add(lt1); DropDownList_BroadCast_List.Items.Add(lt2); ArrayList contactObjList = BackEndObjects.Contacts.getAllContactsbyEntityIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); for (int i = 0; i < contactObjList.Count; i++) { BackEndObjects.Contacts contactObj = (BackEndObjects.Contacts)contactObjList[i]; if (contactObj.getFromSite().Equals("Y", StringComparison.InvariantCultureIgnoreCase)) { ListItem lt = new ListItem(); lt.Text = contactObj.getContactName(); lt.Value = contactObj.getContactEntityId(); DropDownList_BroadCast_List.Items.Add(lt); } } DropDownList_BroadCast_List.SelectedIndex = -1; }
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(); } }
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(); } } }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { BackEndObjects.Contacts contactObj = new BackEndObjects.Contacts(); Panel_Create_Contact.Enabled = false; Label_Disable.Visible = true; contactObj.setContactEntityId(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Contact_Ent_Id")).Text); //contactObj.setContactName(((Label)GridView1.SelectedRow.Cells[1].FindControl("Label_Name")).Text); //contactObj.setEmailID(((Label)GridView1.SelectedRow.Cells[1].FindControl("Label_Email")).Text); contactObj.setContactName(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Name")).Text); contactObj.setEmailID(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Email_Id")).Text); contactObj.setEntityId(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); contactObj.setFromSite("Y"); //if (Session[SessionFactory.CREATE_CONTACT_LOCALITY_ID]!=null) if (((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Local_Id")).Text != null) { contactObj.setLocalityId(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Local_Id")).Text); } contactObj.setMobNo(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Contact_No")).Text); if (((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Street_Name")).Text != null) { contactObj.setStreetName(((Label)GridView1.SelectedRow.Cells[0].FindControl("Label_Street_Name")).Text); } String prodList = ""; //Get the product/service details Dictionary <String, ProductCategory> prodDict = MainBusinessEntity.getProductDetailsforMainEntitybyIdDB(contactObj.getContactEntityId()); foreach (KeyValuePair <String, ProductCategory> kvp in prodDict) { prodList += kvp.Value.getCategoryId() + ","; } if (prodList.Length > 0) { prodList = prodList.TrimEnd(','); } contactObj.setProdList(prodList); Session[SessionFactory.CREATE_CONTACT_CONTACT_OBJ] = contactObj; }