Beispiel #1
0
        //protected void BindStatus()
        //{

        //    //Create blank list
        //    List<accountstatu> list = new List<accountstatu>();

        //    //Fill list
        //    list = App_Code.AccountStatusService.GetObjects();

        //    //Bind DDL
        //    ddlStatus.DataSource = list;
        //    ddlStatus.DataValueField = "account_status";
        //    ddlStatus.DataTextField = "account_status";
        //    ddlStatus.DataBind();
        //    //Country.SelectedValue = "Default";


        //}

        protected void BindPayments()
        {
            //Get the logged in User if any
            MembershipUser LoggedInMembershipUser;

            LoggedInMembershipUser = Membership.GetUser();

            //Check if there is a logged in User
            if (LoggedInMembershipUser != null)
            {
                // ToInt32 can throw FormatException or OverflowException.
                int UserId = -1;

                try
                {
                    //Get the RALT data from membership accountID
                    UserId = Convert.ToInt32(LoggedInMembershipUser.ProviderUserKey.ToString());
                    user           UserData = UserService.GetUserByMemberId(UserId);
                    List <payment> Payments;

                    Payments = App_Code.PaymentService.GetObjectsByUserId(UserData.user_id);

                    GridPayments.DataSource = Payments;
                    GridPayments.DataBind();
                }
                catch { }
            }
        }
Beispiel #2
0
        protected void BindPayments()
        {
            UserData = (user)Session["UserData"];

            List <payment> Payments;

            Payments = App_Code.PaymentService.GetObjectsByUserId(UserData.user_id);

            GridPayments.DataSource = Payments;
            GridPayments.DataBind();
        }
        private void BtnReport_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog Path = new SaveFileDialog();

            GridPayments.SelectAllCells();
            GridPayments.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
            ApplicationCommands.Copy.Execute(null, GridPayments);
            String resultat = (string)Clipboard.GetData(DataFormats.CommaSeparatedValue);

            GridPayments.UnselectAllCells();
            Path.FileName   = "report";
            Path.DefaultExt = ".csv";
            Path.Filter     = "Csv documents (.csv)|*.csv";
            Nullable <bool> result   = Path.ShowDialog();
            string          filename = Path.FileName;
            StreamWriter    file1    = new StreamWriter(Path.FileName);

            file1.WriteLine(resultat);
            file1.Close();
        }