コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindUsers();



                //Changing the mode view
                ChangeMode(Business.Util.Mode.GetAction(Request.QueryString["mode"]));


                if (Request.QueryString["DataPagamento"] != null)
                {
                    DateTime date = Convert.ToDateTime(Request.QueryString["DataPagamento"]);

                    Model.Boloes.Pagamento entry = new BolaoNet.Model.Boloes.Pagamento(
                        CurrentBolao.Nome, Request["UserName"].ToString(), date);

                    Business.Boloes.Support.Pagamento business = new BolaoNet.Business.Boloes.Support.Pagamento(base.UserName);
                    business.Copy(entry);

                    business.Load();

                    entry = (Model.Boloes.Pagamento)business;

                    //Pagamento = entry;
                    //ViewState["entry"] = Pagamento;

                    ShowPagamento(entry);
                }
            }
        }
コード例 #2
0
        private void BindPagamentos()
        {
            Business.Boloes.Support.Pagamento business = new BolaoNet.Business.Boloes.Support.Pagamento(base.UserName);
            business.Bolao = CurrentBolao;
            IList <Framework.DataServices.Model.EntityBaseData> list = business.SelectAllByBolao(CurrentBolao, null);

            this.grdPagamentos.DataSource = list;
            this.grdPagamentos.DataBind();
        }
コード例 #3
0
        private void Delete(string parameters)
        {
            string[] paramItems = parameters.Split(new char [] { '|' });

            Business.Boloes.Support.Pagamento business = new BolaoNet.Business.Boloes.Support.Pagamento(base.UserName);
            business.Bolao         = new BolaoNet.Model.Boloes.Bolao(paramItems[0]);
            business.UserName      = paramItems[1];
            business.DataPagamento = Convert.ToDateTime(paramItems[2]);

            if (!business.Delete())
            {
                base.ShowErrors("Não foi possível excluir o pagamento.");
            }
            else
            {
                BindPagamentos();
            }
        }
コード例 #4
0
        private void Save()
        {
            Validate("UpdateItem");

            if (!IsValid)
            {
                return;
            }



            Business.Boloes.Support.Pagamento business = new BolaoNet.Business.Boloes.Support.Pagamento(base.UserName);
            business.Copy(GetPagamento());


            if (Business.Util.Mode.GetAction(Request.QueryString["mode"]) == BolaoNet.Business.Util.ActionMode.Insert)
            {
                if (business.Insert())
                {
                    base.ShowMessages("Pagamento inserido com sucesso.");
                }
                else
                {
                    base.ShowErrors("Erro ao inserir o pagamento.");
                }
            }
            else
            {
                if (business.Update())
                {
                    base.ShowMessages("Pagamento atualizado com sucesso.");
                }
                else
                {
                    base.ShowErrors("Erro ao realizar update do pagamento.");
                }
            }
        }