Ejemplo n.º 1
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(Ini_SystemLodad Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.Displaytype = Convert.ToInt32(Ini.IniReadValue("systemload", "Displaytype"));
             Item.Tranimage = Convert.ToInt32(Ini.IniReadValue("systemload", "Tranimage"));
             Item.Trantime = Convert.ToInt32(Ini.IniReadValue("systemload", "Trantime"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(C_Infrared Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.Enable = Convert.ToBoolean(Ini.IniReadValue("Infrared", "Enable"));
             Item.Infrared1 = Convert.ToInt32(Ini.IniReadValue("Infrared", "Infrared1"));
             Item.Infrared2 = Convert.ToInt32(Ini.IniReadValue("Infrared", "Infrared2"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(C_DataFormat Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.MoneyMode = Convert.ToInt32(Ini.IniReadValue("DataFormat", "MoneyMode"));
             Item.EndNetMode = Convert.ToInt32(Ini.IniReadValue("DataFormat", "EndNetMode"));
             Item.CodeRule = Convert.ToInt32(Ini.IniReadValue("DataFormat", "CodeRule"));
             Item.CodeWay = Convert.ToInt32(Ini.IniReadValue("DataFormat", "CodeWay"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(C_RoadSluice Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.Enable = Convert.ToBoolean(Ini.IniReadValue("RoadSluice", "Enable"));
             Item.RoadSluice1 = Convert.ToInt32(Ini.IniReadValue("RoadSluice", "RoadSluice1"));
             Item.RoadSluice2 = Convert.ToInt32(Ini.IniReadValue("RoadSluice", "RoadSluice2"));
             Item.WorkMode1 = Convert.ToInt32(Ini.IniReadValue("RoadSluice", "WorkMode1"));
             Item.WorkMode2 = Convert.ToInt32(Ini.IniReadValue("RoadSluice", "WorkMode2"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(C_IdCard Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.Enable =Convert.ToBoolean(Ini.IniReadValue("IdCard", "Enable"));
             Item.Serial = Convert.ToInt32(Ini.IniReadValue("IdCard", "Serial"));
             Item.BaudRate = Convert.ToInt32(Ini.IniReadValue("IdCard", "BaudRate"));
             Item.WeightType = Convert.ToInt32(Ini.IniReadValue("IdCard", "WeightType"));
             Item.CardType =Ini.IniReadValue("IdCard", "CardType");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 显示信息
 /// </summary>
 /// <returns>返回数据源</returns>
 public static void DataShow(C_Meter Item)
 {
     try
     {
         PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
         if (Ini.ExistIniFile())
         {
             Item.Serial =Convert.ToInt32(Ini.IniReadValue("Meter", "Serial"));
             Item.MeterType = Ini.IniReadValue("Meter", "MeterType");
             Item.BaudRate =Convert.ToInt32(Ini.IniReadValue("Meter", "BaudRate"));
             Item.Unit = Ini.IniReadValue("Meter", "Unit");
             Item.DetectStart =Convert.ToSingle(Ini.IniReadValue("Meter", "DetectStart"));
             Item.FullBalance =Convert.ToInt32(Ini.IniReadValue("Meter", "FullBalance"));
             Item.Digit =Convert.ToInt32(Ini.IniReadValue("Meter","Digit"));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="Item">model</param>
        /// <returns></returns>
        public static bool UserLogin(D_User Item)
        {
            DataBase db = new DataBase();
            DataBaseVisitor visitor = new UsersDAL();
            bool Flag = false;
            SqlParameter[] prams ={
                db.MakeInParam("@Uid",SqlDbType.VarChar,50,Item.Uid),
                db.MakeInParam("@Pwd",SqlDbType.VarChar,50,Item.Pwd)
            };
            try
            {
                DataSet ds = new DataSet();
                ds = db.ReturnDataSet(visitor,prams,"UserLogin");
                DataRowCollection drc = ds.Tables[0].Rows;
                if (drc.Count > 0)
                {
                    DataRow dr = drc[0];
                    LUser.Id = Convert.ToInt64(dr["Id"]);
                    LUser.Code = dr["Code"].ToString();
                    LUser.Uid = dr["Uid"].ToString();
                    LUser.Name = dr["Name"].ToString();
                    LUser.Role = dr["Role"].ToString();
                    PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config);
                    if (Ini.ExistIniFile())
                    {
                        LUser.TableNum = Ini.IniReadValue("LoadoMeter", "TableNum");
                    }
                    ds = WSV.BLL.SysInfo.LoadoMeterBLL.SelectAll(" where TableNum='" + LUser.TableNum + "'");
                    drc = ds.Tables[0].Rows;
                    if (drc.Count > 0)
                    {
                        dr = drc[0];
                        LUser.TableName = dr["Name"].ToString();
                        LUser.Ip = dr["Ip"].ToString();
                        LUser.Port = dr["Port"].ToString();
                    }
                    else
                    {
                        LUser.TableNum = "";
                    }
                    Flag = true;
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                db.Dispose();
            }
            return Flag;
        }