/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(C_Infrared Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("Infrared", "Enable", Item.Enable); Ini.IniWriteValue("Infrared", "Infrared1", Item.Infrared1); Ini.IniWriteValue("Infrared", "Infrared2", Item.Infrared2); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(Ini_SystemLodad Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("systemload", "Displaytype", Item.Displaytype); Ini.IniWriteValue("systemload", "Tranimage", Item.Tranimage); Ini.IniWriteValue("systemload", "Trantime", Item.Trantime); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <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; } }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(C_DataFormat Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("DataFormat", "MoneyMode", Item.MoneyMode); Ini.IniWriteValue("DataFormat", "EndNetMode", Item.EndNetMode); Ini.IniWriteValue("DataFormat", "CodeRule", Item.CodeRule); Ini.IniWriteValue("DataFormat", "CodeWay", Item.CodeWay); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(C_RoadSluice Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("RoadSluice", "Enable", Item.Enable); Ini.IniWriteValue("RoadSluice", "RoadSluice1", Item.RoadSluice1); Ini.IniWriteValue("RoadSluice", "RoadSluice2", Item.RoadSluice2); Ini.IniWriteValue("RoadSluice", "WorkMode1", Item.WorkMode1); Ini.IniWriteValue("RoadSluice", "WorkMode2", Item.WorkMode2); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(C_IdCard Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("IdCard", "Enable", Item.Enable); Ini.IniWriteValue("IdCard", "Serial", Item.Serial); Ini.IniWriteValue("IdCard", "BaudRate", Item.BaudRate); Ini.IniWriteValue("IdCard", "WeightType", Item.WeightType); Ini.IniWriteValue("IdCard", "CardType", Item.CardType); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <summary> /// 修改数据 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool Update(C_Meter Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("Meter", "Serial", Item.Serial); Ini.IniWriteValue("Meter", "MeterType", Item.MeterType); Ini.IniWriteValue("Meter", "BaudRate", Item.BaudRate); Ini.IniWriteValue("Meter", "Unit", Item.Unit); Ini.IniWriteValue("Meter", "DetectStart", Item.DetectStart); Ini.IniWriteValue("Meter", "FullBalance", Item.FullBalance); Ini.IniWriteValue("Meter", "Digit", Item.Digit); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }
/// <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; }
/// <summary> /// 设为本机 /// </summary> /// <param name="Item">model</param> /// <returns></returns> public static bool SetLocal(DC_LoadoMeter Item) { bool Flag = false; try { PublicFun.IniFile Ini = new PublicFun.IniFile(WSV.Model.FilePath.Config); if (Ini.ExistIniFile()) { Ini.IniWriteValue("LoadoMeter", "TableNum", Item.TableNum); } Flag = true; } catch (Exception ex) { throw ex; } return Flag; }