Exemplo n.º 1
0
 protected void Print_Click(object sender, EventArgs e)
 {
     try
     {
         RadButton LBTN    = (RadButton)sender;
         string    po_id   = LBTN.CommandArgument;
         var       encrypt = new eXSecurity.Encryption();
         Telerik.Web.UI.GridDataItem dataItem = (Telerik.Web.UI.GridDataItem)((Control)sender).NamingContainer;
         string item_id = ((Label)dataItem.FindControl("item_idLBL")).Text;
         if (item_id == "1") //TLD
         {
             Response.Write("<script>");
             Response.Write("window.open('Reports/TLDReport.aspx?P=" + encrypt.EncryptData(po_id) + "')");
             Response.Write("</script>");
         }
         else if (item_id == "2") //SSDL
         {
             Response.Write("<script>");
             Response.Write("window.open('Reports/SSDLReport.aspx?P=" + encrypt.EncryptData(po_id) + "')");
             Response.Write("</script>");
         }
     }
     catch (Exception ex)
     {
         Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
     }
 }
Exemplo n.º 2
0
    protected void FollowUp_Click(object sender, EventArgs e)
    {
        RadButton LBTN    = (RadButton)sender;
        string    po_id   = LBTN.CommandArgument;
        var       encrypt = new eXSecurity.Encryption();

        Redirect("OrderLine.aspx?P=" + encrypt.EncryptData(po_id));
    }
Exemplo n.º 3
0
    //***

    //*** Details_Click
    protected void Details_Click(object sender, EventArgs e)
    {
        LinkButton LBTN    = (LinkButton)sender;
        string     tldh_id = LBTN.CommandArgument;
        var        encrypt = new eXSecurity.Encryption();

        Redirect("TLDDetails.aspx");
        Session["tldh_id"] = encrypt.EncryptData(tldh_id);
    }
Exemplo n.º 4
0
    protected void fillSessions(SqlCommand cmd, SqlConnection con, string role_id)
    {
        var encrypt = new eXSecurity.Encryption();

        Session["user_name"] = login_user_nameTXT.Text;
        //Session["user_name"] = login_user_nameTXT.Value;
        Session["language_id"] = "1";                          //EN
        Session["role_id"]     = encrypt.EncryptData(role_id); //EN
    }
Exemplo n.º 5
0
    //***

    //*** NavigateNextStep
    protected void NavigateNextStep(string item_id, string po_id, int i)
    {
        var encrypt = new eXSecurity.Encryption();

        if (item_id == "1")   //TLD
        {
            if (i == 0)
            {
                using (SqlConnection con = new SqlConnection(Controller.connection))
                {
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        //select from CNRS_TLDHeaderDetails all tldh_id
                        Dictionary <string, string> conditions = new Dictionary <string, string>();
                        ArrayList field = new ArrayList();
                        field.Add("tldhd_id");
                        conditions.Add("active", true.ToString());
                        con.Open();
                        DataTable dt = Controller.SelectFrom(cmd, con, "CNRS_TLDHeaderDetails", field, conditions, new ArrayList(), false, false, "");

                        //insert into table TLDDetails
                        if (dt.Rows.Count > 0)
                        {
                            foreach (DataRow row in dt.Rows)
                            {
                                Dictionary <string, string> fields = new Dictionary <string, string>();
                                fields.Add("tldhd_id", row["tldhd_id"].ToString());
                                fields.Add("po_id", po_id);
                                fields.Add("createdBy", Session["user_name"].ToString());
                                Controller.InsertInto(cmd, con, "CNRS_TLDDetails", fields, false);
                            }
                        }
                    }
                }
            }
            Redirect("~/Pages/TLD.aspx?P=" + encrypt.EncryptData(po_id));
        }

        else if (item_id == "2")    //SSDL
        {
            Redirect("~/Pages/SSDL.aspx?P=" + encrypt.EncryptData(po_id));
        }

        else if (item_id == "3")    //Quality Control
        {
            Redirect("QualityOfControll.aspx");
        }

        else if (item_id == "4")
        {
            Redirect(".aspx");
        }
    }
Exemplo n.º 6
0
    protected void LogIn(object sender, EventArgs e)
    {
        try
        {
            var encrypt = new eXSecurity.Encryption();
            using (SqlConnection con = new SqlConnection(Controller.connection))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    con.Open();

                    ArrayList fields = new ArrayList();
                    fields.Add("user_name");
                    fields.Add("active");
                    fields.Add("role_id");
                    Dictionary <string, string> conditions = new Dictionary <string, string>();
                    conditions.Add("user_name", login_user_nameTXT.Text);
                    //conditions.Add("user_name", login_user_nameTXT.Value);
                    conditions.Add("user_password", encrypt.EncryptData(login_user_passwordTXT.Value));
                    DataTable dt = Controller.SelectFrom(cmd, con, "View_User", fields, conditions, new ArrayList(), false, false, "");
                    if (dt.Rows.Count > 0)
                    {
                        if ((bool)dt.Rows[0]["active"] == true)
                        {
                            fillSessions(cmd, con, dt.Rows[0]["role_id"].ToString());

                            Redirect("../Pages/Home.aspx");
                        }
                        else
                        {
                            AlertJS(3);
                        }
                    }
                    else
                    {
                        AlertJS(2);
                    }
                    ClearTXT();
                }
            }
        }
        catch (Exception ex)
        {
            Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }
    }
Exemplo n.º 7
0
    protected void Register(object sender, EventArgs e)
    {
        try
        {
            if (Page.IsValid == false) //Will be true if captcha text is correct otherwise it will be false
            {
                ClearTXT();
                AlertJS(4);
                return;
            }
            using (SqlConnection con = new SqlConnection(Controller.connection))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    con.Open();

                    Dictionary <string, string> conditions = new Dictionary <string, string>();
                    conditions.Add("user_name", register_user_nameTXT.Value);
                    DataTable dt = Controller.SelectFrom(cmd, con, "SEC_User", new ArrayList(), conditions, new ArrayList(), true, false, "");
                    if (dt.Rows.Count > 0)
                    {
                        ClearTXT();
                        AlertJS(1);
                        return;
                    }

                    DataTable dtSecreatire = Controller.SelectSecretaireRole(cmd, con); // and admin
                    if (dtSecreatire.Rows.Count > 0)
                    {
                        bool Allsended = true;
                        foreach (DataRow row in dtSecreatire.Rows)
                        {
                            bool sended = SendEmail(row["user_email"].ToString(), row["user_contactPerson"].ToString(), 2);
                            if (sended == false)
                            {
                                Allsended = false;
                                break;
                            }
                        }

                        bool sendedEmail = SendEmail(user_emailTXT.Value, user_contactPersonTXT.Value, 1);
                        if (sendedEmail == true && Allsended == true)
                        {
                            var encrypt = new eXSecurity.Encryption();

                            Dictionary <string, string> fields = new Dictionary <string, string>();
                            fields.Add("user_name", register_user_nameTXT.Value);
                            fields.Add("user_password", encrypt.EncryptData(register_user_passwordTXT.Value));
                            fields.Add("user_email", user_emailTXT.Value);
                            fields.Add("user_phone", user_phoneTXT.Value);
                            fields.Add("user_companyName", user_companyNameTXT.Value);
                            fields.Add("user_contactPerson", user_contactPersonTXT.Value);
                            fields.Add("user_address", user_addressTXT.Value);
                            fields.Add("user_fax", user_faxTXT.Value);
                            Controller.InsertInto(cmd, con, "SEC_User", fields, false);

                            fields.Clear();
                            fields.Add("user_name", register_user_nameTXT.Value);
                            fields.Add("role_id", "2");  //client
                            Controller.InsertInto(cmd, con, "SEC_RoleUser", fields, false);
                            ClearTXT();
                        }
                        else
                        {
                            ClearTXT();
                            AlertJS(5);
                            return;
                        }
                    }
                    else
                    {
                        ClearTXT();
                        AlertJS(6);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ClearTXT();
            Controller.SaveErrors(Path.GetFileName(Request.PhysicalPath), ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name);
        }
    }