Пример #1
0
    public static int DeleteFiles(Tools.Tables tableName, int filesId)
    {
        using (SqlCommand com = new SqlCommand())
        {
            com.CommandText = $"Delete From " +
                              $"{tableName} " +
                              $"Where Id=@ProductsId";
            com.Parameters.Add("@ProductsId", SqlDbType.Int).Value = filesId;
            com.Connection = SqlConn;

            try
            {
                com.Connection.Open();
                return(com.ExecuteNonQuery());
            }
            catch (Exception er)
            {
                DALC.ErrorLog(string.Format("DALCA.DeleteFiles [{0}] catch error: {1}", tableName, er.Message));
                return(-1);
            }
            finally
            {
                com.Connection.Close();
                com.Connection.Dispose();
            }
        }
    }
Пример #2
0
 protected void btnFilter_Click(object sender, EventArgs e)
 {
     try
     {
         PnlContent.Controls.Add(Page.LoadControl($"/modules/reports/usercontrols/{dlistReportsType.SelectedValue}.ascx"));
     }
     catch (Exception er)
     {
         DALC.ErrorLog("Report modules user control binding catch error: " + er.Message);
         ConfigL.RedirectError();
         return;
     }
 }
Пример #3
0
 public static void ErrorLog(string LogText, bool IsSendMail = false)
 {
     DALC.ErrorLog(LogText, HttpContext.Current.Request.Url.ToString(), HttpContext.Current.Request.UserHostAddress.ToString(), IsSendMail);
 }