コード例 #1
0
        public Abnorma GetPageAbt(string ClientID, string EquID, string ProDesc)
        {
            Abnorma abnorma = new Abnorma
            {
                EquID    = 0,
                ClientID = 0
            };

            abnorma.ClientID   = Convert.ToInt32(ClientID);
            abnorma.EquID      = Convert.ToInt32(EquID);
            abnorma.ProDesc    = ProDesc;
            abnorma.Livephotos = 0;
            abnorma.MainteDesc = "";
            abnorma.Remark     = "机器自报异常";
            abnorma.Serious    = "否";
            abnorma.Solve      = "未解决";
            abnorma.UpdateTime = new DateTime?(DBHelper.GetDate());
            abnorma.AbSta      = "未关闭";
            return(abnorma);
        }
コード例 #2
0
ファイル: DBHelper.cs プロジェクト: kylin0702/SyncService
        public static bool AddAbnorma(Abnorma model)
        {
            StringBuilder builder1 = new StringBuilder();

            builder1.Append("insert into Abnorma(");
            builder1.Append("ClientID,EquID,ProDesc,Livephotos,MainteDesc,Livephotos2,Remark,Serious,Solve,AbSta,UpdateTime");
            builder1.Append(")");
            builder1.Append(" values (");
            builder1.Append(model.ClientID + ",");
            builder1.Append(model.EquID + ",");
            builder1.Append("'" + model.ProDesc + "',");
            builder1.Append(model.Livephotos + ",");
            builder1.Append("'" + model.MainteDesc + "',");
            builder1.Append("'" + model.Livephotos2 + "',");
            builder1.Append("'" + model.Remark + "',");
            builder1.Append("'" + model.Serious + "',");
            builder1.Append("'" + model.Solve + "',");
            builder1.Append("'" + model.AbSta + "',");
            builder1.Append("'" + model.UpdateTime + "'");
            builder1.Append(")");
            builder1.Append(";select @@IDENTITY");
            return(ExecuteNonQuery(builder1.ToString()) >= 1);
        }
コード例 #3
0
        public Abnorma GetPageAbts(string sNUs, string num)
        {
            Abnorma abnorma = new Abnorma
            {
                EquID    = 0,
                ClientID = 0
            };
            DataSet clientAnID = DBHelper.GetClientAnID(sNUs);

            if (clientAnID.Tables[0].Rows.Count >= 1)
            {
                abnorma.EquID    = Convert.ToInt32(clientAnID.Tables[0].Rows[0]["ID"].ToString());
                abnorma.ClientID = Convert.ToInt32(clientAnID.Tables[0].Rows[0]["ClientID"].ToString());
            }
            abnorma.ProDesc    = "";
            abnorma.Livephotos = 0;
            abnorma.MainteDesc = "";
            abnorma.Remark     = "光源剩余时长大于服务器时长(数值:" + num + ")";
            abnorma.Serious    = "否";
            abnorma.Solve      = "未解决";
            abnorma.UpdateTime = new DateTime?(DBHelper.GetDate());
            abnorma.AbSta      = "未关闭";
            return(abnorma);
        }