Example #1
0
    protected void sdsProducto_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        decimal outputValue = (decimal)(e.Command.Parameters)[0].Value;
        String NombreProducto = Convert.ToString((e.Command.Parameters)[1].Value);

        Response.Redirect("./Mantenimientos/vAsociaProductos.aspx?ProductoId=" + outputValue + "&nombreProducto=" + NombreProducto);
    }
Example #2
0
    protected void SDSUye_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception == null)
        {
            if (!string.IsNullOrEmpty(resimAdi))
            {
                Image img = ((Image)FVUye.FindControl("ImgRes"));
                try { File.Delete(Server.MapPath(img.ImageUrl)); }
                catch { }
            }

            if (Request.Form["HdnYeni"] == "1")
            {
                Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", true);
                Response.Redirect(Request.Url.AbsolutePath, true);
            }
            else
                Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
        }
        else
        {
            e.ExceptionHandled = true;
            if (e.Exception.Message.Contains("$#sqlhata1#$"))
                Snlg_Hata.ziyaretci.HataGosterHatali("Bu kullanıcı adı başkası tarafından kullanılıyor.", false);
            else if (e.Exception.Message.Contains("$#sqlhata2#$"))
                Snlg_Hata.ziyaretci.HataGosterHatali("Bu E-posta adresi başkası tarafından kullanılıyor.", false);
            else
            {
                Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
                Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
            }
            try { File.Delete(Server.MapPath("~/uploads/user/" + resimAdi)); }
            catch { }
        }
    }
 protected void srcMessage_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows == 0)
     {
         Response.StatusCode = 404;
     }
 }
    protected void sdsAseguradoFRM_Inserted(object sender, SqlDataSourceStatusEventArgs e)
    {
        this.hdfAseguradoId.Value = e.Command.Parameters["@personaId"].Value.ToString();
        this.hdfAsegurado.Value = ((TextBox)this.FormView1.FindControl("PrimerNombreTextBox")).Text;

        this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "callParent", " xAddEventListener(window,'load',copyValues);", true);
    }
Example #5
0
 protected void SDSSyf_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows < 1)
         FVSyf.ChangeMode(FormViewMode.Insert);
     else
         FVSyf.ChangeMode(FormViewMode.Edit);
 }
 protected void ds_Enrollment_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows > 0)
         lbl_error.Text = "Save Successfully.";
     else
         lbl_error.Text = "Save fail.";
     lbl_error.Visible = true;
 }
 protected void SqlDataSourceModifica_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         LabelErrorMessage.Text = "Impossibile eseguire la cancellazione probabilmente l'emento è in uso dalla tabella Strumenti.\n" + e.Exception.Message;
         e.ExceptionHandled = true;
     }
 }
    protected void dsSelectedCommunication_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        //once updated, send user back to gridview
        mvCommunications.ActiveViewIndex = 0;

        //update the gridview
        gvCommunications.DataBind();
    }
 protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if(e.Exception != null)
     {
         Label1.Text = "Data error";
         e.ExceptionHandled = true;
     }
 }
 protected void SDS_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows < 1)
         this.Visible = false;
     else
     {
         base.pg.ScriptOrCssFileImportHead("/scripts/jquery.raty-2.4.5/js/jquery.raty.min.js");
     }
 }
    protected void SqlDataSource2_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        // check e to see if an exception has happened
        if(e.Exception != null) {
            Label12.Text = "An error occured when performing the query";

            e.ExceptionHandled = true;
        }
    }
Example #12
0
    protected void save_click(object sender, SqlDataSourceStatusEventArgs e)
    {
        a_step_2.Disabled = false;
        a_step_3.Disabled = false;
        (fv_contact.FindControl("tb_name") as TextBox).Enabled = false;
        ltrl_changes_submitted.Visible = true;

        Session["unfinishedContact"] = int.Parse(e.Command.Parameters["@contact_id"].Value.ToString());
    }
Example #13
0
 protected void SDSResim_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
 }
    protected void sdsEliminarAjuste_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        this.lblMensaje.Text = "El Caso de Ajuste se encuentra ahora Eliminado, ya no podrá acceder a el...";
        /*this.pnlConfirmacion.Style.Remove(HtmlTextWriterStyle.BackgroundColor);
        this.pnlConfirmacion.Style.Add(HtmlTextWriterStyle.BackgroundColor, "RED");*/
        this.pnlConfirmacion.Visible = true;

        this.ClientScript.RegisterStartupScript(this.GetType(), "scriptInicial", "window.onload = function() { cierraLaVentana();}", true);
    }
 protected void SDS_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     //eğer kayıt var ise css dosyasını import et
     if (e.AffectedRows < 1)
         this.Visible = false;
     else
     {
         pg.ScriptOrCssFileImportHead("//cdn.jsdelivr.net/jquery.marquee/1.3.1/jquery.marquee.min.js");
     }
 }
Example #16
0
 protected void Sds_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         HdnHataTur.Value = "alert alert-danger";
         HdnHata.Value = "Beklenmeyen bir hata oluştu.";
     }
 }
Example #17
0
 protected void SDS_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         HdnHataTur.Value = "hatali";
         HdnHata.Value = "Beklenmeyen bir hata oluştu.";
     }
 }
Example #18
0
 protected void Comment_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows <= 0)
     {
         NoComment.Visible = true;
     }
     else
     {
         NoComment.Visible = false;
     }
 }
Example #19
0
 protected void CheckLogin(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows > 0)
     {
         FormsAuthentication.RedirectFromLoginPage(Login.UserName, false);
     }
     else
     {
         Login.FailureText = "Wrong user name or password!";
     }
 }
Example #20
0
 protected void SDSDyr_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
         Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz dildeki duyuru içeriği silindi.", false);
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
 }
    protected void pInsert(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception == null)
        {
            mensagemErro.Text = String.Format("<br> Product '{0}' successfully added. <br><br>", e.Command.Parameters["@id_product"].Value);
            ProductsMultiView.ActiveViewIndex = 0;
            LinkProductsManage.CssClass = "selectedview";
            LinkProductsCreate.CssClass = "";

            string id_product_for_image = String.Format("{0}", e.Command.Parameters["@id_product"].Value);

            // verifica o tipo de ficheiro
            // neste exemplo, apenas vamos permitir upload ficheiros do tipo JPG
            if (imageUpload.PostedFile.ContentType == "image/jpg" || imageUpload.PostedFile.ContentType == "image/jpeg" || imageUpload.PostedFile.ContentType == "image/pjpeg")
            {
                // verifica o tamanho do ficheiro
                // neste exemplo, o tamanho do ficheiro tem que ser superior a ZERO e inferior a 512 Kb
                if (imageUpload.PostedFile.ContentLength > 0 && imageUpload.PostedFile.ContentLength < (512 * 1024))
                {
                    try
                    {
                        //imageUpload.PostedFile.SaveAs(Server.MapPath("~/files/products/" + imageUpload.PostedFile.FileName));
                        imageUpload.PostedFile.SaveAs(Server.MapPath("~/files/products/" + id_product_for_image + ".JPG"));
                        mensagemErro.Text += "Ficheiro guardado com sucesso no servidor!<br />";
                        mensagemErro.Text += "File name: " + imageUpload.PostedFile.FileName + "<br>" + imageUpload.PostedFile.ContentLength + " kb<br>" + "Content type: " + imageUpload.PostedFile.ContentType;
                        mensagemErro.CssClass = "ok";
                    }
                    catch (Exception ex)
                    {
                        mensagemErro.Text += "Ocorreu um erro ao tentar guardar no servidor";
                        mensagemErro.Text += "<br />" + ex.Message.ToString();
                        mensagemErro.CssClass = "error";
                    }

                }
                else
                {
                    mensagemErro.Text += "Ficheiro inválido: o tamanho não pode exceder os 512 kB";
                    mensagemErro.CssClass = "error";
                }
            }
            else
            {
                mensagemErro.Text += "Ficheiro inválido/Sem Ficheiro: escolha uma imagem JPG";
                mensagemErro.CssClass = "error";
            }
        }
        else
        {
            mensagemErro.Text = "Unable to add Product. Please try again.";
            e.ExceptionHandled = true;
        }
        mensagemErro.Text += "<br>";
    }
Example #22
0
 protected void SDSSyflar_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
         Snlg_Hata.ziyaretci.HataGosterBasarili("Nitelik silindi.", false);
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali(e.Exception.Message.Replace("'", "") + "Beklenmeyen bir hata oluştu.", false);
     }
 }
Example #23
0
	protected void sourceEmployees_Selected(object sender, SqlDataSourceStatusEventArgs e)
	{
		if (e.Exception != null)
		{
			// Mask the error with a generic message (for security purposes.)
			lblError.Text = "An exception occured performing the query.";

			// Consider the error handled.
			e.ExceptionHandled = true;
		}
	}
Example #24
0
 protected void SqlDataSource1_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         ShowMessage("Actualizado con éxito");
     }
     else
     {
         ShowMessage("Se ha producido un error al actualizar, la operación fue cancelada");
         e.ExceptionHandled = true;
     }
 }
Example #25
0
 protected void SDSSyflar_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
         Snlg_Hata.ziyaretci.HataGosterBasarili("Nitelik tanımlandı.", false);
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
     GVSyf.DataBind();
 }
Example #26
0
 protected void SdsIcerik_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
         Snlg_Hata.ziyaretci.HataGosterBasarili("Yeni menü tanımlandı.", true);
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu. " + e.Exception.Message.Replace("'", ""), true);
     }
     Response.Redirect(Request.Url.AbsoluteUri, true);
 }
Example #27
0
 protected void SDSSyf_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
         Snlg_Hata.ziyaretci.HataGosterBasarili("Sayfa oluşturuldu.", true);
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
     }
     Response.Redirect(Request.Url.AbsolutePath, true);
 }
Example #28
0
 protected void SqlDataSource1_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null && e.Exception is SqlException)
     {
       SqlException myException = (SqlException)e.Exception;
       if (myException.Number == 547)
       {
     ErrorMessage.Text = @"Sorry, you can't delete this genre because it has associated reviews that you need to delete first.";
     e.ExceptionHandled = true;
       }
     }
 }
Example #29
0
 protected void dsSubCategories_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows > 0)
     {
         Session["SubCategoryMessage"] = "Sub Category was successfully deleted.";
         Response.Redirect("subcategories.aspx");
     }
     else
     {
         Session["SubCategoryMessage"] = "Sub Category was not deleted.";
         Response.Redirect("subcategories.aspx");
     }
 }
Example #30
0
 protected void SqlDataSource1_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null && e.Exception is SqlException)
     {
         SqlException myException = (SqlException)e.Exception;
         if (myException.Number == 547)
         {
             lblErrorMessage.Text = @"Sorry, you can't delete this genre because 
             it has associated reviews that you need to delete first.";
             e.ExceptionHandled   = true;
         }
     }
 }
Example #31
0
 protected void srccmsdetail_updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         lblmsg.Visible = true;
         lblmsg.Text    = "Home Page updated successfully";
     }
     else
     {
         lblmsg.Visible = true;
         lblmsg.Text    = "There is some technical difficulty with the process , please try again";
     }
 }
    protected void SqlDataSource2_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception!=null)
        {
            lblResults.Text = "You broke it... why would you do that?";
            lblResults.Text += "<br><br><b> Message: </b> " + e.Exception.Message + "<br><br>";
            lblResults.Text += "<b> Source: </b> " + e.Exception.Source + "<br><br>";
            lblResults.Text += "<b> Stack Trace: </b> " + e.Exception.StackTrace;
            lblResults.ForeColor = System.Drawing.Color.Red;

            e.ExceptionHandled = true;
        }
    }
Example #33
0
 protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     //use e.AffectedRows for ensure success action. The store read this value and set predefined Confirm depend on e.AffectedRows
     //The Confirm can be granted or denied in OnRecord....ed event
     //if (e.AffectedRows > 0 && e.Command.Parameters["@newId"].Value != null)
     //{
     //    insertedValue = (int)e.Command.Parameters["@newId"].Value;
     //}
     //else
     //{
     //    insertedValue = null;
     //}
 }
Example #34
0
 protected void SDSUye_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz dildeki üye bilgileri silindi.", false);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
 }
Example #35
0
 protected void OnDSUpdatedHandler(Object source, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows > 0)
     {
         // Perform any additional processing,
         // such as setting a status label after the operation.
         lblUpdate.Text = "Changed information successfully!";
     }
     else
     {
         lblUpdate.Text = "No data updated!";
     }
 }
 protected void SDSResim_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Değişiklikler kaydedildi.", false);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
 }
    protected void dsCaseActivities_Selected(object sender, SqlDataSourceStatusEventArgs e)
    {
        if (e.Exception != null)
        {
            //Show error message
            frmCaseDetails.Visible = false;
            lblError.Visible = true;
            lblError.Text = "The database is currently offline";

            //Set the exception handled property so it doesn't bubble-up
            e.ExceptionHandled = true;
        }
    }
 protected void sqlRegionMaint_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         lblPopup.Text = "Unable to delete region when it contains chapters.";
         popupErrorMsg.Show();
         e.ExceptionHandled = true;
     }
     else
     {
         ddRegions.DataBind();
         fvRegion.DataBind();
     }
 }
 protected void Sdsicerikler_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Menü silindi.", false);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
     Response.Redirect(Request.Url.AbsolutePath);
 }
 protected void SdsIcerik_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Yeni menü tanımlandı.", true);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu. " + e.Exception.Message.Replace("'", ""), true);
     }
     Response.Redirect(Request.Url.AbsoluteUri, true);
 }
 protected void SdsUrlkeysGroup_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Url Keys silindi.", true);
         Response.Redirect(Request.Url.AbsoluteUri, true);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali(e.Exception.Message.Replace("'", "") + "Beklenmeyen bir hata oluştu.", false);
     }
 }
        protected void SqlDataSource1_Updated(object sender, SqlDataSourceStatusEventArgs e)
        {
            DataClasses2DataContext dc = new DataClasses2DataContext();

            update_exam ue = new update_exam();

            ue.date        = System.DateTime.Now;
            ue.description = "updated";

            ue.exam_name = DropDownList2.SelectedValue;
            ue.username  = Session["username"].ToString();
            dc.update_exams.InsertOnSubmit(ue);
            dc.SubmitChanges();
        }
Example #43
0
    protected void dsOptions_Updated(object sender, SqlDataSourceStatusEventArgs e)
    {
        DropDownList DDLPeriodo = (DropDownList)FVMain.FindControl("DDLPeriodo");
        DropDownList DDLMese    = (DropDownList)FVMain.FindControl("DDLMese");
        TextBox      TBanno     = (TextBox)FVMain.FindControl("TBAnno");

        // imposta sessione
        CurrentSession.dCutoffDate = Utilities.GetCutoffDate(DDLPeriodo.SelectedValue.ToString(), DDLMese.SelectedValue.ToString(), TBanno.Text, "end");
        CurrentSession.sCutoffDate = CurrentSession.dCutoffDate.ToString("d");
        Session["CurrentSession"]  = CurrentSession;

        // imposta il messaggio che verrò dato sulla pagina di menu
        Response.Redirect("/timereport/menu.aspx?msgno=200&msgtype=I");
    }
Example #44
0
 protected void SDSSyf_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Seçtiğiniz dildeki menü içeriği silindi.", false);
         Response.Redirect(Request.Url.AbsolutePath + "?gid=" + UCId);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
 }
Example #45
0
 protected void SqlDataSource2_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows < 0)
     {
         Response.Write("<script>alert('User unavailable on that date')</script>");
         //Response.Write("<script>alert('"+parse+"')</script>");
     }
     else if (recepient != 0)
     {
         string email = dc.getemail(recepient);
         JobScheduler.Start(email, parse);
         Response.Write("<script>alert('User successfully assigned!')</script>");
     }
 }
 protected void SDSSyflar_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Nitelik tanımlandı.", false);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", false);
     }
     GVSyf.DataBind();
 }
 protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     //如果有引发异常的话
     if (e.Exception != null)
     {
         if (e.Exception.GetType() == typeof(SqlException))
         {
             //显示出错信息,也可以加事件日志,或者将错误信息进行更好的封装
             Response.Write("在查询数据库时产生了一个错误,错误消息为:" + e.Exception.Message);
             //表示已经处理的数据库错误,系统将不会跳转到令网站使用者难以看懂的错误页面
             e.ExceptionHandled = true;
         }
     }
 }
Example #48
0
        protected void SqlAluno_Deleted(object sender, SqlDataSourceStatusEventArgs e)
        {
            //nprocesso
            string processo = e.Command.Parameters["@nprocesso"].Value.ToString();
            string ficheiro = Server.MapPath("~/Public/Fotos/") + processo + ".jpg";

            try
            {
                System.IO.File.Delete(ficheiro);
            }
            catch
            {
            }
        }
Example #49
0
        protected void SqlDataSourcePodaciOfajlu_Updated(object sender, SqlDataSourceStatusEventArgs e)
        {
            glavna mojMaster = (glavna)this.Master;

            if (e.Exception != null)
            {
                mojMaster.prikaziPoruku(e.Exception.Message, "error");
            }
            else
            {
                mojMaster.prikaziPoruku(string.Format("Uspesno ste azurirali {0} fajl", e.AffectedRows.ToString()), "info");
            }
            GridViewPrikazFajlova.DataBind();
        }
Example #50
0
 //Determines the item result count
 protected void sdsItems_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     try
     {
         litResults.Text = e.AffectedRows.ToString();
     }
     catch (Exception ex)
     {
         CommonCode error = new CommonCode();
         error.ReportError(ex.Message, "sdsItems_Selected: catalog.aspx.cs", Session["username"].ToString());
         divMessage.Visible = true;
         litMessage.Text    = "Attn: An error occured and has been reported to the web administrator.";
     }
 }
Example #51
0
        protected void SqlAlunos_Deleted(object sender, SqlDataSourceStatusEventArgs e)
        {
            string nprocesso = Request.QueryString["nprocesso"].ToString();

            string ficheiro = Server.MapPath("~/Public/Imagens/") + nprocesso + ".jpg";

            try
            {
                System.IO.File.Delete(ficheiro);
            }
            catch
            {
            }
        }
 protected void SDSSyf_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Kategori oluşturuldu.", true);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu. " + e.Exception.Message.Replace("'", ""), true);
     }
     Response.Redirect(Request.Url.AbsolutePath, true);
 }
 protected void sqlChapterMaint_Deleted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception != null)
     {
         lblPopup.Text = "Unable to delete chapter when it has students.";
         popupErrorMsg.Show();
         e.ExceptionHandled = true;
     }
     else
     {
         ddChapters.DataBind();
         fvChapter.DataBind();
     }
 }
 protected void SdsEtk_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.Exception == null)
     {
         Snlg_Hata.ziyaretci.HataGosterBasarili("Etkinlik oluşturuldu.", true);
     }
     else
     {
         Snlg_Hata.ziyaretci.ExceptionLogla(e.Exception);
         e.ExceptionHandled = true;
         Snlg_Hata.ziyaretci.HataGosterHatali("Beklenmeyen bir hata oluştu.", true);
     }
     Response.Redirect(Request.Url.AbsolutePath, true);
 }
Example #55
0
 //檢查相簿是否有保護,若有保護則需要密碼才能觀看
 //SQL之過濾回傳條件是以Protection='False'為基準
 //可指定Session["AllowAlbumID"]之AlbumID值
 protected void sqlProtect_Selected(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows >= 1)
     {
         //無保護相簿,指定可觀看之相簿ID
         Session["AllowAlbumID"] = albumID;
     }
     else
     {
         //查不到任何無保護相簿資料,所以相簿為保護狀態
         Session["AllowAlbumID"] = "Protected";
         Session["AlbumName"]    = "";
     }
 }
Example #56
0
        void SqlDataSource_Selected(object sender, SqlDataSourceStatusEventArgs e)
        {
            var pagerContext = new PagerContext(EffectivePageSizes, EffectivePageSize, EffectiveDisplayedPageSelectorCount);
            var pageContext  = _Pager.CreatePageContext(
                pagerContext,
                firstItemIndex: Math.Max(0, e.Command.Parameters["@_paging_firstRowIndex"].Value <long>() - 1),                     // Convert from 1-based to 0-based
                lastItemIndex: Math.Max(0, e.Command.Parameters["@_paging_lastRowIndex"].Value <long>() - 1),                       // Convert from 1-based to 0-based
                itemCount: e.Command.Parameters["@_paging_rowCount"].Value <long>(),
                pageIndex: Math.Max(0, e.Command.Parameters["@_paging_pageIndex"].Value <long>() - 1),                              // Convert from 1-based to 0-based
                pageCount: e.Command.Parameters["@_paging_pageCount"].Value <long>());

            _UpperPagingControls.UpdatePaging(pagerContext, pageContext);
            _LowerPagingControls.UpdatePaging(pagerContext, pageContext);
        }
Example #57
0
 protected void PubsDataSource_Selecting(object sender, SqlDataSourceStatusEventArgs e)
 {
     if (e.AffectedRows == 0)
     {
         lblNoItems.Text             = "<i>No publications have been added.</i>";
         lblNoItems.Visible          = true;
         grdEditPublications.Visible = false;
     }
     else
     {
         lblNoItems.Visible          = false;
         grdEditPublications.Visible = true;
     }
 }
 protected void SqlDataSource1_Inserted(object sender, SqlDataSourceStatusEventArgs e)
 {
     Debug.Print("[SqlDataSource1_Inserted]");
     foreach (SqlParameter param in e.Command.Parameters)
     {
         Debug.Print("  param: name={0}, val={1}", param.ParameterName, param.Value);
         if (param.Value == null)
         {
             Debug.Print("Cancelling...");
             // e.Cancel = true;
             return;
         }
     }
 }
Example #59
0
        /// <summary>
        /// We do not use oldValues so there is no concurrency check. We merge all the DeleteParameters
        /// specified in the markup. The base class apparently does not do that.
        /// </summary>
        /// <param name="keys"></param>
        /// <param name="oldValues"></param>
        /// <returns></returns>
        protected override int ExecuteDelete(IDictionary keys, IDictionary oldValues)
        {
            int nReturn = -1;

            DbCommand cmd = this.Connection.CreateCommand();

            cmd.Transaction = _transaction;

            CreateParametersFromDictionary(keys, cmd);
            if (!MergeMarkupParameters(cmd, this.DeleteParameters))
            {
                return(nReturn);
            }
            //cmd.CommandText = this.DeleteCommand;

            //SetCommandType(cmd, this.DeleteCommandType);
            SqlDataSourceCommandEventArgs cmdEventArgs = new SqlDataSourceCommandEventArgs(cmd);

            OnDeleting(cmdEventArgs);
            try
            {
                if (!cmdEventArgs.Cancel)
                {
                    SetConnection(cmd, OpenReason.Deleting);
                    QueryLogging.TraceOracleCommand(_context.Trace, cmd);
                    // Sharad 20 Sep 2012: This does not seem to be necessary any longer
                    //cmd.CommandText = cmd.CommandText.Replace("\r\n", " ");
                    nReturn = cmd.ExecuteNonQuery();
                    QueryLogging.TraceQueryEnd(this._context.Trace);
                    SqlDataSourceStatusEventArgs statusEventArgs = new SqlDataSourceStatusEventArgs(cmd, nReturn, null);
                    OnDeleted(statusEventArgs);
                    ClearEnumerable();
                }
            }
            catch (DbException ex)
            {
                SqlDataSourceStatusEventArgs statusEventArgs = new SqlDataSourceStatusEventArgs(cmd, 0, ex);
                OnDeleted(statusEventArgs);
                if (!statusEventArgs.ExceptionHandled)
                {
                    throw;
                }
            }
            finally
            {
                cmd.Dispose();
            }
            return(nReturn);
        }
Example #60
0
 //fungsi: Handle Ketika data pada database telah diupdate
 protected void dsLaporanPengesahan_Updated(object sender, SqlDataSourceStatusEventArgs e)
 {
     //Seleksi apakah terjadi error atau tidak
     //jika tidak ada record yang ter update maka terjadi error
     if (e.AffectedRows == 0)
     {
         ExceptionDetails2.Text = lblCannotUpdate.Text;     //& " (" & e.Exception.Message & ")"
         e.ExceptionHandled     = true;
     }
     else
     {
         //Catat ke Log
         azlib.AddUserAct(Session["UserID"].ToString(), "3302", e.Command.Parameters["@KODE_LAPORAN"].Value.ToString(), Application["strCn"].ToString());
     }
 }