Exemplo n.º 1
0
    protected void imgbtnRemove_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton ib = (ImageButton)sender;
        HiddenField hf = (HiddenField)ib.FindControl("hfServiceName");

        RemoveService(hf.Value);
    }
    protected void imgbtnEdit_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton ibEdit = (ImageButton)sender;
        HiddenField hf     = (HiddenField)ibEdit.FindControl("hfServiceId");

        Response.Redirect(WebHelper.Instance.GetURL() + "ManageService/Service/Modify/" + hf.Value);
    }
Exemplo n.º 3
0
        protected void Product_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton btn       = sender as ImageButton;
            HiddenField productID = btn.FindControl("hiddenProduct") as HiddenField;

            Response.Redirect("Product.aspx?id=" + productID.Value);
        }
Exemplo n.º 4
0
 protected void RadGridPatients_ItemCommand(object sender, GridCommandEventArgs e)
 {
     if (e.CommandName == "AddProcess")
     {
         ImageButton btnAddProcess   = e.CommandSource as ImageButton;
         Panel       PatientRegPanel = btnAddProcess.NamingContainer.FindControl("PatientRegPanel") as Panel;
         PatientRegPanel.Visible = !PatientRegPanel.Visible;
         btnAddProcess.Visible   = false;
         Panel PatientProcessMedicine = btnAddProcess.FindControl("PatientProcessMedicine") as Panel;
         PatientProcessMedicine.Visible = false;
     }
 }
        protected void btn_oUnlike_Click(object sender, ImageClickEventArgs e)
        {
            if (korisnik != null)
            {
                ImageButton _sender = (ImageButton)sender;
                HiddenField hid     = (HiddenField)_sender.FindControl("hf");


                using (TriglavBL temp = new TriglavBL())
                {
                    Post odgovorNaLIsti = temp.getOdgovorByID(Convert.ToInt32(hid.Value));

                    if (odgovorNaLIsti != null)
                    {
                        user_likes = temp.getUserLikes(korisnik.id, odgovorNaLIsti.id);

                        if (user_likes == null)
                        {
                            user_likes               = new Data.EntityFramework.DAL.User_Likes();
                            user_likes.PostId        = post.id;
                            user_likes.UserId        = korisnik.id;
                            user_likes.DaumRated     = DateTime.Now;
                            user_likes.DatumLajkanja = DateTime.Now;
                            user_likes.isLiked       = 2;
                            user_likes.Rate          = 0;
                            temp.SaveUser_Unlikes(user_likes);
                        }
                        else
                        {
                            Int32 LikesBefore = temp.getVoteUserLikes(user_likes.UserId.Value, user_likes.PostId.Value);
                            user_likes.DatumLajkanja = DateTime.Now;
                            user_likes.isLiked       = 2;
                            temp.UpdateUser_Likes(user_likes, LikesBefore);
                        }
                    }
                }
                LoadClanak(post.id);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "Login()", true);
            }
        }
Exemplo n.º 6
0
    protected void btn_Click(object sender, ImageClickEventArgs e)
    {
        switch (Session["Admin_Type"].ToString())
        {
        case "USER":
            ImageButton btn      = (ImageButton)sender;
            GridViewRow grdRow   = (GridViewRow)btn.Parent.Parent as GridViewRow;
            Label       isEnable = (Label)btn.FindControl("IsEnable");
            Label       id       = (Label)grdRow.FindControl("grade_id");
            bool        result   = ClientAdmin.Utility.Grid_gradescaleActiveDesc(isEnable.Text, id.Text, Session["Admin_Customer"].ToString());
            if (result)
            {
                action();
            }
            break;

        default:
            Response.Redirect("~/Fail.aspx");
            break;
        }
    }
    protected void imgbtnRestore_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            ImageButton ibRestore = (ImageButton)sender;
            HiddenField hf        = (HiddenField)ibRestore.FindControl("hfOrderOfServiceId");

            OB.RestoreOrder(new Guid(hf.Value));
            loadData();
            pnlGreen.Visible       = true;
            lblSuccess.Text        = "An order has been restored successfully.";
            hplnkGreen.Text        = "Go to Manage panel.";
            hplnkGreen.NavigateUrl = WebHelper.Instance.GetURL() + "ManageService/Order/Manage";
        }
        catch (Exception ex)
        {
            pnlRed.Visible       = true;
            lblError.Text        = ex.Message;
            hplnkRed.Text        = "Close and continue.";
            hplnkRed.NavigateUrl = "";
        }
    }
Exemplo n.º 8
0
    protected void imgbtnDelete_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            ImageButton ibDelete = (ImageButton)sender;
            HiddenField hf       = (HiddenField)ibDelete.FindControl("hfDepartmentId");

            DB.DeleteDepartment(new Guid(hf.Value));
            loadData();
            pnlGreen.Visible       = true;
            lblSuccess.Text        = "A department has been deleted successfully.";
            hplnkGreen.Text        = "Close and continue.";
            hplnkGreen.NavigateUrl = "";
        }
        catch (Exception ex)
        {
            pnlRed.Visible       = true;
            lblError.Text        = ex.Message;
            hplnkRed.Text        = "Close and continue.";
            hplnkRed.NavigateUrl = "";
        }
    }
    protected void imgbtnRemove_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            ImageButton ibRemove = (ImageButton)sender;
            HiddenField hf       = (HiddenField)ibRemove.FindControl("hfServiceId");

            SB.RemoveService(new Guid(hf.Value));

            pnlGreen.Visible       = true;
            lblSuccess.Text        = "A service has been removed successfully, this data could be restored from Trash.";
            hplnkGreen.Text        = "Go to trash.";
            hplnkGreen.NavigateUrl = WebHelper.Instance.GetURL() + "ManageService/Service/Trash";
            loadData();
        }
        catch (Exception ex)
        {
            pnlRed.Visible       = true;
            lblError.Text        = ex.Message;
            hplnkRed.Text        = "Close and continue.";
            hplnkRed.NavigateUrl = "";
        }
    }
    protected void imgbtnEditAccount_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton ibRemove = (ImageButton)sender;
        HiddenField hf       = (HiddenField)ibRemove.FindControl("hfEmployeeId");

        Account account         = AB.GetAccountOfEmployee(new Guid(hf.Value));
        Account accountLoggedIn = AB.GetAccount(Page.User.Identity.Name);

        if (account != null)
        {
            if (account.Account_Id == accountLoggedIn.Account_Id)
            {
                pnlRed.Visible          = true;
                lblError.Text           = "You don't have permission to execute this task.";
                hplnkYellow.NavigateUrl = "";
                hplnkYellow.Text        = "Close and continue.";
                return;
            }
            if (account.Account_IsDelete)
            {
                pnlYellow.Visible       = true;
                lblMessage.Text         = "This account has been removed. You could restore it from Trash.";
                hplnkYellow.NavigateUrl = WebHelper.Instance.GetURL() + "ManageSystem/Account/Trash";
                hplnkYellow.Text        = "Go to Trash.";
                return;
            }
            Response.Redirect(WebHelper.Instance.GetURL() + "ManageSystem/Account/Modify/" + account.Account_Id);
        }
        else
        {
            pnlYellow.Visible       = true;
            lblMessage.Text         = "This employee has not registered an account.";
            hplnkYellow.NavigateUrl = WebHelper.Instance.GetURL() + "ManageSystem/Account/Create/" + hf.Value;
            hplnkYellow.Text        = "Create account.";
            return;
        }
    }