Пример #1
0
        // Address Search

        protected void btnAddrOk_Click(object sender, EventArgs e)
        {
            // If we have a selected address, use the shid for our main page.
            if (lstAddressName.SelectedItem != null)
            {
                int    crop_year = Convert.ToInt16(ddlCropYear.Text);
                string shid      = txtAddrSHID.Text;
                if (hdnFinderType.Value == "AddressFinder")
                {
                    LoadPAC(crop_year, shid);
                }
                else
                {
                    var ind = new Individual
                    {
                        FullName     = txtAddrFName.Text + " " + txtAddrLName.Text,
                        SHID         = Convert.ToInt32(shid),
                        Sort         = Convert.ToChar("1"),
                        Percentage   = 100,
                        IndividualID = 0,
                        Email        = txtEmail.Text
                    };
                    ind.IndividualID = PACData.SaveIndividual(ind);
                    IndTable.Add(ind);
                    ReBuildTable();
                    UpdatePACDetails.Update();
                }
                CloseAndResolve("AddressFinder");
            }
        }
Пример #2
0
        protected void btnIndAdd_Click(object sender, EventArgs e)
        {
            pacMessages.InnerText = "";
            int userId = 0;

            if (newIndividualName != null && newIndividualName.Text.Length > 1)
            {
                var i = new Individual
                {
                    IndividualID = 0,
                    FullName     = newIndividualName.Text,
                    Email        = newIndividualEmail.Text,
                    SHID         = Convert.ToInt32(txtSHID.Text)
                };
                userId = PACData.SaveIndividual(i);
                if (userId > 0)
                {
                    Individual user = PACData.GetPACIndividuals(userId, null)[0];
                    if (user != null)
                    {
                        this.IndTable.Add(user);
                        ReBuildTable();
                        UpdatePACDetails.Update();
                        CloseAndResolve("PACIndividuals");
                    }
                }
            }
        }
Пример #3
0
        private Individual CreateAndFetchIndividual(int crop_year, string shid)
        {
            int cropYear = Convert.ToInt16(ddlCropYear.Text);
            List <ListAddressItem> addrList = BeetDataAddress.AddressFindByTerm(shid, cropYear, 1);
            var x   = addrList[0];
            var ind = new Individual
            {
                FullName     = x.FirstName + " " + x.LastName,
                SHID         = Convert.ToInt32(shid),
                Sort         = Convert.ToChar("1"),
                Percentage   = 100,
                IndividualID = 0,
                Email        = x.Email
            };

            ind.IndividualID = PACData.SaveIndividual(ind);
            return(ind);
        }
Пример #4
0
        // Signer Search

        protected void btnIndAdd_Click(object sender, EventArgs e)
        {
            pacMessages.InnerText = "";

            if (newIndividualName != null && newIndividualName.Text.Length > 1)
            {
                int userId = PACData.SaveIndividual(new Individual(0, newIndividualName.Text));
                if (userId > 0)
                {
                    Individual user = PACData.GetPACIndividuals(userId, null)[0];
                    if (user != null)
                    {
                        this.IndTable.Add(user);
                        ReBuildTable();
                        UpdatePACDetails.Update();
                        CloseAndResolve("PACIndividuals");
                    }
                }
            }
        }