Exemplo n.º 1
0
        private void btnFilter_Click(object sender, EventArgs e)
        {
            clsMemberShipFilter filter = MakeFilter();

            lstMemberRegistration = da.GetMemberRegistration(filter);
            PopulateGrid(lstMemberRegistration);
        }
        public List <clsMemberRegistration> GetMemberRegistration(clsMemberShipFilter filter)
        {
            List <clsMemberRegistration> lst = new List <clsMemberRegistration>();

            using (SqlConnection conn = new SqlConnection(strConn))
            {
                try
                {
                    conn.Open();

                    using (SqlCommand cmd = new SqlCommand("TMR_USP_GetMembership"))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Connection  = conn;
                        //conn.Open();


                        cmd.Parameters.AddWithValue("@ProjectID", filter.strProjectID);
                        cmd.Parameters.AddWithValue("@Block", filter.strBlockNo);
                        cmd.Parameters.AddWithValue("@RegistrationNo", filter.strMemberShipID);
                        cmd.Parameters.AddWithValue("@MobileNumber", filter.strMobileNumber);
                        cmd.Parameters.AddWithValue("@Name", filter.strName);
                        cmd.Parameters.AddWithValue("@ClientID", filter.strClientID);
                        cmd.Parameters.AddWithValue("@StatusCode", (int)filter.membershipStatus);
                        cmd.Parameters.AddWithValue("@FilterAllocated", filter.bFilterAllocated);
                        cmd.Parameters.AddWithValue("@Allocated", filter.bAllocated);
                        cmd.Parameters.AddWithValue("@ForProcess", filter.bForProcess);

                        SqlDataReader reader = cmd.ExecuteReader();

                        while (reader.Read())
                        {
                            clsMemberRegistration info = new clsMemberRegistration();
                            info.RegistrationNo      = reader["RegistrationNo"].ToString();
                            info.ClientID            = reader["ClientID"].ToString();
                            info.Name                = reader["Name"].ToString();
                            info.FatherOrHusbandType = reader["FatherOrHusbandType"].ToString();
                            info.FatherOrHusband     = reader["FatherOrHusbandName"].ToString();
                            info.NIDOrCNIC           = reader["CNIC"].ToString();
                            info.Nationality         = reader["Nationality"].ToString();
                            info.DOB              = Convert.ToDateTime(reader["DOB"].ToString());
                            info.CurrentAddress1  = reader["CurrentAddress1"].ToString();
                            info.CurrentAddress2  = reader["CurrentAddress2"].ToString();
                            info.CurrentAddress3  = reader["CurrentAddress3"].ToString();
                            info.Country          = reader["Country"].ToString();
                            info.City             = reader["City"].ToString();
                            info.PhOff            = reader["PhOff"].ToString();
                            info.Res              = reader["Res"].ToString();
                            info.Mob              = reader["Mob"].ToString();
                            info.Fax              = reader["Fax"].ToString();
                            info.EmailAddress     = reader["EmailAddress"].ToString();
                            info.Plan             = reader["Plan"].ToString();
                            info.Booking          = Convert.ToDateTime(reader["Booking"].ToString());
                            info.strProjectid     = reader["ProjectID"].ToString();
                            info.Block            = reader["Block"].ToString();
                            info.Plot             = reader["Plot"].ToString();
                            info.UnitRate         = Convert.ToDecimal(reader["UnitRate"].ToString());
                            info.TotalPrice       = Convert.ToDecimal(reader["TotalPrice"].ToString());
                            info.FinanceAmt       = Convert.ToDecimal(reader["FinanceAmt"].ToString());
                            info.RebatAmt         = Convert.ToDecimal(reader["RebatAmt"].ToString());
                            info.NetOrRetailPrice = Convert.ToDecimal(reader["NetPrice"].ToString());
                            info.BookingPrice     = Convert.ToDecimal(reader["BookingPrice"].ToString());
                            info.strStatus        = reader["Status"].ToString();
                            info.bitAllocated     = Convert.ToBoolean(reader["Allocated"]);
                            info.bTransferPending = Convert.ToBoolean(reader["TransferPending"]);
                            info.bSendToGP        = Convert.ToBoolean(reader["SendToGP"]);

                            lst.Add(info);
                        }
                        conn.Close();
                    }
                }
                catch (Exception exc) { }
                finally { }
            }
            return(lst);
        }
Exemplo n.º 3
0
        private void frmMemberLookup_Load(object sender, EventArgs e)
        {
            Loadprojects();
            //cmbProject.Text = "All";
            if (strProject == "" || strProject == null)
            {
                cmbProject.Text = "All";
            }
            else
            {
                cmbProject.Text = strProject;
            }

            cmbBlock.Text    = "All";
            cmbSearchBy.Text = "Membership ID";

            #region All

            if (this.memberlookupCode == memberLookupCodes.All)
            {
                cmbAllocated.Text = "All";
                cmbStatus.Text    = "All";
            }
            else if (this.memberlookupCode == memberLookupCodes.Unallocated)
            {
                cmbAllocated.Text    = "Unallocated";
                cmbStatus.Text       = "All";
                cmbAllocated.Enabled = false;
            }
            else if (this.memberlookupCode == memberLookupCodes.Cancelled)
            {
                cmbAllocated.Text = "All";
                cmbStatus.Text    = "Cancelled";
                cmbStatus.Enabled = false;
            }
            else if (this.memberlookupCode == memberLookupCodes.Reactivate)
            {
                cmbAllocated.Text = "All";
                cmbStatus.Text    = "Reactivated";
                cmbStatus.Enabled = false;
            }
            else if (this.memberlookupCode == memberLookupCodes.Refunded)
            {
                cmbAllocated.Text = "All";
                cmbStatus.Text    = "Refunded";
                cmbStatus.Enabled = false;
            }
            else if (this.memberlookupCode == memberLookupCodes.Transferred)
            {
                cmbAllocated.Text = "All";
                cmbStatus.Text    = "Transferred";
                cmbStatus.Enabled = false;
            }

            clsMemberShipFilter filter = MakeFilter();

            lstMemberRegistration = da.GetMemberRegistration(filter);
            PopulateGrid(lstMemberRegistration);


            //}

            #endregion

            #region Unlocated

            //if (this.memberlookupCode == memberLookupCodes.Unallocated)
            //{
            //    cmbBlock.Visible = false;
            //    cmbProject.Visible = false;
            //    lblProject.Visible = false;
            //    lblBlock.Visible = false;

            //    lstMemberRegistration = da.GetUnallocatedMemberRegistration(new clsMemberShipFilter());
            //    PopulateGrid(lstMemberRegistration);


            //}

            #endregion

            #region Cancellation

            //cmbSearchBy.Text = "Membership ID";


            //if (this.memberlookupCode == memberLookupCodes.Cancelled)
            //{

            //    cmbBlock.Visible = false;
            //    cmbProject.Visible = false;
            //    lblProject.Visible = false;
            //    lblBlock.Visible = false;
            //    lstMemberRegistration = da.GetMemberForCancellation();
            //    PopulateGrid(lstMemberRegistration);


            //}

            #endregion

            #region Deallocation

            //else if (this.memberlookupCode == memberLookupCodes.Deallocte)
            //{
            //    cmbBlock.Visible = false;
            //    cmbProject.Visible = false;
            //    lblProject.Visible = false;
            //    lblBlock.Visible = false;
            //    lstMemberRegistration = da.GetMemberRegistrationForDeallocation(new clsMemberShipFilter());
            //    PopulateGrid(lstMemberRegistration);


            //}


            #endregion

            #region Reactivation

            //else if (this.memberlookupCode == memberLookupCodes.Reactivate)
            //{
            //    cmbBlock.Visible = false;
            //    cmbProject.Visible = false;
            //    lblProject.Visible = false;
            //    lblBlock.Visible = false;
            //    lstMemberRegistration = da.GetMemberForReactivation();
            //    PopulateGrid(lstMemberRegistration);


            //}


            #endregion

            #region Refund

            //else if (this.memberlookupCode == memberLookupCodes.Refunded)
            //{
            //    cmbBlock.Visible = false;
            //    cmbProject.Visible = false;
            //    lblProject.Visible = false;
            //    lblBlock.Visible = false;
            //    //txtSearchValue.Visible = false;
            //    //lblValue.Visible = false;
            //    //btnFilter.Visible = false;
            //    lstMemberRegistration = da.GetMemberForRefund();
            //    PopulateGrid(lstMemberRegistration);


            //}
            //else
            //{

            //}

            #endregion
        }
Exemplo n.º 4
0
        private clsMemberShipFilter MakeFilter()
        {
            clsMemberShipFilter filter = new clsMemberShipFilter();

            filter.strProjectID = cmbProject.Text;
            filter.strBlockNo   = cmbBlock.Text;
            if (cmbAllocated.Text == "Allocated")
            {
                filter.bAllocated = true;; filter.bFilterAllocated = true;
            }
            else if (cmbAllocated.Text == "Unallocated")
            {
                filter.bAllocated = false;; filter.bFilterAllocated = true;
            }
            else if (cmbAllocated.Text == "All")
            {
                filter.bAllocated = false; filter.bFilterAllocated = false;
            }

            if (cmbStatus.Text == "All")
            {
                filter.membershipStatus = memberLookupCodes.All;
            }
            else if (cmbStatus.Text == "New")
            {
                filter.membershipStatus = memberLookupCodes.New;
            }
            else if (cmbStatus.Text == "Cancelled")
            {
                filter.membershipStatus = memberLookupCodes.Cancelled;
            }
            else if (cmbStatus.Text == "Refunded")
            {
                filter.membershipStatus = memberLookupCodes.Refunded;
            }
            else if (cmbStatus.Text == "Reactivated")
            {
                filter.membershipStatus = memberLookupCodes.Reactivate;
            }
            else if (cmbStatus.Text == "Transferred")
            {
                filter.membershipStatus = memberLookupCodes.Transferred;
            }

            if (cmbSearchBy.Text == "Membership ID")
            {
                filter.strMemberShipID = txtSearchValue.Text.Trim();
            }
            else if (cmbSearchBy.Text == "Client ID")
            {
                filter.strClientID = txtSearchValue.Text.Trim();
            }
            else if (cmbSearchBy.Text == "Member Name")
            {
                filter.strName = txtSearchValue.Text.Trim();
            }
            else if (cmbSearchBy.Text == "Unit ID")
            {
                filter.strUnitID = txtSearchValue.Text.Trim();
            }

            filter.bForProcess = this.bForProcess;

            return(filter);
        }