Пример #1
0
        //FileUpload

        #region FileUploadRegion

        protected void btnImportData_Click(object sender, EventArgs e)
        {
            try
            {// int orgID = Convert.ToInt32(Session["OrgId"]);
                //string SelectDate = txtDate.Text;
                if (AttFileUpload.HasFile)
                {
                    try
                    {
                        ViewState["filename"] = Path.GetFileName(AttFileUpload.FileName);
                        string filename = ViewState["filename"].ToString();
                        AttFileUpload.SaveAs(Server.MapPath("~/UploadFile/") + filename);
                        //StatusLabel.Text = "Upload status: File uploaded!";
                        msgBox.ShowMessage("File uploaded Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        GrdAttendanceReport.DataSource = FetchData();
                        GrdAttendanceReport.DataBind();
                        btnSave.Visible = true;
                    }
                    catch (Exception ex)
                    {
                        StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
                    }
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #2
0
        //Page Indext Created

        #region GrdIndexChanged

        protected void GrdAttendanceReport_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                GrdAttendanceReport.PageIndex = e.NewPageIndex;

                GrdAttendanceReport.DataSource = FetchData();
                GrdAttendanceReport.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }