Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["user"] == null)
     {
         Response.Redirect("~/Default.aspx");
     }
     else
     {
         if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.CloseEducationalYear, Request.Cookies["user"]["Permission"].ToString()))
         {
             Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
         }
     }
     if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
     {
         FinancialYear year = new FinancialYear();
         year.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
         lblYearName.Text      = year.Name;
         lblYearStartDate.Text = year.StartDate.ToShortDateString();
         lblYearEndDate.Text   = year.EndDate.ToShortDateString();
         lblDes.Text           = year.Description;
         DataTable dt = year.getTrailBalance();
         ASPxGridView1.DataSource = dt;
         ASPxGridView1.DataBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["user"] == null)
            {
                Response.Redirect("~/Default.aspx");
            }
            else
            {
                if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.ViewFinancialYear, Request.Cookies["user"]["Permission"].ToString()))
                {
                    Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
                }
            }
            if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
            {
                FinancialYear year = new FinancialYear();
                year.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                lblYearID.Text        = year.ID.ToString();
                lblYearName.Text      = year.Name;
                lblYearStartDate.Text = year.StartDate.ToShortDateString();
                lblYearEndDate.Text   = year.EndDate.ToShortDateString();
                txtDes.Text           = year.Description;

                lblLastModifiedDate.Text = year.LastModifiedDate.ToShortDateString();
            }
        }
Beispiel #3
0
        protected void btnClose_Click(object sender, EventArgs e)
        {
            FinancialYear year = new FinancialYear();

            year.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
            year.CloseYear();
            Response.Redirect("~/Finance_Module/FinancialYears.aspx");
        }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["user"] == null)
     {
         Response.Redirect("~/Default.aspx");
     }
     else
     {
         if (!new UserSecurity().CheckFormPermission((int)Global.formSecurity.CreateFinancialYear, Request.Cookies["user"]["Permission"].ToString()))
         {
             Response.Redirect("~/Finance_Module/UnAuthorized.aspx");
         }
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["alert"] == "notpass")
         {
             Response.Write("<script>alert('لم يتم الحفظ');</script>");
         }
         if (Request.QueryString != null && Request.QueryString.AllKeys.Contains("id"))
         {
             if (Request.QueryString["id"].ToString() != null)
             {
                 if (Convert.ToInt32(Request.QueryString["id"].ToString()) > 0)
                 {
                     FinancialYear year = new FinancialYear();
                     year.get(Convert.ToInt32(Request.QueryString["id"].ToString()));
                     txtYearName.Text  = year.Name;
                     txtStartDate.Text = year.StartDate.ToShortDateString();
                     txtEndDate.Text   = year.EndDate.ToShortDateString();
                     txtDesc.Text      = year.Description;
                     //txtstartingBalance.Text = bank.InitialBalance.ToString();
                     btnSave.Visible = false;
                     btnEdit.Visible = true;
                 }
                 else
                 {
                     btnSave.Visible = true;
                     btnEdit.Visible = false;
                 }
             }
         }
     }
 }