コード例 #1
0
    protected void Yes(object sender, EventArgs e)
    {
        DUPLICATEBL.clearall();
        Session ["clr"] = "1";

        Response.Redirect("verifydata.aspx");
    }
コード例 #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int cnt2 = updatedatadesc.getcount();

        if (cnt2 == 0)
        {
            LinkButton1.Visible = false;
            int j = DUPLICATEBL.chkempty();
            if (j == 1)
            {
                string userid = Session["uname"].ToString();
                int    i      = metadatasavebl.updateverification(userid);
                if (i == 1)
                {
                    Session["clr"] = "2";
                    Response.Redirect("verifydata.aspx");
                    //jscall("Data Verified");
                }
            }
            else
            {
                jscall("No data for verification. First Prepare Data");
            }
        }
        else
        {
            LinkButton1.Visible     = true;
            LinkButton1.Text        = "Please update description first";
            LinkButton1.PostBackUrl = "updatedesclist.aspx";
            jscall1("update description first");
        }
    }
コード例 #3
0
    protected void LinkButton10_Click(object sender, EventArgs e)
    {
        // Response.Redirect("adminlogin.aspx");
        int i = DUPLICATEBL.chkempty();


        if (i == 1)
        {
            int j = DUPLICATEBL.chkverfied();
            if (j == 1)
            {
                int k = DUPLICATEBL.chkuser();

                if (k < 1)
                {
                    lbllogin.Text = "Enter Administrator's userid password for accessing data";
                }
                popup.Show();
                txtuser.Text = " ";
                txtuser.Focus();
            }
            else
            {
                jscall1("First Verify Data");
            }
        }
        else
        {
            jscall1("No data for uploading first prepare it");
        }
    }
コード例 #4
0
    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        int j = DUPLICATEBL.chktruncate();

        if (j == 1)
        {
            int k = DUPLICATEBL.chkuser();

            if (k < 1)
            {
                lbllogin.Text = "Enter Administrator's userid password for accessing data";
            }
            //  popup.Show();
            Div1.Visible        = true;
            truncatediv.Visible = false;
            pnltruncate.Height  = 130;
            Panel1.Visible      = true;

            paneltruncate.Visible = false;
            truncatepopup.Show();
            TextBox1.Focus();
        }
        else
        {
            jscall("Database is already empty");
        }
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Label obj_lbl = Master.FindControl("lbltitle") as Label;

        obj_lbl.Text = "Display Prepared Data";
        int location = DUPLICATEBL.getlocation();

        lnklocation.Text = location.ToString();

        int parameter = DUPLICATEBL.getparameter();

        lnkparameter.Text = parameter.ToString();

        DataTable msngdt = DUPLICATEBL.getmisng();

        gridview1.DataSource = msngdt;
        gridview1.DataBind();
        lnklocation.Focus();
        if (!IsPostBack)
        {
            string SaveLocation1 = Server.MapPath("~/Upload") + "\\" + "Units1.mdb";
            int    cnt           = updatedatadesc.updatedesc(SaveLocation1);
            //int cnt = 0;
            if (cnt == 0)
            {
            }
            else

            //int cnt = 0;
            //jscall1("Data Prepared Successfully");
            if (cnt > 0)
            {
                LinkButton1.Visible     = true;
                LinkButton1.Text        = "Please update description first";
                LinkButton1.PostBackUrl = "updatedesclist.aspx";
                jscall("update description first");
            }
        }
    }
コード例 #6
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        int i = DUPLICATEBL.chkempty();

        if (i == 1)
        {
            int j = DUPLICATEBL.chkverfied();
            if (j != 1)
            {
                popup.Show();
            }
            else
            {
                jscall("Data is already verified");
            }
        }
        else
        {
            jscall("No Data For cancellation");
        }
        //DUPLICATEBL.clearall();
        //jscall("Data Cleared. Again Prepare Data");
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Label obj_lbl = Master.FindControl("lbltitle") as Label;

        obj_lbl.Text = "New added data";
        string value = (string)Session["value"];

        if (value == "location")
        {
            parameterrow.Visible = false;
            DataTable dt = DUPLICATEBL.getlocationdet();

            gridview1.DataSource = dt;
            gridview1.DataBind();
        }
        else if (value == "parameter")
        {
            locationrow.Visible = false;
            DataTable dt = DUPLICATEBL.getparameterdet();
            gridview2.DataSource = dt;
            gridview2.DataBind();
        }
    }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Label obj_lbl = Master.FindControl("lbltitle") as Label;

        obj_lbl.Text = "Verify Data";
        int cnt = DUPLICATEBL.chkverfied();

        if (cnt != 1)
        {
            int location = DUPLICATEBL.getlocation();
            lnklocation.Text = location.ToString();

            int parameter = DUPLICATEBL.getparameter();
            lnkparameter.Text = parameter.ToString();

            DataTable msngdt = DUPLICATEBL.getmisng();

            gridview1.DataSource = msngdt;
            gridview1.DataBind();
        }
        else
        {
            lnklocation.Text     = "0";
            lnkparameter.Text    = "0";
            gridview1.DataSource = null;
            gridview1.DataBind();
        }
        if (!IsPostBack)
        {
            if (Session["uname"] != null || Session["password"] != null)
            {
                //  txtfromdt.Focus();
                int cnt1 = updatedatadesc.getcount();
                if (cnt1 == 0)
                {
                    LinkButton1.Visible = false;
                }
                else
                {
                    LinkButton2.Visible     = true;
                    LinkButton2.Text        = "Please update description first";
                    LinkButton2.PostBackUrl = "updatedesclist.aspx";
                    jscall1("update description first");
                }
            }
            else if (Session["uname"] == null || Session["password"] == null)
            {
                Response.Redirect("adminlogin.aspx");
            }
        }


        if (Session["clr"] != null)
        {
            string clr = Session["clr"].ToString();
            if (clr == "1")
            {
                Session["clr"] = null;
                jscall("Data Cleared. Again Prepare Data");
            }
            else if (clr == "2")
            {
                cnt            = DUPLICATEBL.chkverfied();
                Session["clr"] = null;
                if (cnt > 0)
                {
                    jscall("Data verified successfully");
                }
            }
        }
    }
コード例 #9
0
    protected void btnprepare_Click(object sender, EventArgs e)
    {
        Page.Validate();
        if (Page.IsValid == true)
        {
            int i = DUPLICATEBL.chkempty();//function for cheking that temp database is empty or not

            //if (i == 1)
            if (i >= 0)
            {
                FileName = System.IO.Path.GetFileNameWithoutExtension(FileUpload1.PostedFile.FileName);
                if ((FileUpload1.PostedFile != null) && (FileUpload1.PostedFile.ContentLength > 0))
                {
                    FileName     = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
                    SaveLocation = Server.MapPath("~/Upload") + " \\" + FileName;
                    if (File.Exists(SaveLocation))
                    {
                        //try
                        //{
                        //    //File.Delete(SaveLocation);
                        //}
                        //catch (Exception exc)
                        //{
                        //   // jscall("File is in use" + exc.Message.ToString());
                        //}
                        //finally
                        //{
                        //    System.Diagnostics.Process[] wordInstances = System.Diagnostics.Process.GetProcessesByName("WINWORD");
                        //    foreach (System.Diagnostics.Process wordInstance in wordInstances)
                        //    {
                        //        wordInstance.Kill();
                        //    }
                        //}
                    }
                    try
                    {
                        FileUpload1.PostedFile.SaveAs(SaveLocation);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }

                SaveLocation = Server.MapPath("~/Upload") + "\\" + FileName;


                //string path1 = Server.MapPath("~/Upload") + "\\" + "data for WEB Site.mdb";
                filechk = DUPLICATEBL.chkfile(SaveLocation);

                ViewState["filechk"] = filechk;
                if (filechk == 0)
                {
                    chk = DUPLICATEBL.chknewentry(SaveLocation, ddltype.SelectedValue);
                }
                chk = 1;
                if (chk > 0)
                {
                    popup.Show();
                }
                else
                {
                    startprepare();
                    jscall("Data Prepared Successfully");
                }
            }
            else
            {
                jscall("first Upload Previous data");
            }
        }
        else
        {
            jscall1("check validations");
        }


        #region unwanted code
        // cmd.Connection = conn;
        // cmd.CommandText = "select REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT,BASIN,RIVERNAME,TRIBUTARY,CATCH,LATITUDE,LONGITUDE,ALTITUDE,CATAREA,TOPOSHEET,AGENCY,REGOFFICE,CIRCOFFICE,DIVOFFICE,SUBDIVOFFICE,SECTOFFICE,REMARKS,OWNERAGENCY,STARTDATE,ENDDATE,LOCALXCOORD,LOCALYCOORD from "+filename1 +".Location";

        // int i = (int)cmd.ExecuteScalar();

        //OleDbDataReader rdr=null;
        // rdr = cmd.ExecuteReader();


        // while (rdr.Read())
        // {

        //     SqlConnection sqlcon = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Documents and Settings\\Administrator\\Desktop\\Hydro project\\App_Data\\Hydro.mdf;Integrated Security=True;User Instance=True");
        //     sqlcon.Open();
        //     SqlCommand cmd1 = new SqlCommand("insert into Location( REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT) values ('"+ rdr[0].ToString() + "','" + rdr[1].ToString() + "','" + rdr[2].ToString() + "','" + rdr[3].ToString() + "','" + rdr[4].ToString() + "' ) ", sqlcon);
        //     cmd1.ExecuteNonQuery();
        // }
        // rdr.Close();
        //       string a = conn.Database;
        //       //dbConn.Open();
        //       SqlConnection consql = new SqlConnection(DBConnection);
        //       SqlCommand cmdsql = new SqlCommand();
        //       consql.Open();
        //       cmdsql.Connection = consql;

        //       string b = consql.Database;
        //     cmdsql.CommandText = "insert into HYDRO.Location ( REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT,BASIN,RIVERNAME,TRIBUTARY,CATCH,LATITUDE,LONGITUDE,ALTITUDE,CATAREA,TOPOSHEET,AGENCY,REGOFFICE,CIRCOFFICE,DIVOFFICE,SUBDIVOFFICE,SECTOFFICE,REMARKS,OWNERAGENCY,STARTDATE,ENDDATE,LOCALXCOORD,LOCALYCOORD) select REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT,BASIN,RIVERNAME,TRIBUTARY,CATCH,LATITUDE,LONGITUDE,ALTITUDE,CATAREA,TOPOSHEET,AGENCY,REGOFFICE,CIRCOFFICE,DIVOFFICE,SUBDIVOFFICE,SECTOFFICE,REMARKS,OWNERAGENCY,STARTDATE,ENDDATE,LOCALXCOORD,LOCALYCOORD from " + a+".Location";

        //// cmdsql.CommandText="insert Location( REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT,BASIN,RIVERNAME,TRIBUTARY,CATCH,LATITUDE,LONGITUDE,ALTITUDE,CATAREA,TOPOSHEET,AGENCY,REGOFFICE,CIRCOFFICE,DIVOFFICE,SUBDIVOFFICE,SECTOFFICE,REMARKS,OWNERAGENCY,STARTDATE,ENDDATE,LOCALXCOORD,LOCALYCOORD) select (REALSTAT,STATNAME,COUNTRY,PROVINCE,SUBDISTRICT,BASIN,RIVERNAME,TRIBUTARY,CATCH,LATITUDE,LONGITUDE,ALTITUDE,CATAREA,TOPOSHEET,AGENCY,REGOFFICE,CIRCOFFICE,DIVOFFICE,SUBDIVOFFICE,SECTOFFICE,REMARKS,OWNERAGENCY,STARTDATE,ENDDATE,LOCALXCOORD,LOCALYCOORD) from "+filename1+".Location";

        //      cmdsql.ExecuteNonQuery();

        //cmdsql.CommandText = "select count(*) from Location";
        //int i = (int)cmdsql.ExecuteScalar();



        //conn.Close();

        #endregion
    }