Ejemplo n.º 1
0
        protected void LoginUser_Click(object sender, EventArgs e)
        {
            Registrations registrationObj = new Registrations();
            string        Pass            = registrationObj.encryptpass(Password.Text);


            GenerateQuery QueryObj = new GenerateQuery();

            string[,] ReplaceValues = new string[2, 2];
            ReplaceValues[0, 0]     = "_UserName_";
            ReplaceValues[0, 1]     = UserName.Text;
            ReplaceValues[1, 0]     = "_Password_";
            ReplaceValues[1, 1]     = Password.Text;
            long   UserId = 0;
            string User   = "";

            Registration registration = null;

            string Query = QueryObj.GetQueryViaFileAndTagName("LogIn.xml", "ValidUserOrNot");

            Query = Query.Replace("_UserName_", UserName.Text.ToString());
            Query = Query.Replace("_Password_", Password.Text.ToString());
            if (Query != "")
            {
                UserId = QueryObj.GetSingleNumericValueViaQuery(Query, ReplaceValues, Connection);
                User   = QueryObj.GetSingleStringValueViaQuery(Query, ReplaceValues, Connection);
                if (UserId > 0)
                {
                    Response.Redirect("ListPage.aspx?UserId=" + UserId);
                }
                else
                {
                    UserName.Text = "";
                    Password.Text = "";
                    Label1.Text   = "Enter User Name And Password is incurrect please try again.";
                }
            }
            if (Query != "")
            {
                registration = QueryObj.GetCollectionOfDataViaQuery(Query);
                DataTable DataTableObj = new DataTable("DataTable");
                DataTableObj = QueryObj.GetCollectionOfDataSetViaQuery(Query);
                if (DataTableObj != null)
                {
                    //Data Set havinf data now retrive it to its sutiable properties
                }
            }
            if (Query != "")
            {
                registration = QueryObj.GetCollectionSearchDataViaQuery(Query, ReplaceValues, null, null, "", registration);
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Registration registration = null;

            string Query = QueryObj.GetQueryViaFileAndTagName("LogIn.xml", "GetUserTypeList");

            //Query = Query.Replace("_TypeName_", "UserType");
            registration = QueryObj.GetCollectionOfDataViaQuery(Query);
            DataTable DataTableObj = new DataTable("DataTable");

            DataTableObj = QueryObj.GetCollectionOfDataSetViaQuery(Query);
            if (DataTableObj != null)
            {
                for (int i = 0; i < DataTableObj.Rows.Count; i++)
                {
                    long   TypeId   = Convert.ToInt64(DataTableObj.Rows[i].ItemArray[0]);
                    string theValue = DataTableObj.Rows[i].ItemArray[1].ToString();
                    UserType.DataValueField = DataTableObj.Rows[i].ItemArray[0].ToString();
                    UserType.DataTextField  = DataTableObj.Rows[i].ItemArray[1].ToString();
                    UserType.Items.Add(theValue);
                }
            }
        }
Ejemplo n.º 3
0
        // public string Email { set; get; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Connection == null)
            {
                Connection.Open();
            }

            TableItemStyle tableStyle = new TableItemStyle();

            tableStyle.HorizontalAlign = HorizontalAlign.Center;
            tableStyle.VerticalAlign   = VerticalAlign.Middle;
            tableStyle.Width           = Unit.Pixel(100);

            string        UserId       = Request.QueryString["UserId"];
            Registration  registration = null;
            GenerateQuery QueryObj     = new GenerateQuery();
            long          rowNum       = 0;
            string        Query        = QueryObj.GetQueryViaFileAndTagName("LogIn.xml", "RemoteControlData");

            registration = QueryObj.GetCollectionOfDataViaQuery(Query);
            DataTable DataTableObj = new DataTable("DataTable");

            DataTableObj = QueryObj.GetCollectionOfDataSetViaQuery(Query);
            TableRow       tempRow1   = new TableRow();
            TableRow       tempRow2   = new TableRow();
            TableRow       tempRow3   = new TableRow();
            SqlDataAdapter adapter    = new SqlDataAdapter(Query, Connection);
            DataSet        dataSetObj = new DataSet();

            adapter.Fill(dataSetObj);



            StringBuilder html = new StringBuilder();

            html.Append("<table border = '1'>");
            html.Append("<tr>");
            foreach (DataColumn column in DataTableObj.Columns)
            {
                if (column.ColumnName != "UserId" && column.ColumnName != "RemoteControlSessionId")
                {
                    html.Append("<th>");
                    html.Append(column.ColumnName);
                    html.Append("</th>");
                }
            }
            html.Append("</tr>");
            foreach (DataRow row in DataTableObj.Rows)
            {
                html.Append("<tr>");
                foreach (DataColumn column in DataTableObj.Columns)
                {
                    if (column.ColumnName != "UserId" && column.ColumnName != "RemoteControlSessionId")
                    {
                        html.Append("<td>");
                        html.Append(row[column.ColumnName]);
                        html.Append("</td>");
                    }
                }
                html.Append("</tr>");
            }
            html.Append("</table>");
            PlaceHolder1.Controls.Add(new Literal {
                Text = html.ToString()
            });


            if (DataTableObj != null)
            {
                int DataSetRowCount = DataTableObj.Rows.Count;
                foreach (DataRow dr in DataTableObj.Rows)
                {
                    TableCell tempCell1 = new TableCell();
                    TableCell tempCell2 = new TableCell();
                    TableCell tempCell3 = new TableCell();
                    for (int cellNum = 0; cellNum < 1; cellNum++)
                    {
                        tempCell1.Text = Convert.ToString(dr["RemoteControlSessionId"]);
                        tempCell2.Text = Convert.ToString(dr["Name"]);
                        tempCell3.Text = Convert.ToString(dr["Email"]);


                        DataSetRowCount = DataSetRowCount - 1;
                    }
                    tempRow1.Cells.AddAt(Convert.ToInt32(rowNum), tempCell1);
                    tempRow2.Cells.AddAt(Convert.ToInt32(rowNum), tempCell2);
                    tempRow3.Cells.AddAt(Convert.ToInt32(rowNum), tempCell3);
                    //Table1.Rows.Add(tempRow1);
                    //Table1.Rows.Add(tempRow2);
                    //Table1.Rows.Add(tempRow3);
                    SessionAddress.InnerText = Convert.ToString(dr["Email"]);
                    rowNum = rowNum + 1;
                }
                Table1.Rows.Add(tempRow1);
            }
            foreach (TableRow rw in Table1.Rows)
            {
                foreach (TableCell cel in rw.Cells)
                {
                    cel.ApplyStyle(tableStyle);
                }
            }

            TableHeaderCell header1 = new TableHeaderCell();

            header1.RowSpan         = 1;
            header1.ColumnSpan      = 5;
            header1.Text            = "Remote Control Accept Reject List";
            header1.Font.Bold       = true;
            header1.BackColor       = Color.Gray;
            header1.HorizontalAlign = HorizontalAlign.Center;
            header1.VerticalAlign   = VerticalAlign.Middle;
            TableRow headerRow1 = new TableRow();

            headerRow1.Cells.Add(header1);
            Table1.Rows.AddAt(0, headerRow1);
        }