Exemple #1
0
 protected void btntesdiq_Click(object sender, EventArgs e)
 {
     //exampleInputEmail.Text = Config.Sha1(exampleInputPassword.Text.ToString());
     try
     {
         ClSsql     clSsql = new ClSsql();
         SqlCommand cmd    = new SqlCommand("Select * from UserAdmin where Login_name=@Login_name and Passvord=@Passvord", clSsql.sqlconn);
         cmd.Parameters.AddWithValue("Login_name", exampleInputEmail.Text.ToString());
         cmd.Parameters.AddWithValue("Passvord", Config.Sha1(exampleInputPassword.Text.ToString()));
         clSsql.sqlconn.Open();
         SqlDataAdapter dap = new SqlDataAdapter(cmd);
         DataTable      dt  = new DataTable();
         dap.Fill(dt);
         clSsql.sqlconn.Close();
         if (dt.Rows.Count > 0)
         {
             Session["UsersID1"]        = int.Parse(dt.Rows[0]["ID"].ToString());
             Session["ElmiMuessiseID1"] = int.Parse(dt.Rows[0]["ElmiMuessiseID"].ToString());
             Session["AdminStatus1"]    = int.Parse(dt.Rows[0]["AdminStatus"].ToString());
             Response.Redirect("Home.aspx");
         }
     }
     catch (SqlException ex)
     {
         throw new Exception(ex.Message + "(" + ex.Message + ")");
     }
     //catch
     //{
     //    Response.Redirect("Login.aspx");
     //}
 }
 protected void RPRegstrKadr_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Tesdiq")
     {
         SqlCommand cmd = new SqlCommand("Update TbShexsiProfil set Tesdiq=2 where ID=" + e.CommandArgument.ToString(), clSsql.sqlconn);
         clSsql.sqlconn.Open();
         cmd.ExecuteNonQuery();
         clSsql.sqlconn.Close();
         ClSsql.MsgBox("Məlumat təsdiqləndi!", this.Page);
     }
     else if (e.CommandName == "Geriqaytar")
     {
         SqlCommand cmd = new SqlCommand("Update TbShexsiProfil set Tesdiq=0 where ID=" + e.CommandArgument.ToString(), clSsql.sqlconn);
         clSsql.sqlconn.Open();
         cmd.ExecuteNonQuery();
         clSsql.sqlconn.Close();
         ClSsql.MsgBox("Məlumat geri göndərildi!", this.Page);
     }
     else if (e.CommandName == "Sil")
     {
         SqlCommand cmd = new SqlCommand("Delete from TbShexsiProfil where ID=" + e.CommandArgument.ToString(), clSsql.sqlconn);
         clSsql.sqlconn.Open();
         cmd.ExecuteNonQuery();
         clSsql.sqlconn.Close();
         ClSsql.MsgBox("Məlumat silindi!", this.Page);
     }
 }
Exemple #3
0
    protected void btnLogIn_ServerClick(object sender, EventArgs e)
    {
        if (DDLElmiMuessise.SelectedIndex > 0 && EmailText.Text != "" && PassText.Text != "" && PassTextAgain.Text != "" && PassText.Text == PassTextAgain.Text)
        {
            try
            {
                if (clSsql.getDT("Select * from UsersTB where Login_name=N'" +
                                 EmailText.Text.ToString() + "'").Rows.Count == 0)
                {
                    SqlCommand cmd = new SqlCommand("insert into UsersTB " +
                                                    "(Login_name,Passvord,ElmiMuessiseID,ForDelete) values " +
                                                    "(@Login_name,@Passvord,@ElmiMuessiseID,@ForDelete)", clSsql.sqlconn);
                    cmd.Parameters.AddWithValue("Login_name", EmailText.Text.ToString());
                    cmd.Parameters.AddWithValue("Passvord", Config.Sha1(PassText.Text.ToString()));
                    cmd.Parameters.AddWithValue("ElmiMuessiseID", DDLElmiMuessise.SelectedValue.ToString());
                    cmd.Parameters.AddWithValue("ForDelete", 1);
                    clSsql.sqlconn.Open();
                    cmd.ExecuteNonQuery();
                    clSsql.sqlconn.Close();
                    DataRow druser = clSsql.getDT("Select * from UsersTB where Login_name=N'" +
                                                  EmailText.Text.ToString() + "' and Passvord=N'" + Config.Sha1(PassText.Text.ToString()) + "'").Rows[0];
                    DataTable dtshProfil = clSsql.getDT("Select ID from TbShexsiProfil where UsersID=" + druser["ID"].ToString());
                    if (dtshProfil.Rows.Count == 0)
                    {
                        SqlCommand cmd1 = new SqlCommand("insert into TbShexsiProfil (ElmiMuessiseID,UsersID) values(@ElmiMuessiseID,@UsersID)", clSsql.sqlconn);
                        cmd1.Parameters.AddWithValue("ElmiMuessiseID", druser["ElmiMuessiseID"].ToString());
                        cmd1.Parameters.AddWithValue("UsersID", druser["ID"].ToString());
                        clSsql.sqlconn.Open();
                        cmd1.ExecuteNonQuery();
                        clSsql.sqlconn.Close();
                    }
                    lblMSG.Text = "Qeydiyyatdan uğurla keçdiniz! <br />Sistemə daxil olmaq üçün <a href='Login.aspx'>'Daxil olun'</a> linkini sıxın.";
                    //ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal()", true);
                }
                else
                {
                    ClSsql.MsgBox("Bu email sistemdə mövcuddur.", Page);
                }
            }
            catch
            {
                // ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "myFunctionError();", true);
                ClSsql.MsgBox("Xəta baş verdi", Page);
                //throw;
            }
            finally
            {
                // ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "myFunction();", true);
                //ShowMessage("Qeydiyyatdan uğurla keçdiniz!", MessageType.Success);

                // Response.Redirect("Login.aspx");
            }
        }
        else
        {
            ClSsql.MsgBox("Məlumatlar tam deyil", Page);
        }
    }
    protected void btnLogIn_ServerClick(object sender, EventArgs e)
    {
        if (PassText.Text != "" && PassTextAgain.Text != "" && PassText.Text == PassTextAgain.Text)
        {
            try
            {
                try
                {
                    id    = Request.QueryString["passwordchange"].ToString();
                    email = Request.QueryString["confirmvar"].ToString();
                }
                catch
                {
                }
                if (clSsql.getDT(@"Select * from UsersTB where Login_name=N'" + email + "' and ID=" + id).Rows.Count == 1)
                {
                    SqlCommand cmd = new SqlCommand("Update UsersTB set Passvord=@Passvord where ID=@id", clSsql.sqlconn);
                    cmd.Parameters.AddWithValue("Passvord", Config.Sha1(PassText.Text.ToString()));
                    cmd.Parameters.AddWithValue("id", id);
                    clSsql.sqlconn.Open();
                    cmd.ExecuteNonQuery();
                    clSsql.sqlconn.Close();
                    lblMSG.Text = "Şifrəniz dəyişdirildi! <br />Sistemə daxil olmaq üçün <a href='Login.aspx'>'Daxil olun'</a> linkini sıxın.";
                    //ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal()", true);
                }
                else
                {
                    ClSsql.MsgBox("Email -dən göndərilən məlumatlar yanlışdır.", Page);
                }
            }
            catch
            {
                // ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "myFunctionError();", true);
                ClSsql.MsgBox("Xəta baş verdi", Page);
                throw;
            }
            finally
            {
                // ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "myFunction();", true);
                //ShowMessage("Qeydiyyatdan uğurla keçdiniz!", MessageType.Success);

                // Response.Redirect("Login.aspx");
            }
        }
        else
        {
            ClSsql.MsgBox("Məlumatlar tam deyil", Page);
        }
    }
    protected void btnGiris_Click(object sender, EventArgs e)
    {
        DataRow drGiris1 = clSsql.getDT("Select * from Istifadechiler Where Shifre='" + Config.Sha1(txtparol.Text) + "' and IstifadeciAdi='" + txtlogin.Text + "' ").Rows[0];

        if (drGiris1 != null)
        {
            Session["UserID1"]   = drGiris1["UserID"].ToString();
            Session["passvord1"] = drGiris1["Shifre"].ToString();
            Response.Redirect("Homepage.aspx", true);
        }
        else
        {
            ClSsql.MsgBox("Şifrə yalnışdır!", Page);
        }
    }
Exemple #6
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        DataTable dt = clSsql.getDT("Select * from TbShexsiProfil where ad<>'' and Soyad<>'' and AtaAd<>'' and ID=" + Session["PersonalProfilID"].ToString());

        if (dt.Rows.Count > 0)
        {
            if (Session["PersonalTesdiq"].ToString() == "0")
            {
                SqlCommand cmd = new SqlCommand("Update TbShexsiProfil set Tesdiq=1 where ID=" + Session["PersonalProfilID"].ToString(), clSsql.sqlconn);
                clSsql.sqlconn.Open();
                cmd.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                Session["PersonalTesdiq"] = "1";
                ClSsql.MsgBox("Məlumat təsdiqləndi!", this.Page);
            }
        }
        else
        {
            ClSsql.MsgBox("Əsas şəxsi məlumatları daxil edin (Soyad, ad, ata adı)!", this.Page);
        }
    }
Exemple #7
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         ClSsql     clSsql = new ClSsql();
         SqlCommand cmd    = new SqlCommand("Select * from UsersTB where Login_name=@Login_name and Passvord=@Passvord", clSsql.sqlconn);
         cmd.Parameters.AddWithValue("Login_name", EmailText.Text.ToString());
         cmd.Parameters.AddWithValue("Passvord", Config.Sha1(PassText.Text.ToString()));
         clSsql.sqlconn.Open();
         SqlDataAdapter dap = new SqlDataAdapter(cmd);
         DataTable      dt  = new DataTable();
         dap.Fill(dt);
         clSsql.sqlconn.Close();
         if (dt.Rows.Count > 0)
         {
             Session["UsersID"]        = int.Parse(dt.Rows[0][0].ToString());
             Session["ElmiMuessiseID"] = int.Parse(dt.Rows[0][3].ToString());
             DataTable dtshexsiprofil = clSsql.getDT("select * from TbShexsiProfil where UsersID=" + Session["UsersID"].ToString());
             if (dtshexsiprofil.Rows.Count > 0)
             {
                 Session["PersonalProfilID"] = dtshexsiprofil.Rows[0][0].ToString();
                 Session["PersonalTesdiq"]   = dtshexsiprofil.Rows[0]["Tesdiq"].ToString();
                 Session["UsersName"]        = dtshexsiprofil.Rows[0][1].ToString() + " " + dtshexsiprofil.Rows[0][2].ToString();
                 Session["UsersNameMuellif"] = dtshexsiprofil.Rows[0][1].ToString() + " " + dtshexsiprofil.Rows[0][2].ToString() + " " + dtshexsiprofil.Rows[0][3].ToString();
                 Session["Foto"]             = dtshexsiprofil.Rows[0][8].ToString();
                 Response.Redirect("UserMain.aspx");
                 Session["txtAxtarMql"] = null;
                 Session["txtAxtar"]    = null;
             }
         }
     }
     catch (SqlException ex)
     {
         throw new Exception(ex.Message + "(" + ex.Message + ")");
     }
     //catch
     //{
     //    Response.Redirect("Login.aspx");
     //}
 }
Exemple #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (txtMeruzeninAdi.Text.Trim().Length > 2)
        {
            if (Session["ConfranceID"].ToString() == "0" && Session["PersonalProfilID"].ToString() != "0" && Session["PersonalProfilID"] != null)
            {
                SqlCommand cmd = new SqlCommand(@"insert into KonfranslardaIshtirak values(@MeruzeninAdi
      ,@KonfransinAdi
      ,@TypeOlkeBeynelxalq
      ,@Olke
      ,@TeshkilatinAdi
      ,@Cildi
      ,@CildNomre
      ,@KecrildiyiTarix
      ,@Sehifeilk
      ,@SehifeSon
      ,@LinkURL      
      ,@ShexsiProfilID
      ,@KonfransIndex
      ,@Muellifler
      ,@KonfIlkTarix
      ,@KonfSonTarix)", clSsql.sqlconn);
                cmd.Parameters.AddWithValue("MeruzeninAdi", txtMeruzeninAdi.Text);
                cmd.Parameters.AddWithValue("KonfransinAdi", txtKonfransinAdi.Text);
                cmd.Parameters.AddWithValue("Olke", DDLOlke.SelectedValue);
                cmd.Parameters.AddWithValue("TeshkilatinAdi", txtTeshkilatAdi.Text);
                cmd.Parameters.AddWithValue("Cildi", txtCildi.Text);
                cmd.Parameters.AddWithValue("CildNomre", txtCildNomre.Text);
                cmd.Parameters.AddWithValue("KecrildiyiTarix", 0);
                cmd.Parameters.AddWithValue("Sehifeilk", txtsehifeIlk.Text);
                cmd.Parameters.AddWithValue("SehifeSon", txtsehifeSon.Text);
                cmd.Parameters.AddWithValue("LinkURL", txtLink.Text);
                cmd.Parameters.AddWithValue("TypeOlkeBeynelxalq", DDLStatusu.SelectedValue);
                cmd.Parameters.AddWithValue("ShexsiProfilID", Session["PersonalProfilID"].ToString());
                cmd.Parameters.AddWithValue("KonfransIndex", DDLIndexs.SelectedValue);
                string s = "";
                foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                {
                    s += txtmuellifarray.Text + ", ";
                }
                if (s.Length > 2)
                {
                    s = s.Substring(0, s.Length - 2);
                }
                cmd.Parameters.AddWithValue("Muellifler", s);
                DateTime d;
                if (DateTime.TryParse((DateIlkTarix.Text).ToString(), out d) == true)
                {
                    cmd.Parameters.AddWithValue("KonfIlkTarix", DateTime.Parse(DateIlkTarix.Text).ToString("yyyy-MM-dd"));
                }
                else
                {
                    cmd.Parameters.AddWithValue("KonfIlkTarix", DBNull.Value);
                }

                if (DateTime.TryParse((DateSonTarix.Text).ToString(), out d) == true)
                {
                    cmd.Parameters.AddWithValue("KonfSonTarix", DateTime.Parse(DateSonTarix.Text).ToString("yyyy-MM-dd"));
                }
                else
                {
                    cmd.Parameters.AddWithValue("KonfSonTarix", DBNull.Value);
                }
                clSsql.sqlconn.Open();
                cmd.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                int     n  = 0;
                DataRow dr = clSsql.getDT(@"Select * from KonfranslardaIshtirak where ID=(select MAX(ID) from KonfranslardaIshtirak  where ShexsiProfilID=" + Session["PersonalProfilID"].ToString() + ")").Rows[0];
                Session["ConfranceID"] = dr["ID"].ToString();
                if (Session["ConfranceID"] != null)
                {
                    foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                    {
                        n++;
                        TextBox t  = (TextBox)NumdivMuellif.FindControl("NomTxtMuellif" + n.ToString());
                        TextBox t1 = (TextBox)divMuellif.FindControl("TxtMuellif" + n.ToString());
                        if (t.Text != "")
                        {
                            insertMuellif(t1.Text, int.Parse(t.Text));
                        }
                        else
                        {
                            insertMuellif(t1.Text, 1);
                        }
                    }
                }
                ViewState["addedBooks"] = 0;
                if (Session["txtAxtar"] != null)
                {
                    txtAxtar.Text = Session["txtAxtar"].ToString();
                }
                GetConfrance(txtAxtar.Text);
                txtMeruzeninAdi.Text  = "";
                txtKonfransinAdi.Text = "";
                DDLOlke.SelectedIndex = 0;
                txtCildi.Text         = "";
                txtCildNomre.Text     = "";
                txtTeshkilatAdi.Text  = "";
                txtsehifeIlk.Text     = "";
                txtsehifeSon.Text     = "";
                txtLink.Text          = "";
                // txtHemmuellif.Text = "";
                DateSonTarix.Text        = "";
                DateIlkTarix.Text        = "";
                DDLStatusu.SelectedIndex = 0;
                DDLIndexs.SelectedIndex  = 0;
                Response.Redirect(Request.Url.AbsoluteUri);
            }
            else if (Session["ConfranceID"].ToString() != "0" && Session["PersonalProfilID"].ToString() != "0" && Session["PersonalProfilID"] != null)
            {
                SqlCommand cmd = new SqlCommand(@"Update KonfranslardaIshtirak set MeruzeninAdi=@MeruzeninAdi
      ,KonfransinAdi=@KonfransinAdi
      ,TypeOlkeBeynelxalq=@TypeOlkeBeynelxalq
      ,Olke=@Olke
      ,TeshkilatinAdi=@TeshkilatinAdi
      ,Cildi=@Cildi
      ,CildNomre=@CildNomre
      ,KecrildiyiTarix=@KecrildiyiTarix
      ,Sehifeilk=@Sehifeilk
      ,SehifeSon=@SehifeSon
      ,LinkURL=@LinkURL
      ,ShexsiProfilID=@ShexsiProfilID
      ,KonfransIndex=@KonfransIndex
      ,Muellifler=@Muellifler
      ,KonfIlkTarix=@KonfIlkTarix
      ,KonfSonTarix=@KonfSonTarix
      where ID=@ID", clSsql.sqlconn);
                cmd.Parameters.AddWithValue("MeruzeninAdi", txtMeruzeninAdi.Text);
                cmd.Parameters.AddWithValue("KonfransinAdi", txtKonfransinAdi.Text);
                cmd.Parameters.AddWithValue("Olke", DDLOlke.SelectedValue);
                cmd.Parameters.AddWithValue("TeshkilatinAdi", txtTeshkilatAdi.Text);
                cmd.Parameters.AddWithValue("Cildi", txtCildi.Text);
                cmd.Parameters.AddWithValue("CildNomre", txtCildNomre.Text);
                cmd.Parameters.AddWithValue("KecrildiyiTarix", 0);
                cmd.Parameters.AddWithValue("Sehifeilk", txtsehifeIlk.Text);
                cmd.Parameters.AddWithValue("SehifeSon", txtsehifeSon.Text);
                cmd.Parameters.AddWithValue("LinkURL", txtLink.Text);
                cmd.Parameters.AddWithValue("TypeOlkeBeynelxalq", DDLStatusu.SelectedValue);
                cmd.Parameters.AddWithValue("ShexsiProfilID", Session["PersonalProfilID"].ToString());
                cmd.Parameters.AddWithValue("KonfransIndex", DDLIndexs.SelectedValue);
                string s = "";
                foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                {
                    s += txtmuellifarray.Text + ", ";
                }
                if (s.Length > 2)
                {
                    s = s.Substring(0, s.Length - 2);
                }
                cmd.Parameters.AddWithValue("Muellifler", s);
                DateTime d;
                if (DateTime.TryParse((DateIlkTarix.Text).ToString(), out d) == true)
                {
                    cmd.Parameters.AddWithValue("KonfIlkTarix", DateTime.Parse(DateIlkTarix.Text).ToString("yyyy-MM-dd"));
                }
                else
                {
                    cmd.Parameters.AddWithValue("KonfIlkTarix", DBNull.Value);
                }

                if (DateTime.TryParse((DateSonTarix.Text).ToString(), out d) == true)
                {
                    cmd.Parameters.AddWithValue("KonfSonTarix", DateTime.Parse(DateSonTarix.Text).ToString("yyyy-MM-dd"));
                }
                else
                {
                    cmd.Parameters.AddWithValue("KonfSonTarix", DBNull.Value);
                }
                cmd.Parameters.AddWithValue("ID", Session["ConfranceID"].ToString());
                clSsql.sqlconn.Open();
                cmd.ExecuteNonQuery();
                clSsql.sqlconn.Close();

                int        n    = 0;
                SqlCommand cmd1 = new SqlCommand("Delete from HemmuellifKonfrans where ConfranceID=" + Session["ConfranceID"].ToString(), clSsql.sqlconn);
                clSsql.sqlconn.Open();
                cmd1.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                if (Session["ConfranceID"] != null)
                {
                    foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                    {
                        n++;
                        TextBox t  = (TextBox)NumdivMuellif.FindControl("NomTxtMuellif" + n.ToString());
                        TextBox t1 = (TextBox)divMuellif.FindControl("TxtMuellif" + n.ToString());
                        if (t.Text != "")
                        {
                            insertMuellif(t1.Text, int.Parse(t.Text));
                        }
                        else
                        {
                            insertMuellif(t1.Text, 1);
                        }
                    }
                }
                ViewState["addedBooks"] = 0;
                if (Session["txtAxtar"] != null)
                {
                    txtAxtar.Text = Session["txtAxtar"].ToString();
                }
                GetConfrance(txtAxtar.Text);
                txtMeruzeninAdi.Text     = "";
                txtKonfransinAdi.Text    = "";
                DDLOlke.SelectedIndex    = 0;
                txtCildi.Text            = "";
                txtCildNomre.Text        = "";
                txtTeshkilatAdi.Text     = "";
                txtsehifeIlk.Text        = "";
                txtsehifeSon.Text        = "";
                txtLink.Text             = "";
                DateSonTarix.Text        = "";
                DateIlkTarix.Text        = "";
                DDLStatusu.SelectedIndex = 0;
                DDLIndexs.SelectedIndex  = 0;
                Session["ConfranceID"]   = 0;
                Response.Redirect(Request.Url.AbsoluteUri);
            }
            else
            {
                ClSsql.MsgBox("Xəta baş verdi", Page);
                ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal();", true);
            }
        }
        else
        {
            ClSsql.MsgBox("Məlumat tam deyil", Page);
            ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal();", true);
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (txtMeqaleAdi.Text.Trim().Length > 2)
        {
            if (Session["ScienceArticleID"].ToString() == "0" && Session["PersonalProfilID"].ToString() != "0" && Session["PersonalProfilID"] != null)
            {
                SqlCommand cmd = new SqlCommand(@"insert into TBScienceArticle values(@Adi
      ,@JurnalinAdi
      ,@NeshriyyatinAdi
      ,@Olke
      ,@TeshkilatinAdi
      ,@Cildi
      ,@CildNomre
      ,@NeshrIli
      ,@Sehifeilk
      ,@SehifeSon
      ,@LinkURL
      ,@IndexArticle
      ,@ShexsiProfilID
      ,@Muellifler)", clSsql.sqlconn); //,@Muellifler
                cmd.Parameters.AddWithValue("Adi", txtMeqaleAdi.Text);
                cmd.Parameters.AddWithValue("JurnalinAdi", TxtJurnalinAdi.Text);
                if (CheckboxNeshriyyatinAdi.Checked == false)
                {
                    cmd.Parameters.AddWithValue("NeshriyyatinAdi", DDLNeshriyyatinAdi.SelectedValue);
                }
                else
                {
                    cmd.Parameters.AddWithValue("NeshriyyatinAdi", txtNeshriyyatinAdi.Text);
                }
                string s = "";
                foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                {
                    s += txtmuellifarray.Text + ", ";
                }
                if (s.Length > 2)
                {
                    s = s.Substring(0, s.Length - 2);
                }
                cmd.Parameters.AddWithValue("Olke", DDLOlke.SelectedValue);
                cmd.Parameters.AddWithValue("TeshkilatinAdi", txtTeshkilatAdi.Text);
                cmd.Parameters.AddWithValue("Cildi", txtCildi.Text);
                cmd.Parameters.AddWithValue("CildNomre", txtCildNomre.Text);
                cmd.Parameters.AddWithValue("NeshrIli", txtNeshrİli.Text);
                cmd.Parameters.AddWithValue("Sehifeilk", txtSehifeIlk.Text);
                cmd.Parameters.AddWithValue("SehifeSon", txtSehifeSon.Text);
                cmd.Parameters.AddWithValue("LinkURL", txtlink.Text);
                cmd.Parameters.AddWithValue("IndexArticle", DDLIndex.SelectedValue);
                cmd.Parameters.AddWithValue("ShexsiProfilID", Session["PersonalProfilID"].ToString());
                cmd.Parameters.AddWithValue("Muellifler", s);
                clSsql.sqlconn.Open();
                cmd.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                int     n  = 0;
                DataRow dr = clSsql.getDT(@"Select * from TBScienceArticle where ID=(select MAX(ID) from TBScienceArticle  where ShexsiProfilID=" + Session["PersonalProfilID"].ToString() + ")").Rows[0];
                Session["ScienceArticleID"] = dr["ID"].ToString();
                if (Session["ScienceArticleID"] != null)
                {
                    foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                    {
                        n++;
                        TextBox t  = (TextBox)NumdivMuellif.FindControl("NomTxtMuellif" + n.ToString());
                        TextBox t1 = (TextBox)divMuellif.FindControl("TxtMuellif" + n.ToString());
                        if (t.Text != "")
                        {
                            insertMuellif(t1.Text, int.Parse(t.Text));
                        }
                        else
                        {
                            insertMuellif(t1.Text, 1);
                        }
                    }
                }

                GetHemmuellif();
                txtnameMuellif.Text = "";
                txtsiramuellif.Text = "";
                clSsql.sqlconn.Close();
                if (Session["txtAxtarMql"] != null)
                {
                    txtAxtar.Text = Session["txtAxtarMql"].ToString();
                }
                GetScienceArticle(txtAxtar.Text);
                txtMeqaleAdi.Text   = "";
                TxtJurnalinAdi.Text = "";
                DDLNeshriyyatinAdi.SelectedValue = "Yoxdur";
                txtNeshriyyatinAdi.Text          = "";
                DDLOlke.SelectedIndex            = 0;
                txtCildi.Text        = "";
                txtCildNomre.Text    = "";
                txtNeshrİli.Text     = "";
                txtSehifeIlk.Text    = "";
                txtSehifeSon.Text    = "";
                txtlink.Text         = "";
                txtTeshkilatAdi.Text = "";
                // txtHemmuellif.Text = "";
                DDLIndex.SelectedIndex = 0;

                ViewState["addedBooks"] = 0;
                Response.Redirect(Request.Url.AbsoluteUri);
            }
            else if (Session["ScienceArticleID"].ToString() != "0" && Session["PersonalProfilID"].ToString() != "0" && Session["PersonalProfilID"] != null)
            {
                SqlCommand cmd = new SqlCommand(@"Update TBScienceArticle set Adi=@Adi,
      JurnalinAdi=@JurnalinAdi
      ,NeshriyyatinAdi=@NeshriyyatinAdi
      ,Olke=@Olke
      ,TeshkilatinAdi=@TeshkilatinAdi
      ,Cildi=@Cildi
      ,CildNomre=@CildNomre
      ,NeshrIli=@NeshrIli
      ,Sehifeilk=@Sehifeilk
      ,SehifeSon=@SehifeSon
      ,LinkURL=@LinkURL
      ,IndexArticle=@IndexArticle
      ,Muellifler=@Muellifler
       where ID=@ID", clSsql.sqlconn); //
                cmd.Parameters.AddWithValue("Adi", txtMeqaleAdi.Text);
                cmd.Parameters.AddWithValue("JurnalinAdi", TxtJurnalinAdi.Text);
                if (CheckboxNeshriyyatinAdi.Checked == false)
                {
                    cmd.Parameters.AddWithValue("NeshriyyatinAdi", DDLNeshriyyatinAdi.SelectedValue);
                }
                else
                {
                    cmd.Parameters.AddWithValue("NeshriyyatinAdi", txtNeshriyyatinAdi.Text);
                }
                string s = "";
                foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                {
                    s += txtmuellifarray.Text + ", ";
                }
                if (s.Length > 2)
                {
                    s = s.Substring(0, s.Length - 2);
                }
                cmd.Parameters.AddWithValue("Olke", DDLOlke.SelectedValue);
                cmd.Parameters.AddWithValue("TeshkilatinAdi", txtTeshkilatAdi.Text);
                cmd.Parameters.AddWithValue("Cildi", txtCildi.Text);
                cmd.Parameters.AddWithValue("CildNomre", txtCildNomre.Text);
                cmd.Parameters.AddWithValue("NeshrIli", txtNeshrİli.Text);
                cmd.Parameters.AddWithValue("Sehifeilk", txtSehifeIlk.Text);
                cmd.Parameters.AddWithValue("SehifeSon", txtSehifeSon.Text);
                cmd.Parameters.AddWithValue("LinkURL", txtlink.Text);
                cmd.Parameters.AddWithValue("IndexArticle", DDLIndex.SelectedValue);
                cmd.Parameters.AddWithValue("Muellifler", s);
                cmd.Parameters.AddWithValue("ID", Session["ScienceArticleID"].ToString());
                clSsql.sqlconn.Open();
                cmd.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                int        n    = 0;
                SqlCommand cmd1 = new SqlCommand("Delete from HemmuellifArticle where ArticleID=" + Session["ScienceArticleID"].ToString(), clSsql.sqlconn);
                clSsql.sqlconn.Open();
                cmd1.ExecuteNonQuery();
                clSsql.sqlconn.Close();
                if (Session["ScienceArticleID"] != null)
                {
                    foreach (TextBox txtmuellifarray in divMuellif.Controls.OfType <TextBox>())
                    {
                        n++;
                        TextBox t  = (TextBox)NumdivMuellif.FindControl("NomTxtMuellif" + n.ToString());
                        TextBox t1 = (TextBox)divMuellif.FindControl("TxtMuellif" + n.ToString());
                        if (t.Text != "")
                        {
                            insertMuellif(t1.Text, int.Parse(t.Text));
                        }
                        else
                        {
                            insertMuellif(t1.Text, 1);
                        }
                    }
                }
                ViewState["addedBooks"] = 0;
                if (Session["txtAxtarMql"] != null)
                {
                    txtAxtar.Text = Session["txtAxtarMql"].ToString();
                }
                GetScienceArticle(txtAxtar.Text);
                txtMeqaleAdi.Text   = "";
                TxtJurnalinAdi.Text = "";
                DDLNeshriyyatinAdi.SelectedValue = "Yoxdur";
                DDLOlke.SelectedIndex            = 0;
                txtCildi.Text          = "";
                txtCildNomre.Text      = "";
                txtNeshrİli.Text       = "";
                txtSehifeIlk.Text      = "";
                txtSehifeSon.Text      = "";
                txtlink.Text           = "";
                DDLIndex.SelectedIndex = 0;
                txtTeshkilatAdi.Text   = "";
                //  txtHemmuellif.Text = "";
                txtNeshriyyatinAdi.Text     = "";
                Session["ScienceArticleID"] = 0;
                Response.Redirect(Request.Url.AbsoluteUri);
            }
            else
            {
                ClSsql.MsgBox("Xəta baş verdi", Page);
                ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal();", true);
            }
        }
        else
        {
            ClSsql.MsgBox("Məlumat tam deyil", Page);
            ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openModal();", true);
        }
    }
Exemple #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd;
        string     sqltextInsert = @"insert into TbShexsiProfil (Soyad,Ad,AtaAd,Cins,DoqumTarix,Fin,Vetendashliq,Foto,AileVeziyyeti
      ,EsasIShYeri,Shobe,Vezife,UmumiStajAY,UmumiStajIL,ElmiStajAY,ElmiStajIL,PedaqojiStajAY,PedaqojiStajIL
      ,IShUnvani,IshTelefon,Faks,EMail,ElmiMuessiseID,UsersID,Istinad)
  values(@Soyad,@Ad,@AtaAd,@Cins,@DoqumTarix,@Fin,@Vetendashliq,@Foto,@AileVeziyyeti,@EsasIShYeri,@Shobe
      ,@Vezife,@UmumiStajAY,@UmumiStajIL,@ElmiStajAY,@ElmiStajIL,@PedaqojiStajAY,@PedaqojiStajIL,@IShUnvani
      ,@IshTelefon,@Faks,@EMail,@ElmiMuessiseID,@UsersID,@Istinad)";
        string     sqltextUpdate = @"Update TbShexsiProfil set Soyad=@Soyad,Ad=@Ad,AtaAd=@AtaAd,Cins=@Cins,
       DoqumTarix=@DoqumTarix,Fin=@Fin,Vetendashliq=@Vetendashliq,Foto=@Foto,AileVeziyyeti=@AileVeziyyeti
      ,EsasIShYeri=@EsasIShYeri,Shobe=@Shobe,Vezife=@Vezife,UmumiStajAY=@UmumiStajAY,UmumiStajIL=@UmumiStajIL,
      ElmiStajAY=@ElmiStajAY,ElmiStajIL=@ElmiStajIL,PedaqojiStajAY=@PedaqojiStajAY,PedaqojiStajIL=@PedaqojiStajIL
      ,IShUnvani=@IShUnvani,IshTelefon=@IshTelefon,Faks=@Faks,EMail=@EMail,ElmiMuessiseID=@ElmiMuessiseID,Istinad=@Istinad where UsersID=@UsersID";

        userid = int.Parse(Session["UsersID"].ToString());
        if (txtUmumiIShstajiIL.Text != "" || txtUmumiIShstajiAy.Text != "")
        {
            if (clSsql.getDT("Select * from TbShexsiProfil where UsersID=" + userid.ToString()).Rows.Count == 0)
            {
                cmd = new SqlCommand(sqltextInsert, clSsql.sqlconn);

                /*cmd.Parameters.AddWithValue("Soyad",txtSoyad.Text);
                 * cmd.Parameters.AddWithValue("Ad",txtad.Text);
                 * cmd.Parameters.AddWithValue("AtaAd",txtAtaAdi.Text);
                 * cmd.Parameters.AddWithValue("Cins",DDLCins.SelectedValue);
                 * cmd.Parameters.AddWithValue("DoqumTarix",dateDT.Text);
                 * cmd.Parameters.AddWithValue("Fin",txtFin.Text);
                 * cmd.Parameters.AddWithValue("Vetendashliq",DDLVetendashliq.SelectedValue);
                 * cmd.Parameters.AddWithValue("Foto", userid.ToString() + imgpath);
                 * cmd.Parameters.AddWithValue("AileVeziyyeti",DDLAileVeziyyeti.Text);
                 * cmd.Parameters.AddWithValue("EsasIShYeri",txtIshYeri.Text);
                 * cmd.Parameters.AddWithValue("Shobe",txtShobe.Text);
                 * cmd.Parameters.AddWithValue("Vezife",txtVezife.Text);
                 * cmd.Parameters.AddWithValue("UmumiStajAY",txtUmumiIShstajiAy.Text);
                 * cmd.Parameters.AddWithValue("UmumiStajIL",txtUmumiIShstajiIL.Text);
                 * cmd.Parameters.AddWithValue("ElmiStajAY",txtElmiStajAy.Text);
                 * cmd.Parameters.AddWithValue("ElmiStajIL",txtElmiStajIl.Text);
                 * cmd.Parameters.AddWithValue("PedaqojiStajAY",txtPedaqojiStajAy.Text);
                 * cmd.Parameters.AddWithValue("PedaqojiStajIL",txtPedaqojiStajIL.Text);
                 * cmd.Parameters.AddWithValue("IShUnvani",txtIShUnvani.Text);
                 * cmd.Parameters.AddWithValue("IshTelefon",txtIShTelefon.Text);
                 * cmd.Parameters.AddWithValue("Faks",txtFaks.Text);
                 * cmd.Parameters.AddWithValue("EMail",txtEmail.Text);
                 * cmd.Parameters.AddWithValue("ElmiMuessiseID", ElmiMuessiseID);
                 * cmd.Parameters.AddWithValue("UsersID", userid);
                 * cmd.Parameters.AddWithValue("Istinad", txtIstinad.Text);
                 * FileUpload1.SaveAs(Server.MapPath("/imgshexsi/" + userid.ToString()+imgpath));
                 */
            }
            else
            {
                cmd = new SqlCommand(sqltextUpdate, clSsql.sqlconn);
                cmd.Parameters.AddWithValue("Soyad", txtSoyad.Text);
                cmd.Parameters.AddWithValue("Ad", txtad.Text);
                cmd.Parameters.AddWithValue("AtaAd", txtAtaAdi.Text);
                cmd.Parameters.AddWithValue("Cins", DDLCins.SelectedValue);
                DateTime datevalue;
                if (DateTime.TryParse(dateDT.Text, out datevalue))
                {
                    cmd.Parameters.AddWithValue("DoqumTarix", DateTime.Parse(dateDT.Text).ToString("yyyy-MM-dd"));
                }
                else
                {
                    cmd.Parameters.AddWithValue("DoqumTarix", DBNull.Value);
                }
                cmd.Parameters.AddWithValue("Fin", txtFin.Text);
                cmd.Parameters.AddWithValue("Vetendashliq", DDLVetendashliq.SelectedValue);

                if (FileUpload1.HasFile &&
                    FileUpload1.FileName.ToString() != string.Empty
                    )
                {
                    Session["imgpath"] = Session["UsersID"].ToString() + "_" + Session["UsersName"].ToString() + "_" + FileUpload1.FileName.ToString();
                    FileUpload1.SaveAs(Server.MapPath("/imgshexsi/" + Session["imgpath"].ToString()));
                }

                cmd.Parameters.AddWithValue("Foto", Session["imgpath"].ToString());
                cmd.Parameters.AddWithValue("AileVeziyyeti", DDLAileVeziyyeti.Text);
                cmd.Parameters.AddWithValue("EsasIShYeri", txtIshYeri.Text);
                cmd.Parameters.AddWithValue("Shobe", txtShobe.Text);
                cmd.Parameters.AddWithValue("Vezife", txtVezife.Text);
                cmd.Parameters.AddWithValue("UmumiStajAY", txtUmumiIShstajiAy.Text);
                cmd.Parameters.AddWithValue("UmumiStajIL", txtUmumiIShstajiIL.Text);
                cmd.Parameters.AddWithValue("ElmiStajAY", txtElmiStajAy.Text);
                cmd.Parameters.AddWithValue("ElmiStajIL", txtElmiStajIl.Text);
                cmd.Parameters.AddWithValue("PedaqojiStajAY", txtPedaqojiStajAy.Text);
                cmd.Parameters.AddWithValue("PedaqojiStajIL", txtPedaqojiStajIL.Text);
                cmd.Parameters.AddWithValue("IShUnvani", txtIShUnvani.Text);
                cmd.Parameters.AddWithValue("IshTelefon", txtIShTelefon.Text);
                cmd.Parameters.AddWithValue("Faks", txtFaks.Text);
                cmd.Parameters.AddWithValue("EMail", txtEmail.Text);
                cmd.Parameters.AddWithValue("ElmiMuessiseID", ElmiMuessiseID);
                cmd.Parameters.AddWithValue("Istinad", txtIstinad.Text);
                cmd.Parameters.AddWithValue("UsersID", userid);
                Session["Foto"]             = Session["imgpath"].ToString();
                Session["UsersNameMuellif"] = txtSoyad.Text + " " + txtad.Text + " " + txtAtaAdi.Text;
            }

            clSsql.sqlconn.Open();
            cmd.ExecuteNonQuery();
            clSsql.sqlconn.Close();
            GetPersonalProfil();
            Response.Redirect("UserProfil.aspx?p=1");
        }
        else
        {
            ClSsql.MsgBox("Ümumi stajda il və ya ay qeyd olunmalıdır.", Page);
        }
    }
    protected void btnLogIn_ServerClick(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("Select * from UsersTB where Login_name=@p1 and ElmiMuessiseID=@p2", clSsql.sqlconn);

        cmd.Parameters.AddWithValue("p1", EmailText.Text);
        cmd.Parameters.AddWithValue("p2", DDLElmiMuessise.SelectedValue.ToString());
        SqlDataAdapter dap = new SqlDataAdapter(cmd);

        clSsql.sqlconn.Open();
        DataTable dt = new DataTable();

        dap.Fill(dt);
        clSsql.sqlconn.Close();
        if (dt.Rows.Count > 0)
        {
            //var fromAddress = new MailAddress("*****@*****.**");
            //var fromPassword = "******";
            var fromAddress  = new MailAddress("*****@*****.**");
            var fromPassword = "******";
            var toAddress    = new MailAddress(dt.Rows[0][1].ToString());

            Random rnd       = new Random();
            int    randomint = rnd.Next();

            string subject = "Yeni şifrənin təyin edilməsi";

            string body = "Yeni şifrənin təyin etmək üçün linkə daxil olun. http://elmikadr.ict.az/RegstrUserUpdate.aspx?passwordchange=" + dt.Rows[0][0].ToString() + "&confirmvar=" + EmailText.Text + "&kod=" + randomint.ToString();
            //SqlCommand cmd1 = new SqlCommand();


            System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = System.Net.Mail.SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromAddress.Address, fromPassword)
            };

            using (var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body
            })

                smtp.Send(message);

            ClSsql.MsgBox("Şifrənizin bərpası üçün email ünvanınıza məlumat göndərildi.", Page);
        }
        else
        {
            ClSsql.MsgBox("Bu email sistemdə tapılmadı.", Page);
        }

        //else
        //{
        //    lblMSG.ForeColor = System.Drawing.Color.Red;
        //    lblMSG.Text = "Məlumatlar düzgün qeyd edilməyib.";
        //}
    }