예제 #1
0
        /// <summary>
        /// Added By : Himanshu Pandya
        /// Date : 30-12-2012
        /// Desc : Fill Customer Details from Cearch Search Popup
        /// </summary>
        public void BindCustomerDetails(Int64 CustomerId)
        {
            DataTable dtCustomer;
            try
            {
                if (CustomerId > 0)
                {
                    ObjCust = new clsCustomer();
                    dtCustomer = new DataTable();
                    ObjCust.CustomerId = CustomerId;
                    dtCustomer = ObjCust.General_SearcheAllCustomerWSearchFilters();
                    if (dtCustomer.Rows.Count > 0)
                    {
                        //Fill Customer Details
                        hdnCustomerId.Value = Convert.ToString(CustomerId);
                        txtCustomerNo.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["CustomerCode"].ToString()) ? dtCustomer.Rows[0]["CustomerCode"].ToString() : string.Empty;
                        ddlCustomerPrefix.SelectedIndex = ddlCustomerPrefix.Items.IndexOf(ddlCustomerPrefix.Items.FindByText(dtCustomer.Rows[0]["NamePrifix"].ToString()));
                        txtFirstName.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["FirstName"].ToString()) ? dtCustomer.Rows[0]["FirstName"].ToString() : string.Empty;
                        txtMiddleName.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["MiddleName"].ToString()) ? dtCustomer.Rows[0]["MiddleName"].ToString() : string.Empty;
                        txtLastName.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["LastName"].ToString()) ? dtCustomer.Rows[0]["LastName"].ToString() : string.Empty;
                        txtCustomerServiceYear.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["EmploymentYear"].ToString()) ? dtCustomer.Rows[0]["EmploymentYear"].ToString() : string.Empty;
                        txtCusotmerRetirementDate.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["RetirementYear"].ToString()) ? dtCustomer.Rows[0]["RetirementYear"].ToString() : string.Empty;
                        txtCustomerSalary.Text = !string.IsNullOrEmpty(dtCustomer.Rows[0]["Salary"].ToString()) ? CommonFunctions.FormatMoneyString(Convert.ToDecimal(dtCustomer.Rows[0]["Salary"])) : string.Empty;

                        hdnBindLoanData.Value = string.Empty;
                    }
                }
            }
            catch
            { }
            finally
            {
                ObjCust = new clsCustomer();
                dtCustomer = new DataTable();
            }
        }