Ejemplo n.º 1
0
 public bool DeleteByStatus(DataGrid DGrid, string DataTable, string DataFieldText, string CheckBoxID, string InputID, string SessionID)
 {
     try
     {
         System.Web.UI.WebControls.CheckBox chkExport;
         string sID    = "";
         bool   result = false;
         foreach (DataGridItem oDataGridItem in DGrid.Items)
         {
             chkExport = (CheckBox)oDataGridItem.FindControl(CheckBoxID);
             if (chkExport.Checked)
             {
                 sql = GetInfomationSql.DeleteBStatusSql(DataTable, DataFieldText, ((HtmlInputHidden)oDataGridItem.FindControl(InputID)).Value);
                 db.executeDelete(sql);
                 sID    = ((HtmlInputHidden)oDataGridItem.FindControl(InputID)).Value;
                 sID   += sID;
                 result = true;
             }
         }
         if (sID.Length < 1)
         {
             result = false;
         }
         return(result);
     }
     catch (Exception Err)
     {
         ErrorLog.LogInsert(Err.Message, "CS/GetInformation", SessionID);
         return(false);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 获取总数
 /// </summary>
 /// <param name="DataTable"></param>
 /// <param name="MaxFieldText"></param>
 /// <param name="FieldText"></param>
 /// <param name="FieldValue"></param>
 /// <returns></returns>
 public int GetIntCount(string DataTable, string FieldText, string FieldValue, string StrCondition, string SessionID)
 {
     try
     {
         sql      = GetInfomationSql.GetIntCountSql(DataTable, FieldText, FieldValue, StrCondition);
         StrCount = db.GetDataScalar(sql);
         return(Convert.ToInt32(StrCount));
     }
     catch (Exception Err)
     {
         ErrorLog.LogInsert(Err.Message, "CS/GetInformation", SessionID);
         return(0);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取最大值序号
 /// </summary>
 /// <param name="DataTable"></param>
 /// <param name="MaxFieldText"></param>
 /// <param name="FieldText"></param>
 /// <param name="FieldValue"></param>
 /// <returns></returns>
 public string GetMaxValue(string DataTable, string MaxFieldText, string FieldText, string FieldValue)
 {
     try
     {
         sql = GetInfomationSql.GetMaxValueSql(DataTable, MaxFieldText, FieldText, FieldValue);
         string StrMaxValue = db.GetDataScalar(sql).ToString();
         if (StrMaxValue == null || StrMaxValue == "")
         {
             StrMaxValue = "-1";
         }
         return(StrMaxValue);
     }
     catch (Exception Err)
     {
         //ErrorLog.LogInsert(Err.Message, "CS/GetInformation", StaffID);
         return("");
     }
 }