示例#1
0
        public bool UpdateProcId(string procCode, string procName)
        {
            DBParameterCollection paramCollection = new DBParameterCollection();

            paramCollection.Add(new DBParameter("@procCode", procCode, DbType.String));
            paramCollection.Add(new DBParameter("@procName", procName, DbType.String));

            string sqlCommand = "SELECT * FROM ProcedureMaster WHERE ProcedureCode=@procCode AND ProcedureName=@procName AND IsActive=1";


            int       procId = 0;
            bool      retVal = false;
            DataTable data   = _dbHelper.ExecuteDataTable(sqlCommand, paramCollection);

            if (data.Rows.Count > 0)
            {
                procId = DataFormat.GetInteger(data.Rows[0]["TranId"]);
                paramCollection.RemoveAll();
                paramCollection = new DBParameterCollection();
                paramCollection.Add(new DBParameter("@procId", procId));
                paramCollection.Add(new DBParameter("@tranId", procId));
                string Query = "UPDATE ProcedureMaster SET ProcedureId = @procId WHERE TranId = @tranId";
                retVal = _dbHelper.ExecuteNonQuery(Query, paramCollection) > 0;
            }
            return(retVal);
        }
 public void UpdateMainReport()
 {
     for (int i = 0; i < int.Parse(Request.Form["Length"].ToString()); i++)
     {
         var dbp = new DBParameterCollection();
         dbp.Add(new DBParameter("@DoneMonth", Request.Form[string.Format("DoneMonth{0}", i)]));
         dbp.Add(new DBParameter("@PresentMonth", CalculateMonthPercent(i).ToString()));
         dbp.Add(new DBParameter("@IncrementalDone", CalculateIncremental(i)));
         dbp.Add(new DBParameter("@PresentIncremental", CalculateIncrementalPercent(i)));
         dbp.Add(new DBParameter("@PrfMsrIndx", Session[string.Format("PrfMsrIndx{0}", i)]));
         dbp.Add(new DBParameter("@Remark", Request.Form[string.Format("Remark{0}", i)]));
         dbConn.ExecuteQuery(Queries.UpdateReport, dbp);
         dbp.RemoveAll();
     }
 }