Esempio n. 1
0
 /// <summary>
 /// 修改电表异步查询余额、电量
 /// </summary>
 /// <param name="ammeter"></param>
 /// <returns></returns>
 public static int UpdateAmmeter(Am_Ammeter ammeter)
 {
     using (var conn = GetOpenConnection())
     {
         var sql = "update Am_Ammeter set CurrMoney=@CurrMoney,CM_Time=@CM_Time,CurrPower=@CurrPower,CP_Time=@CP_Time  where Number=@Number ";
         return(conn.Execute(sql, ammeter));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 抄表
        /// </summary>
        /// <param name="ammeter"></param>
        /// <param name="type"></param>
        private void Reading(Am_Ammeter ammeter, int type)
        {
            var result = ReadAmmeter(ammeter.Collector_Code, ammeter.AM_Code, type.ToString());

            if (result.suc)
            {
                var task = new Am_BackstageTask
                {
                    Number          = result.opr_id,
                    AmmeterCode     = ammeter.AM_Code,
                    AmmeterNumber   = ammeter.Number,
                    CollectorCode   = ammeter.Collector_Code,
                    CollectorNumber = ammeter.Collector_Number,
                    CreateTime      = DateTime.Now,
                    OperateType     = 0,
                    OperateTypeStr  = "",
                    OrderNumber     = "",
                    OverTime        = DateTime.Now,
                    Remark          = "",
                    Status          = 0,
                    StatusStr       = "队列中",
                    TaskMark        = "",
                    UserName        = "******",
                    U_Name          = "System",
                    U_Number        = "System"
                };
                if (type == 20)
                {
                    task.OperateType    = 5;
                    task.OperateTypeStr = "剩余电量";
                    database.Insert <Am_BackstageTask>(task);
                }
                else if (type == 22)
                {
                    task.OperateType    = 6;
                    task.OperateTypeStr = "剩余金额";
                    database.Insert <Am_BackstageTask>(task);
                }
            }
        }