Exemplo n.º 1
0
        public static CloudHealthDto GetOneCloudHealthDto(string table,string strwhere)
        {
            CloudHealthDto cloudHealthDto=new CloudHealthDto();

            cloudHealthDto = CloudHealthDal.GetOneCloudHealth(table, strwhere);

            return cloudHealthDto;
        }
Exemplo n.º 2
0
        public static void AddCloudHealth(CloudHealthDto cloudHealthDto)
        {
            SqlParameter[] arParames = CloudHealthDal.getParameters(cloudHealthDto);
            SqlConnection myconn = new SqlConnection(CommonDal.ConnectionString);
            try
            {
                SqlHelper.ExecuteNonQuery(myconn, CommandType.StoredProcedure, "CreateCloudHealth", arParames);
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {

                myconn.Close();
                myconn.Dispose();
            }
        }
Exemplo n.º 3
0
        public static List<CloudHealthDto> GetCloudHealthList(string table,string strwhere)
        {
            List<CloudHealthDto> cloudHealthlist = new List<CloudHealthDto>();

            SqlParameter[] arParames = new SqlParameter[2];
            arParames[0] = new SqlParameter("@table ", SqlDbType.VarChar, 200);
            arParames[0].Value = table;

            arParames[1] = new SqlParameter("@Where ", SqlDbType.VarChar, 8000);
            arParames[1].Value = strwhere;
             SqlConnection myconn = new SqlConnection(CommonDal.ConnectionString);
            try
            {
            DataTable dt = null;
            DataSet ds = SqlHelper.ExecuteDataset(myconn, CommandType.StoredProcedure, "getModelByWhere", arParames);
            dt = ds.Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                CloudHealthDto cloudHealthDto = new CloudHealthDto();

                cloudHealthDto = CloudHealthDal.getDataRowToCloudHealthDto(dr);

                cloudHealthlist.Add(cloudHealthDto);

            }

            return cloudHealthlist;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {

                myconn.Close();
                myconn.Dispose();
            }
        }
Exemplo n.º 4
0
        //
        // GET: /Cloud/
        public ActionResult Index(string imei, string tel, string user, string sys, string dia, string pul)
        {
            if (string.IsNullOrEmpty(imei) || string.IsNullOrEmpty(tel) || string.IsNullOrEmpty(user) || string.IsNullOrEmpty(sys) || string.IsNullOrEmpty(dia) || string.IsNullOrEmpty(pul))
            {
                return Content("OK" + System.DateTime.Now.ToString("yyyyMMddhhmmss"));
            }
            else
            {
            CloudHealthDto cloudHealthDto = new CloudHealthDto();
            cloudHealthDto.CloudTel = tel;
            cloudHealthDto.CloudDiya = dia;
            cloudHealthDto.CloudGaoya = sys;
            cloudHealthDto.CloudMaibo = pul;
            cloudHealthDto.CloudUser = user;
            cloudHealthDto.CloudImei = imei;
            cloudHealthDto.CloudTime = System.DateTime.Now;

            CloudHealthBll.AddCloudHealth(cloudHealthDto);
            Xueya.sendMsg("赵征", sys, dia, pul);
            }

            return Content("OK"+System.DateTime.Now.ToString("yyyyMMddhhmmss"));
        }
Exemplo n.º 5
0
 public static void UpdateCloudHealthDto(CloudHealthDto cloudHealthDto)
 {
     CloudHealthDal.UpdateCloudHealth(cloudHealthDto);
 }
Exemplo n.º 6
0
    public static void AddCloudHealth(CloudHealthDto cloudHealthDto)
    {
        CloudHealthDal.AddCloudHealth(cloudHealthDto);
 
    }
Exemplo n.º 7
0
        private static SqlParameter[] getParameters(CloudHealthDto cloudHealthDto)
        {
            SqlParameter[] arParames = new SqlParameter[8];

            arParames[0] = new SqlParameter("@CloudId", SqlDbType.Int);
            arParames[0].Value = cloudHealthDto.CloudId;

            arParames[1] = new SqlParameter("@CloudDiya", SqlDbType.VarChar, 50);
            arParames[1].Value = cloudHealthDto.CloudDiya;

            arParames[2] = new SqlParameter("@CloudGaoya", SqlDbType.VarChar, 50);
            arParames[2].Value = cloudHealthDto.CloudGaoya;

            arParames[3] = new SqlParameter("@CloudMaibo", SqlDbType.VarChar, 50);
            arParames[3].Value = cloudHealthDto.CloudMaibo;

            arParames[4] = new SqlParameter("@CloudTel", SqlDbType.VarChar, 50);
            arParames[4].Value = cloudHealthDto.CloudTel;

            arParames[5] = new SqlParameter("@CloudImei", SqlDbType.VarChar, 50);
            arParames[5].Value = cloudHealthDto.CloudImei;

            arParames[6] = new SqlParameter("@CloudUser", SqlDbType.VarChar, 50);
            arParames[6].Value = cloudHealthDto.CloudUser;

            arParames[7] = new SqlParameter("@CloudTime", SqlDbType.DateTime);
            arParames[7].Value = cloudHealthDto.CloudTime;

            return arParames;
        }
Exemplo n.º 8
0
        private static CloudHealthDto getDataRowToCloudHealthDto(DataRow dr)
        {
            CloudHealthDto cloudHealthDto = new CloudHealthDto();

            cloudHealthDto.CloudId = int.Parse(dr["CloudHealthId"].ToString());
            cloudHealthDto.CloudTel = dr["CloudHealthUserName"].ToString();
            cloudHealthDto.CloudDiya = dr["CloudHealthRealName"].ToString();
            cloudHealthDto.CloudGaoya = dr["CloudHealthPassword"].ToString();
            cloudHealthDto.CloudMaibo = dr["CloudHealthPassword"].ToString();
            cloudHealthDto.CloudImei = dr["CloudHealthPassword"].ToString();
            cloudHealthDto.CloudUser = dr["CloudHealthPassword"].ToString();
            cloudHealthDto.CloudTime = DateTime.Parse(dr["CloudHealthRegTime"].ToString());

            return cloudHealthDto;
        }