예제 #1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Session["Now"] = DateTime.Now.ToString();
     AccessDataSource3.Insert();
     AccessDataSource1.Update();
     Response.Redirect("~/Member/ViewHistory.aspx");
 }
예제 #2
0
    // hakkımızda
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        Label IdLabel = e.Item.FindControl("IdLabel") as Label;
        int   id      = Convert.ToInt32(IdLabel.Text);

        if (e.CommandName == "sil")
        {
            kurumsalSayfa ur = kurumsalSayfa.Select(id);
            if (ur == null)
            {
                Labelbilgi.Text = "<p class='msg error'><b>KAYIT BULUNAMADI !</b></p>";
                return;
            }

            Result <int> sonuc = ur.Delete();

            if (sonuc.HasError)
            {
                Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
                return;
            }
            else
            {
                Labelbilgi.Text = "<p class='msg done'><b>BAŞARIYLA SİLİNDİ...</b></p>";
                AccessDataSource1.Select(DataSourceSelectArguments.Empty);
                ListView1.DataBind();
            }
        }
        else if (e.CommandName == "duzenle")
        {
            Response.Redirect("kurumsal-duzenle.aspx?Id=" + id.ToString());
        }
    }
예제 #3
0
 protected void LinkButton4_Click(object sender, EventArgs e)
 {
     AccessDataSource1.Delete();
     Session.Abandon();
     Session.RemoveAll();
     Response.Redirect("Default.aspx");
 }
예제 #4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session["aa"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[3].Text;
        Session["bb"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[5].Text;
        Session["cc"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[7].Text;
        Session["dd"]     = GridView1.Rows[GridView1.Rows.Count - 1].Cells[9].Text;
        Session["kimlik"] = GridView1.Rows[GridView1.Rows.Count - 1].Cells[0].Text;

        if (RadioButtonList1.Items[0].Selected == true)
        {
            Session["aa"] = Convert.ToInt32(Session["aa"]) + 1;
        }

        if (RadioButtonList1.Items[1].Selected == true)
        {
            Session["bb"] = Convert.ToInt32(Session["bb"]) + 1;
        }

        if (RadioButtonList1.Items[2].Selected == true)
        {
            Session["cc"] = Convert.ToInt32(Session["cc"]) + 1;
        }
        if (RadioButtonList1.Items[3].Selected == true)
        {
            Session["dd"] = Convert.ToInt32(Session["dd"]) + 1;
        }

        AccessDataSource1.Update();
    }
    private bool isLeafNode(string nodeID)
    {
        AccessDataSource1.SelectCommand = string.Format("SELECT [EmployeeID] FROM [Employees] WHERE ([ReportsTo] = {0})", nodeID);
        DataView dv = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        return(dv.Count == 0);
    }
 protected void RunFilter(String querystring, String col, String val, String includedparts)
 {
     //AccessDataSource1.SelectCommand = "SELECT [ProductLine], [Series], [Codename], [ModelName], [ConfigurationNumber], [ReleaseDate], [CodenameInSpareParts] FROM [Products_Basic] WHERE (Series = '" + currentseries + "') AND (" + col + " LIKE '%" + val + "%') ORDER BY [ReleaseDate] DESC, [Codename], [ConfigurationNumber]";
     AccessDataSource1.SelectCommand = "SELECT ProductConfiguration.ConfigurationNumber, PartsBOM.PrtNum, PartsBOM.prtperunit, PartsBOM.PrtEURepai, PartsBOM.colval, PartsOrdPart.SANDS_Category, PartsOrdPart.DESCRIPTION, PartsOrdPart.SANDS_MEMO_OrdPart, PartsOrdPart.LOCATION, PartsOrdPart.LISTEACH, PartsOrdPart.QUANTITY FROM ((PartsBOM INNER JOIN PartsOrdPart ON PartsBOM.PrtNum = PartsOrdPart.PARTNUM) INNER JOIN ProductConfiguration ON PartsBOM.MDLCONFIG = ProductConfiguration.ConfigurationNumber) WHERE (PartsOrdPart.DESCRIPTION <> 'ZERO') AND (ProductConfiguration.ConfigurationNumber = '" + querystring + "') AND (" + col + " LIKE '%" + val + "%')" + includedparts + " ORDER BY PartsOrdPart.DESCRIPTION, PartsBOM.PrtNum";
     AccessDataSource1.DataBind();
     GridView1.DataBind();
 }
예제 #7
0
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        int id = Convert.ToInt32(ListView1.DataKeys[e.Item.DataItemIndex].Value);

        if (e.CommandName == "sil")
        {
            ik ur = ik.Select(id);
            if (ur == null)
            {
                Labelbilgi.Text = "<p class='msg error'><b>KAYIT BULUNAMADI !</b></p>";
                return;
            }

            //ur.Aktif = false;
            //Result<int> sonuc = ur.Update();
            Result <int> sonuc = ur.Delete();

            if (sonuc.HasError)
            {
                Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
                return;
            }
            else
            {
                Labelbilgi.Text = "<p class='msg done'><b>BAŞARIYLA SİLİNDİ...</b></p>";
                AccessDataSource1.Select(DataSourceSelectArguments.Empty);
                ListView1.DataBind();
            }
        }
    }
예제 #8
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request["Id"]);


        kategori ur = kategori.Select(id);

        if (ur == null)
        {
            Labelbilgi.Text = "<p class='msg error'><b>KAYIT BULUNAMADI !</b></p>";
            return;
        }


        Result <int> sonuc = ur.Delete();

        if (sonuc.HasError)
        {
            Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
            return;
        }
        else
        {
            Labelbilgi.Text = "<p class='msg done'><b>BAŞARIYLA SİLİNDİ...</b></p>";
            AccessDataSource1.Select(DataSourceSelectArguments.Empty);
            Response.Redirect("kategoriler.aspx");
        }
    }
예제 #9
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            // If built in validation finds an error
            if (IsValid != true)
            {
                return;
            }
            TextBox      Qty      = MakeList.FooterRow.FindControl("txtQty") as TextBox;
            TextBox      ItemName = MakeList.FooterRow.FindControl("txtItem") as TextBox;
            DropDownList Category = MakeList.FooterRow.FindControl("lstCategory") as DropDownList;
            TextBox      Aisle    = MakeList.FooterRow.FindControl("txtAisle") as TextBox;
            TextBox      Price    = MakeList.FooterRow.FindControl("txtPrice") as TextBox;
            TextBox      Notes    = MakeList.FooterRow.FindControl("txtNotes") as TextBox;

            AccessDataSource1.InsertParameters["ItemQuantity"].DefaultValue   = Qty.Text;
            AccessDataSource1.InsertParameters["ItemName"].DefaultValue       = ItemName.Text;
            AccessDataSource1.InsertParameters["ItemCategoryId"].DefaultValue = Category.SelectedValue;
            AccessDataSource1.InsertParameters["ItemAisle"].DefaultValue      = Aisle.Text;
            AccessDataSource1.InsertParameters["ItemPrice"].DefaultValue      = Price.Text;
            AccessDataSource1.InsertParameters["ItemNotes"].DefaultValue      = Notes.Text;
            AccessDataSource1.Insert();

            //btnAddItem.Enabled = true;
            //MakeList.ShowFooter = false;
        }
예제 #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dv = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        if (dv.Count == 0)
        {
            Label1.Text = "Username and Password not match!";
            return;
        }

        Session["Username"] = dv[0].Row["Username"].ToString();
        Session["UserType"] = dv[0].Row["UserType"].ToString();
        Session["Password"] = dv[0].Row["Password"].ToString();

        if (Session["PID"] != null)
        {
            Response.Redirect("~/Products.aspx");
        }
        if (Session["UserType"].ToString().Equals("admin"))
        {
            Response.Redirect("~/Admin/Default.aspx");
        }
        if (Session["UserType"].ToString().Equals("user"))
        {
            Response.Redirect("~/Member/Default.aspx");
        }
    }
예제 #11
0
    protected void RunFilter(String val)
    {
        //AccessDataSource1.SelectCommand = "SELECT Codename, ModelName, ConfigurationNumber, ReleaseDate, Season, dbMemo FROM Products_Basic WHERE ((ReleaseDate LIKE '%2008' OR ReleaseDate LIKE '%2007' OR ReleaseDate LIKE '%2006')) AND (" + col + " LIKE '%" + val + "%') ORDER BY ReleaseDate DESC";
        AccessDataSource1.SelectCommand = "SELECT Codename, ModelName, ConfigurationNumber, ReleaseDate, Season, dbMemo FROM Products_Basic WHERE (ModelName LIKE '%" + val + "%') OR (Codename LIKE '%" + val + "%') OR (ConfigurationNumber LIKE '%" + val + "%') OR (Season LIKE '%" + val + "%') OR (dbMemo LIKE '%" + val + "%')   ORDER BY ReleaseDate DESC";

        AccessDataSource1.DataBind();
        GridView1.DataBind();
    }
예제 #12
0
 protected void RunFilter(String val, String os, String type, String desc)
 {
     //AccessDataSource1.SelectCommand = "SELECT Codename, ModelName, ConfigurationNumber, ReleaseDate, Season, dbMemo FROM Products_Basic WHERE ((ReleaseDate LIKE '%2008' OR ReleaseDate LIKE '%2007' OR ReleaseDate LIKE '%2006')) AND (" + col + " LIKE '%" + val + "%') ORDER BY ReleaseDate DESC";
     //AccessDataSource1.SelectCommand = "SELECT Codename, ModelName, ConfigurationNumber, ReleaseDate, Season, dbMemo FROM Products_Basic WHERE (ModelName LIKE '%" + val + "%') OR (Codename LIKE '%" + val + "%') OR (ConfigurationNumber LIKE '%" + val + "%') OR (Season LIKE '%" + val + "%') OR (dbMemo LIKE '%" + val + "%') ORDER BY ReleaseDate DESC";
     //AccessDataSource1.SelectCommand = "SELECT [SS-date-created] AS column1, [ModelName], [SS-OS-Abbreviation] AS column2, [SS-Description] AS column3, [SS-Version] AS column4, [SS-Size] AS column5, [SS-URLLocation] AS column6, [SS-Type] AS column7 FROM [LatestSilverStreamDrivers] WHERE ([SS-Type] = "UP") OR (ModelName LIKE '%" + val + "%')  ORDER BY ReleaseDate DESC";
     AccessDataSource1.SelectCommand = "SELECT DISTINCT [SS-Description] AS column3, [SS-date-created] AS column1, [ModelName], [SS-OS-Abbreviation] AS column2,  [SS-Version] AS column4, [SS-Size] AS column5, [SS-URLLocation] AS column6, [SS-Type] AS column7, [SS-URLLocation] AS column8  FROM [LatestSilverStreamDrivers] WHERE (ModelName LIKE '%" + val + "%') AND ([SS-Type] LIKE '" + type + "') AND ([SS-OS-Abbreviation] LIKE '" + os + "')  AND ([SS-Description] LIKE '%" + desc + "%') ORDER BY [SS-date-created] DESC";
     AccessDataSource1.DataBind();
     GridView1.DataBind();
 }
예제 #13
0
        protected void btnLogIn_Click(object sender, EventArgs e)
        {
            if ((bool)HttpContext.Current.Session["loggedIn"] == false)
            {
                try
                {
                    DataView customerTable = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);
                    customerTable.RowFilter = "UserName = '******'";
                    DataRowView row = customerTable[0];

                    if (txtPassword.Text == row["Password"].ToString())
                    {
                        Customer c = new Customer();
                        c.CustomerID = (int)row["CustomerID"];
                        c.Name       = row["Name"].ToString();
                        c.Address    = row["Address"].ToString();
                        c.City       = row["City"].ToString();
                        c.State      = row["State"].ToString();
                        c.ZipCode    = row["ZipCode"].ToString();
                        c.Email      = row["Email"].ToString();
                        c.UserName   = row["UserName"].ToString();
                        c.Password   = row["Password"].ToString();

                        HttpContext.Current.Session["currentUser"] = c;

                        HttpContext.Current.Session["loggedIn"] = true;

                        btnLogIn.Text = "Log Out";
                        HttpContext.Current.Session["loginButtonText"] = "Log Out";

                        txtUserName.Enabled = false;
                        txtPassword.Enabled = false;
                        HttpContext.Current.Session["loginTextboxEnabled"] = false;
                        lblError.Text = "";
                    }
                    else
                    {
                        lblError.Text = "Invalid Password";
                    }
                }
                catch (IndexOutOfRangeException)
                {
                    lblError.Text = "Invalid Username";
                }
            }
            else
            {
                HttpContext.Current.Session["loggedIn"] = false;

                btnLogIn.Text = "Log In";
                HttpContext.Current.Session["loginButtonText"] = "Log In";

                txtUserName.Enabled = true;
                txtPassword.Enabled = true;
                HttpContext.Current.Session["loginTextboxEnabled"] = true;
            }
        }
예제 #14
0
 private void modificaInregistrare()
 {
     AccessDataSource1.UpdateParameters[0].DefaultValue = TxtDProdus.Text;
     AccessDataSource1.UpdateParameters[1].DefaultValue = DdlUM.Text;
     AccessDataSource1.UpdateParameters[2].DefaultValue = DdlTVA.Text;
     AccessDataSource1.UpdateParameters[3].DefaultValue = TxtPretVanzare.Text;
     AccessDataSource1.UpdateParameters[4].DefaultValue = TxtIdProdus.Text;
     AccessDataSource1.Update();
 }
예제 #15
0
 private void adaugaInregistrare()
 {
     AccessDataSource1.InsertParameters[0].DefaultValue = TxtDProdus.Text;
     AccessDataSource1.InsertParameters[1].DefaultValue = DDLUM.Text;
     AccessDataSource1.InsertParameters[2].DefaultValue = DDLTVA.Text;
     AccessDataSource1.InsertParameters[3].DefaultValue = TxtPret.Text;
     AccessDataSource1.InsertParameters[4].DefaultValue = TxtCategorie.Text;
     AccessDataSource1.Insert();
     nullControale();
 }
예제 #16
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int sid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());

        data();
        query = "delete from studet where id=" + sid + "";
        AccessDataSource1.DeleteCommand = query;
        AccessDataSource1.Delete();
        con.Close();
        GridView1.DataBind();
    }
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string cname = GridView1.DataKeys[e.RowIndex].Values[0].ToString();

        data();
        query = "delete from compcreate where compname='" + cname + "'";
        AccessDataSource1.DeleteCommand = query;
        AccessDataSource1.Delete();
        con.Close();
        GridView1.DataBind();
    }
    protected void ASPxUploadControl1_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
    {
        string path = "~/ImagesDB/" + e.UploadedFile.FileName;

        e.UploadedFile.SaveAs(Server.MapPath(path));

        AccessDataSource1.InsertParameters["Model"].DefaultValue         = "New Model";
        AccessDataSource1.InsertParameters["Pixels"].DefaultValue        = "0";
        AccessDataSource1.InsertParameters["ImageFileName"].DefaultValue = e.UploadedFile.FileName;

        AccessDataSource1.Insert();
    }
예제 #19
0
    void bindData()
    {
        PagedDataSource pds = new PagedDataSource();

        pds.AllowPaging      = true;
        pds.PageSize         = AspNetPager1.PageSize;
        pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
        DataView dv = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        pds.DataSource       = dv;
        Repeater1.DataSource = pds;
        Repeater1.DataBind();
    }
예제 #20
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath(Request.ApplicationPath.ToString())
                               + "//Images//"
                               + FileUpload1.FileName);
        }

        Session["PImagePath"] = "~/Images/" + FileUpload1.FileName;

        AccessDataSource1.Insert();
    }
        protected void btnCheckout_Click(object sender, EventArgs e)
        {
            Customer currentUser = (Customer)HttpContext.Current.Session["currentUser"];

            AccessDataSource1.InsertParameters["CustomerID"].DefaultValue = currentUser.CustomerID.ToString();
            AccessDataSource1.InsertParameters["OrderDate"].DefaultValue  = DateTime.Now.ToString();
            AccessDataSource1.InsertParameters["TotalCost"].DefaultValue  = cart.TotalCost.ToString();

            AccessDataSource1.Insert();

            cart.Clear();

            Response.Redirect("Orders.aspx");
        }
예제 #22
0
    private int BindPagedData(int pageIndex)
    {
        // Here you can put your custom code to fetch a portion of data from your datasource
        PagedDataSource pds = new PagedDataSource();

        pds.AllowPaging      = true;
        pds.PageSize         = 10;
        pds.CurrentPageIndex = pageIndex;
        pds.DataSource       = AccessDataSource1.Select(new DataSourceSelectArguments());

        Repeater1.DataSource = pds;
        Repeater1.DataBind();

        return(pds.PageCount);
    }
예제 #23
0
    protected void ASPxCallbackPanel1_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        String param = e.Parameter.Replace("'", "''");

        AccessDataSource1.SelectCommand = "SELECT * FROM [Products] WHERE ProductName = '" + param + "'";
        IEnumerable data = AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView row in data)
        {
            ASPxLabel1.Text = "Price: " + row["UnitPrice"].ToString();
            ASPxLabel2.Text = "Units in Stock: " + row["UnitsInStock"].ToString();
            headerText      = row["ProductName"].ToString();
            break;
        }
    }
예제 #24
0
        private DataTable CreatePivotData()
        {
            DataTable dt = new DataTable();

            if (Session["PivotData"] != null)
            {
                dt = (DataTable)Session["PivotData"];
            }
            else
            {
                dt = ((DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty)).Table;
                Session["PivotData"] = dt;
            }
            return(dt);
        }
예제 #25
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dv = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        if (dv.Count == 1)
        {
            Label2.Visible = true;
            return;
        }
        else
        {
            AccessDataSource1.Insert();
            Response.Redirect("~/Login.aspx");
        }
    }
 protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     string[] param = e.Parameters.Split('|');
     if (param[0] == "oneRow")
     {
         int          visibleIndex   = int.Parse(param[1]);
         ASPxGridView grid           = sender as ASPxGridView;
         ASPxTextBox  tbCategoryName = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["CategoryName"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         ASPxTextBox  tbDescription  = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["Description"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         AccessDataSource1.UpdateParameters["CategoryName"].DefaultValue = tbCategoryName.Text;
         AccessDataSource1.UpdateParameters["Description"].DefaultValue  = tbDescription.Text;;
         AccessDataSource1.UpdateParameters["CategoryID"].DefaultValue   = grid.GetRowValues(visibleIndex, "CategoryID").ToString();
         AccessDataSource1.Update();
     }
     ASPxGridView1.DataBind();
 }
예제 #27
0
    protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e)
    {
        AccessDataSource1.UpdateParameters["EmployeeID"].DefaultValue = ASPxTextBoxEmployeeID.Value.ToString();
        AccessDataSource1.UpdateParameters["LastName"].DefaultValue   = ASPxTextBoxLastName.Value.ToString();
        AccessDataSource1.UpdateParameters["FirstName"].DefaultValue  = ASPxTextBoxFirstName.Value.ToString();
        AccessDataSource1.UpdateParameters["BirthDate"].DefaultValue  = Convert.ToDateTime(ASPxDateEditBirthDate.Value).ToShortDateString();

        //for example purpose only, because online editing is not supported
        throw new Exception("Editing in online example is not supported"); //remove this line when testing the project

        AccessDataSource1.Update();                                        //Uncomment this line

        ASPxGridView gridView = (ASPxGridView)sender;

        gridView.DataBind();
    }
    protected void ASPxImageGallery1_CustomCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        string[] parts   = e.Parameter.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
        string   command = parts[0];

        if (command.Equals("REMOVE", StringComparison.InvariantCultureIgnoreCase))
        {
            File.Delete(string.Format(Server.MapPath(ASPxImageGallery1.ImageUrlFormatString), GetImageFileNameById(parts[1])));
            AccessDataSource1.DeleteParameters["ID"].DefaultValue = parts[1];
            AccessDataSource1.Delete();
            ASPxImageGallery1.UpdateImageCacheFolder();
        }
        else if (command.Equals("REFRESH", StringComparison.InvariantCultureIgnoreCase))
        {
            ASPxImageGallery1.UpdateImageCacheFolder();
        }
    }
예제 #29
0
 protected void btnGetIncidents_Click(object sender, EventArgs e)
 {
     incidentsTable = (DataView)
                      AccessDataSource1.Select(DataSourceSelectArguments.Empty);
     incidentsTable.RowFilter = "CustomerID = " + txtCustomerID.Text
                                + " And DateClosed Is Not Null";
     if (incidentsTable.Count > 0)
     {
         this.DisplayClosedIncidents();
         this.EnableControls(true);
         lstIncidents.Focus();
     }
     else
     {
         lblNoIncidents.Text = "There are no incidents for that customer.";
         this.EnableControls(false);
     }
 }
예제 #30
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        List <int> islenecekler = islenecekMesajlar();

        if (islenecekler == null || islenecekler.Count == 0)
        {
            Labelbilgi.Text = "<p class='msg warning'><b>Hiçbir kayıt seçmediniz!</b></p>";
            return;
        }

        foreach (int id in islenecekler)
        {
            iletisimmesaj mesaj = iletisimmesaj.Select(id);
            mesaj.Delete();
        }
        AccessDataSource1.Select(DataSourceSelectArguments.Empty);
        ListView1.DataBind();
    }