protected void txtBusinessZipCode_TextChanged(object sender, EventArgs e)
    {
        DataTable dt      = null;
        double    stateId = OrganizationInfo.getStateId(OrganizationID);

        dt = OrganizationInfo.GetCityStateAndCountryByZipCode(txtZipCode.Text.Trim(), GlobalCountryID, stateId);

        if (dt.Rows.Count > 0)
        {
            hdnBusinessZipCodeId.Value = Convert.ToString(dt.Rows[0]["ZipcodeID"]);

            txtCity.Text = Convert.ToString(dt.Rows[0]["CityName"]);

            if (ddlCountry.Items.FindByValue(Convert.ToString(dt.Rows[0]["CountryId"])) != null)
            {
                ddlCountry.SelectedValue = Convert.ToString(dt.Rows[0]["CountryId"]);
            }

            System.Data.SqlClient.SqlParameter[] prm;

            prm    = new System.Data.SqlClient.SqlParameter[1];
            prm[0] = new System.Data.SqlClient.SqlParameter("@CountryId", ddlCountry.SelectedValue);
            Utils.GetLookUpData <DropDownList>(ref ddlState, LookUps.State, prm);
            prm = null;

            if (ddlState.Items.FindByValue(Convert.ToString(dt.Rows[0]["StateId"])) != null)
            {
                ddlState.SelectedValue = Convert.ToString(dt.Rows[0]["StateId"]);
            }

            txtBusinessAddress1.Focus();
            lblBusinessZipCode.Text = "";
        }
        else
        {
            txtZipCode.Text = "";
            txtZipCode.Focus();
            lblBusinessZipCode.Text = "* Zipcode does not exist in this state.";
        }

        lblinfo.Visible = false;
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["p"] == null)
        {
            Session["ss"] = null;
        }
        ClientScript.RegisterStartupScript(GetType(), "SetHeaderMenu", "SetHeaderMenu('liPTE');", true);
        stateID = OrganizationInfo.getStateId(UserOrganizationId);
        GetPermission(ResourceType.PTE, ref canView, ref canAdd, ref canUpdate, ref canDelete);
        if (!canView)
        {
            Response.Redirect("error");
        }
        else if (!canAdd)
        {
            gvSetting.DataBind();
            gvSetting.Columns[6].Visible = false;
        }
        else if (!canUpdate)
        {
            gvSetting.DataBind();
            gvSetting.Columns[6].Visible = false;
        }
        if (User.Identity.IsAuthenticated == false)
        {
            Response.Redirect("/");
        }
        // ClientScript.RegisterStartupScript(GetType(), "SetHeaderMenu", String.Format("SetHeaderMenu('liSettings','{0}');", ResourceMgr.GetMessage("PTE")), true);

        if (!IsPostBack)
        {
            Utils.GetLookUpData <DropDownList>(ref ddlStewardship, LookUps.StateIdAndName, LanguageId);
            LoadData();
            if (Session["ss"] != null)
            {
                ddlStewardship.SelectedValue = Conversion.ParseString(Session["ss"]);
            }
            //ScriptManager.RegisterStartupScript(this, GetType(), "AddDataPicker", "SetDatePicket();", true);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserInfo userinfoobj = new UserInfo(LoginMemberId);

        lblRoleName.Text    = "(" + userinfoobj.RoleName + ")";
        lblSubRoleName.Text = userinfoobj.SubRoleName;

        UserInfo obj = UserInfo.GetCurrentUserInfo();

        litLoginName.Text = obj.Login;

        //lblRoleName.Text = obj.RoleName;
        //lblSubRoleName.Text = obj.SubRoleName;


        if (obj.LastLoginDate != null && obj.LastLoginDate != DateTime.MinValue)
        {
            //29 October, 2012//11:00am
            litLastLoginDate.Text = String.Format("Last Login on <b>{0}</b>at &nbsp; <b>{1}</b>", obj.LastLoginDate.ToString("dd MMMM, yyyy"), obj.LastLoginDate.ToString("hh:mm tt"));

            litLastLoginNotAvailable.Visible = false;
            litLastLoginDate.Visible         = true;
        }
        else
        {
            litLastLoginNotAvailable.Visible = true;
            litLastLoginDate.Visible         = false;
        }
        if (!IsPostBack)
        {
            lblcompanyname.Text = OrganizationInfo.GetOrgLegalNameByOrgId(UserOrganizationId);
            int stateid = OrganizationInfo.getStateId(obj.OrganizationId);
            try
            {
                DataSet ds1 = OrganizationInfo.GetStateCodeByStateId(stateid);
                litRole.Text = ds1.Tables[0].Rows[0]["StateName"].ToString();
            }
            catch { }
            DataTable dt = OrganizationInfo.GetLogoPath(obj.OrganizationId);

            if (dt != null && dt.Rows.Count > 0)
            {
                string str = ConfigurationManager.AppSettings["LogoUploadLocation"] + dt.Rows[0]["vchLogoPath"].ToString();
                if (string.IsNullOrEmpty(dt.Rows[0]["vchLogoPath"].ToString()))
                {
                    imgLogo.Visible        = false;
                    imgLogoDefault.Visible = true;
                }
                else
                {
                    imgLogo.Visible        = true;
                    imgLogoDefault.Visible = false;
                    str = str.Replace("//", "/");
                    imgLogo.ImageUrl = str;
                }


                //  litRole.Text = dt.Rows[0]["StateName"].ToString();// +" " + dt.Rows[0]["RoleName"].ToString();
            }
            else
            {
                imgLogo.Visible        = false;
                imgLogoDefault.Visible = true;
            }
            DataSet ds    = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true, 100000, 1);
            int     count = ds.Tables[0].Rows.Count;
            if (count == 0)
            {
                lblnotficationcount.Text = "";
            }
            else
            {
                lblnotficationcount.Text = count.ToString();
            }
            BasePage objBase = new BasePage();

            ds = UserInfo.GetAllActiveLanguages();

            DataRow dr = ds.Tables[0].Select("LanguageId =" + objBase.LanguageId)[0];
            //litLangauge.Text = Convert.ToString(dr["CountryName"]);
            img.Src = "/images/" + Convert.ToString(dr["Flag"]);
            lvmessagesmain.DataSource = Notifications.getAllNotifications(UserInfo.GetCurrentUserInfo().UserId, UserOrganizationId, false, true, 10, 1);
            lvmessagesmain.DataBind();
        }
    }
    protected void lnkbtnUpdate_Click(object sender, EventArgs e)
    {
        // int stateId = OrganizationInfo.getStateId(OrganizationID);
        //int  organizationIdWithSimilerEmail = OrganizationInfo.getOrganizationIdByEmail(txtPrimaryEmail.Text.Trim(), stateId);
        //if (organizationIdWithSimilerEmail > 0)
        //{
        //    lblemailalreadyexists.Text = "Email already exists for this state. Choose another";
        //    lblemailalreadyexists.Visible = true;
        //    return;
        //}
        DataTable dt      = null;
        double    stateId = OrganizationInfo.getStateId(OrganizationID);

        dt = OrganizationInfo.GetCityStateAndCountryByZipCode(txtZipCode.Text.Trim(), GlobalCountryID, stateId);

        if (dt.Rows.Count > 0)
        {
        }
        else
        {
            txtZipCode.Text = "";
            txtZipCode.Focus();
            lblBusinessZipCode.Text = "* Zipcode does not exist in this state.";
            return;
        }
        OrganizationInfo objOrg = new OrganizationInfo(OrganizationID);

        if (dddlcelltextmsgs.SelectedValue == "1")
        {
            objOrg.CellAcceptTextMessages = true;
        }
        else
        {
            objOrg.CellAcceptTextMessages = false;
        }
        if (ddlbusinesstextmsgs.SelectedValue == "1")
        {
            objOrg.AcceptTextMessages = true;
        }
        else
        {
            objOrg.AcceptTextMessages = false;
        }
        objOrg.OrganizationId = OrganizationID;
        //     objOrg.Fax = txtFax.Text.Trim();
        //       objOrg.Address = txtAddress.Text.Trim();
        //  objOrg.BusinessType = txtBusinessType.Text.Trim();
        //       objOrg.BillMailAddress = txtBillingMailAddress.Text.Trim();
        //      objOrg.BillingContact = txtBillingContact.Text.Trim();
        //       objOrg.CellExtension = txtCellPhoneExtension.Text.Trim();
        objOrg.LegalName        = txtBusinessName.Text.Trim();
        objOrg.DBAName          = txtDBAName.Text.Trim();
        objOrg.Website          = txtWebsite.Text.Trim();
        objOrg.IsActive         = true;
        objOrg.IsOrganization   = true;
        objOrg.LanguageId       = LanguageId;
        objOrg.ContactTitleName = txtContactTitle.Text.Trim();
        objOrg.RoleId           = Conversion.ParseInt(UserInfo.UserRole.Stewardship);
        objOrg.UpdateOrganizationInfo();
        ContactInfo objPrimaryContact = new ContactInfo();

        objPrimaryContact.FirstName = txtFirstName.Text.Trim();
        objPrimaryContact.LastName  = txtLastName.Text.Trim();
        objPrimaryContact.Email     = txtPrimaryEmail.Text.Trim();

        objPrimaryContact.IsActive      = true;
        objPrimaryContact.IsPrimary     = true;
        objPrimaryContact.LanguageId    = LanguageId;
        objPrimaryContact.ContactTypeId = Convert.ToInt32(LookupsManagement.LookupType.ContactTypes_Business);

        Phones objPrimaryContactBusinessPhone = new Phones();

        objPrimaryContactBusinessPhone.Number      = txtPhoneNumber.Text.Trim().ToString();
        objPrimaryContactBusinessPhone.Extension   = txtPhoneExtension.Text.Trim().ToString();
        objPrimaryContactBusinessPhone.IsActive    = true;
        objPrimaryContactBusinessPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Business);

        Phones objPrimaryContactCellPhone = new Phones();

        objPrimaryContactCellPhone.Number      = txtCellPhoneNumber.Text.Trim();
        objPrimaryContactCellPhone.IsActive    = true;
        objPrimaryContactCellPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Cell);

        ContactInfo objBillingContact = new ContactInfo();

        //      objBillingContact.Email = txtBillingMailAddress.Text.Trim();
        objBillingContact.IsActive      = true;
        objBillingContact.IsPrimary     = false;
        objBillingContact.LanguageId    = LanguageId;
        objBillingContact.ContactTypeId = Convert.ToInt32(ContactInfo.ContactTypes.Billing);
        objBillingContact.ContactTypeId = Convert.ToInt32(LookupsManagement.LookupType.ContactTypes_Billing);

        Phones objBillingContactBusinessPhone = new Phones();

        objBillingContactBusinessPhone.IsActive    = true;
        objBillingContactBusinessPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Business);

        Phones objBillingContactCellPhone = new Phones();

        objBillingContactCellPhone.IsActive    = true;
        objBillingContactCellPhone.PhoneTypeId = Convert.ToInt32(LookupsManagement.LookupType.PhoneType_Cell);

        OrganizationInfo.Organization_Address objBusinessOrganization_Address = new OrganizationInfo.Organization_Address();

        objBusinessOrganization_Address.ZipCodeID     = Convert.ToInt32(hdnBusinessZipCodeId.Value);
        objBusinessOrganization_Address.ZipPostalCode = txtZipCode.Text.Trim().ToString();
        objBusinessOrganization_Address.Address1      = txtBusinessAddress1.Text.Trim();
        objBusinessOrganization_Address.Address2      = txtBusinessAddress2.Text.Trim();
        objBusinessOrganization_Address.City          = txtCity.Text.Trim().ToString();
        objBusinessOrganization_Address.StateID       = Convert.ToInt32(ddlState.SelectedValue);
        objBusinessOrganization_Address.CountryID     = Convert.ToInt32(ddlCountry.SelectedValue);
        objBusinessOrganization_Address.DateCreated   = DateTime.Now;
        objBusinessOrganization_Address.IsActive      = true;
        objBusinessOrganization_Address.Organization_AddressTypeId = Convert.ToInt32(LookupsManagement.LookupType.OrganizationAddressType_Business);

        OrganizationInfo.Organization_Address objMailingOrganization_Address = new OrganizationInfo.Organization_Address();
        objMailingOrganization_Address.DateCreated = DateTime.Now;
        objMailingOrganization_Address.IsActive    = true;
        objMailingOrganization_Address.Organization_AddressTypeId = Convert.ToInt32(LookupsManagement.LookupType.OrganizationAddressType_Mailing);

        OrganizationInfo.UpdateStewardshipInfo(objOrg, objPrimaryContact, objPrimaryContactBusinessPhone, objPrimaryContactCellPhone, objBillingContact, objBillingContactBusinessPhone, objBillingContactCellPhone, objBusinessOrganization_Address, objMailingOrganization_Address);
        lblinfo.Visible = true;
        lblinfo.Text    = "Successfully updated";
        viewStakeholdersForApproval();
        pnlDisplay.Visible = true;
        pnlEdit.Visible    = false;
    }