Exemplo n.º 1
0
        public List <Guarantors> GetGuarantorsByShow_ID(Guid show_ID)
        {
            List <Guarantors> guarantorList = new List <Guarantors>();

            try
            {
                GuarantorsBL guarantors = new GuarantorsBL(_connString);
                tblGuarantors = guarantors.GetGuarantorsByShow_ID(show_ID);

                if (tblGuarantors != null && tblGuarantors.Rows.Count > 0)
                {
                    foreach (DataRow row in tblGuarantors.Rows)
                    {
                        Guarantors guarantor = new Guarantors(_connString, Utils.DBNullToGuid(row["Guarantor_ID"]));
                        guarantorList.Add(guarantor);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(guarantorList);
        }
Exemplo n.º 2
0
    private void PopulateGuarantors(string show_ID, string guarantor_ID)
    {
        Guid newShow_ID = new Guid(show_ID);
        Shows show = new Shows(newShow_ID);
        List<Guarantors> tblGuarantors = null;
        if (!string.IsNullOrEmpty(guarantor_ID))
        {
            Guid newGuarantor_ID = new Guid(guarantor_ID);
            Guarantors guarantor = new Guarantors(newGuarantor_ID);
            tblGuarantors = guarantor.GetGuarantorsByGuarantor_ID(newGuarantor_ID);
        }
        else
        {
            Guarantors guarantor = new Guarantors();
            tblGuarantors = guarantor.GetGuarantorsByShow_ID(newShow_ID);
        }
        if (tblGuarantors.Count > 0)
        {
            Guarantor_ID = tblGuarantors[0].Guarantor_ID.ToString();
            Common.Guarantor_ID = Guarantor_ID;
            Chairman_ID = tblGuarantors[0].Chairman_Person_ID.ToString();
            Common.Chairman_ID = Chairman_ID;
            PopulateChairman();
            Secretary_ID = tblGuarantors[0].Secretary_Person_ID.ToString();
            Common.Secretary_ID = Secretary_ID;
            PopulateSecretary();
            Treasurer_ID = tblGuarantors[0].Treasurer_Person_ID.ToString();
            Common.Treasurer_ID = Treasurer_ID;
            PopulateTreasurer();
            if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
            {

                if (!tblGuarantors[0].IsCommittee1_Person_IDNull)
                {
                    Committee1_ID = tblGuarantors[0].Committee1_Person_ID.ToString();
                    Common.Committee1_ID = Committee1_ID;
                    PopulateCommittee1();
                }
                if (!tblGuarantors[0].IsCommittee2_Person_IDNull)
                {
                    Committee2_ID = tblGuarantors[0].Committee2_Person_ID.ToString();
                    Common.Committee2_ID = Committee2_ID;
                    PopulateCommittee2();
                }
                if (!tblGuarantors[0].IsCommittee3_Person_IDNull)
                {
                    Committee3_ID = tblGuarantors[0].Committee3_Person_ID.ToString();
                    Common.Committee3_ID = Committee3_ID;
                    PopulateCommittee3();
                }
            }
            divAddGuarantors.Visible = false;
            divGuarantorList.Visible = true;
            ShowCommittee();
            Common.GuarantorsPopulated = true;
        }
    }
Exemplo n.º 3
0
        public List<Guarantors> GetGuarantorsByShow_ID(Guid show_ID)
        {
            List<Guarantors> guarantorList = new List<Guarantors>();
            GuarantorsBL guarantors = new GuarantorsBL();
            tblGuarantors = guarantors.GetGuarantorsByShow_ID(show_ID);

            if (tblGuarantors != null && tblGuarantors.Count > 0)
            {
                foreach (sss.tblGuarantorsRow row in tblGuarantors)
                {
                    Guarantors guarantor = new Guarantors(row.Guarantor_ID);
                    guarantorList.Add(guarantor);
                }
            }

            return guarantorList;
        }
Exemplo n.º 4
0
    private bool HasChanges(Guarantors guarantor, Shows show)
    {
        bool Changed = false;

        if (guarantor.Chairman_Person_ID.ToString() != Chairman_ID)
            Changed = true;
        if (guarantor.Secretary_Person_ID.ToString() != Secretary_ID)
            Changed = true;
        if (guarantor.Treasurer_Person_ID.ToString() != Treasurer_ID)
            Changed = true;
        if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
        {
            if (guarantor.Committee1_Person_ID.ToString() != Committee1_ID)
                Changed = true;
            if (guarantor.Committee2_Person_ID.ToString() != Committee2_ID)
                Changed = true;
            if (guarantor.Committee3_Person_ID.ToString() != Committee3_ID)
                Changed = true;
        }

        return Changed;
    }
Exemplo n.º 5
0
 private void GetGuarantor_IDForShow(string show_ID)
 {
     List<Guarantors> tblGuarantors = null;
     Guid newShow_ID = new Guid(show_ID);
     Guarantors guarantor = new Guarantors();
     tblGuarantors = guarantor.GetGuarantorsByShow_ID(newShow_ID);
     if (tblGuarantors.Count > 0)
     {
         Guarantor_ID = tblGuarantors[0].Guarantor_ID.ToString();
         Common.Guarantor_ID = Guarantor_ID;
     }
 }
Exemplo n.º 6
0
    protected void btnUpdateGuarantors_Click(object sender, EventArgs e)
    {
        Guid show_ID = new Guid(Show_ID);
        Shows show = new Shows(show_ID);
        if (ValidateGuarantors(show))
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid user_ID = (Guid)userInfo.ProviderUserKey;

            Guid guarantor_ID = new Guid(Guarantor_ID);
            Guarantors guarantor = new Guarantors(guarantor_ID);
            if (HasChanges(guarantor, show))
            {
                guarantor.Chairman_Person_ID = new Guid(Chairman_ID);
                guarantor.Secretary_Person_ID = new Guid(Secretary_ID);
                guarantor.Treasurer_Person_ID = new Guid(Treasurer_ID);
                if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
                {
                    guarantor.Committee1_Person_ID = new Guid(Committee1_ID);
                    guarantor.Committee2_Person_ID = new Guid(Committee2_ID);
                    guarantor.Committee3_Person_ID = new Guid(Committee3_ID);
                }
                guarantor.DeleteGuarantor = false;

                if (guarantor.Update_Guarantor(guarantor_ID, user_ID))
                {
                    MessageLabel.Text = "Guarantors updated successfully.";
                    PopulateGuarantors(Show_ID, Guarantor_ID);
                }
            }
            else
            {
                MessageLabel.Text = "Update cancelled as no changes have been made.";
            }
        }
    }
Exemplo n.º 7
0
    protected void btnAddGuarantors_Click(object sender, EventArgs e)
    {
        Guid show_ID = new Guid(Show_ID);
        Shows show = new Shows(show_ID);

        if (ValidateGuarantors(show))
        {
            MembershipUser userInfo = Membership.GetUser();
            Guid user_ID = (Guid)userInfo.ProviderUserKey;

            Guarantors guarantor = new Guarantors();
            guarantor.Show_ID = show_ID;
            guarantor.Chairman_Person_ID = new Guid(Chairman_ID);
            guarantor.Secretary_Person_ID = new Guid(Secretary_ID);
            guarantor.Treasurer_Person_ID = new Guid(Treasurer_ID);
            if (show.Show_Type_ID == Constants.CHAMPIONSHIP)
            {
                guarantor.Committee1_Person_ID = new Guid(Committee1_ID);
                guarantor.Committee2_Person_ID = new Guid(Committee2_ID);
                guarantor.Committee3_Person_ID = new Guid(Committee3_ID);
            }
            Guid? guarantor_ID;
            guarantor_ID = guarantor.Insert_Guarantor(user_ID);
            if (!string.IsNullOrEmpty(guarantor_ID.ToString()))
            {
                Guarantor_ID = guarantor_ID.ToString();
                Common.Guarantor_ID = Guarantor_ID;
                Common.GuarantorsPopulated = true;
                divAddGuarantors.Visible = false;
                divUpdateGuarantors.Visible = true;
                MessageLabel.Text = "Guarantors added successfully.";
            }
        }
    }