コード例 #1
0
        public int SaveLogForUserExcel(LogForUserExcelPOCO pOCO)
        {
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["TCCCMSDBConnectionString"].ConnectionString);

            con.Open();
            SqlCommand cmd = new SqlCommand("SaveLogForUserExcel", con);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@LogData", pOCO.LogData.ToString());

            if (pOCO.Id > 0)
            {
                cmd.Parameters.AddWithValue("@Id ", pOCO.Id);
            }
            else
            {
                cmd.Parameters.AddWithValue("@Id ", DBNull.Value);
            }

            int recordsAffected = cmd.ExecuteNonQuery();

            con.Close();

            return(recordsAffected);
        }
コード例 #2
0
        private LogForUserExcelPOCO ConvertDataTableToLogForUserExcelList(DataSet ds)
        {
            LogForUserExcelPOCO pPOCOPC = new LogForUserExcelPOCO();

            //check if there is at all any data
            if (ds.Tables.Count > 0)
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    //if (item["Id"] != null)
                    //    pPOCOPC.Id = Convert.ToInt32(item["Id"].ToString());

                    if (item["LogData"] != System.DBNull.Value)
                    {
                        pPOCOPC.LogData = item["LogData"].ToString();
                    }

                    if (item["Count"] != System.DBNull.Value)
                    {
                        pPOCOPC.Count = item["Count"].ToString();
                    }
                    if (item["SuccessCount"] != System.DBNull.Value)
                    {
                        pPOCOPC.SuccessCount = item["SuccessCount"].ToString();
                    }

                    //pcList.Add(pPOCOPC);
                }
            }
            return(pPOCOPC);
        }
コード例 #3
0
        public JsonResult SaveUpdateRank(LogForUserExcelPOCO pOCO)
        {
            LogForUserExcelBL   bL = new LogForUserExcelBL();
            LogForUserExcelPOCO pC = new LogForUserExcelPOCO();

            pC.Id      = pOCO.Id;
            pC.LogData = pOCO.LogData;

            return(Json(bL.SaveUpdateRank(pC), JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
        public JsonResult GetLogForUserExcel()
        {
            LogForUserExcelBL   bL  = new LogForUserExcelBL();
            LogForUserExcelPOCO log = new LogForUserExcelPOCO();

            log = bL.GetLogForUserExcel();

            var data = log;

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
コード例 #5
0
        public LogForUserExcelPOCO GetLogForUserExcel(/*int Id*/)
        {
            LogForUserExcelPOCO prodPOList = new LogForUserExcelPOCO();
            LogForUserExcelPOCO prodPO     = new LogForUserExcelPOCO();
            DataSet             ds         = new DataSet();

            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["TCCCMSDBConnectionString"].ConnectionString))
            {
                using (SqlCommand cmd = new SqlCommand("GetLogForUserExcel", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    //cmd.Parameters.AddWithValue("@Id", Id);
                    con.Open();

                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                    con.Close();
                }
            }
            return(ConvertDataTableToLogForUserExcelList(ds));
        }
コード例 #6
0
        public int SaveUpdateRank(LogForUserExcelPOCO pOCO)
        {
            LogForUserExcelDAL dAL = new LogForUserExcelDAL();

            return(dAL.SaveLogForUserExcel(pOCO));
        }