Ejemplo n.º 1
0
        private void _GridViewBind()
        {
            ClaimDetail = (Claim)ViewState["Claim"];
            if (ClaimDetail.Expenses == null)
            {
                SystemLogin sl = new SystemLogin();
                foreach (Claim cl in sl.GetAllClaim())
                {
                    if (cl.ID == Convert.ToInt32(HFClaimID.Value))
                    {
                        ClaimDetail = cl;
                    }
                }
            }
            else if (ClaimDetail.Expenses != null)
            {
                if (ClaimDetail.Expenses.Count == 0)
                {
                    // ClaimDetail.Expenses.Add(new Expenses());
                }

                this.pnlAddEdit.Visible = true;
                gw_ForEdit.DataSource   = ClaimDetail.Expenses;
                gw_ForEdit.DataBind();
            }
            else
            {
                this.pnlAddEdit.Visible = false;
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["User"] == null)
                {
                    Server.Transfer("LoginPage.aspx", true);
                }

                SystemLogin logs = new SystemLogin();
                Claims            = logs.GetAllClaim();
                Session["Claims"] = Claims;
                _GridViewBind();
            }
        }
Ejemplo n.º 3
0
        private Claim _GetClaim(int ID)
        {
            if (Claims == null)
            {
                SystemLogin logs = new SystemLogin();
                Claims            = logs.GetAllClaim();
                Session["Claims"] = Claims;
            }

            Claim claim = new Claim();

            foreach (Claim c in Claims)
            {
                if (c.ID == ID)
                {
                    claim = c;
                }
            }

            return(claim);
        }
Ejemplo n.º 4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ClaimDetail = (Claim)ViewState["Claim"];

            if (lblID.Text == "0")
            {
                Expenses expenses = new Expenses();
                expenses.ClaimID = ClaimDetail.ID;
                expenses.User    = ClaimDetail.User;
                _AssignData(expenses);
            }
            else
            {
                foreach (Expenses expenses in ClaimDetail.Expenses)
                {
                    if (expenses.Id.ToString() == lblID.Text)
                    {
                        _AssignData(expenses);
                        //expenses.Id = Convert.ToInt32(txtID.Text);

                        break;
                    }
                }
            }

            SystemLogin sl = new SystemLogin();

            foreach (Claim cl in sl.GetAllClaim())
            {
                if (ClaimDetail.ID == cl.ID)
                {
                    ClaimDetail = cl;
                }
            }

            ViewState["Claim"] = ClaimDetail;
            mp1.Hide();
            _GridViewBind();
            Response.Redirect("ClaimForm.aspx");
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["User"] == null)
                {
                    Server.Transfer("LoginPage.aspx", true);
                }

                ClaimDetail = (Claim)Session["Claim"];

                SystemLogin sl = new SystemLogin();
                foreach (Claim cl in sl.GetAllClaim())
                {
                    if (cl.ID == ClaimDetail.ID)
                    {
                        ClaimDetail = cl;
                    }
                }

                HFClaimID.Value    = ClaimDetail.ID.ToString();
                ViewState["Claim"] = ClaimDetail;
                _PopulateClaimDetails();
                if (ClaimDetail.Expenses == null)
                {
                    ClaimDetail.Expenses = new List <Expenses>();
                    ClaimDetail.Expenses.Sort();

                    ViewState["Expenses"] = ClaimDetail.Expenses;
                }

                _GridViewBind();
                _PopulateDetails(new Expenses());

                btnAddExpenses.Enabled = ClaimDetail.ID > 0;
            }
        }