示例#1
0
文件: IdCard.cs 项目: wuyanqing/wc001
 //保存
 private void Btn_Save_Click(object sender, EventArgs e)
 {
     C_IdCard CardItem = new C_IdCard();
     CardItem.CardType = this.Cmb_CardType.SelectedValue.ToString();
     CardItem.Enable = this.Cb_Enable.Checked;
     CardItem.Serial = Convert.ToInt32(this.Cmb_Serial.SelectedValue);
     CardItem.BaudRate = Convert.ToInt32(this.Cmb_BaudRate.SelectedValue);
     CardItem.WeightType = Convert.ToInt32(this.Cmb_WeightType.SelectedValue);
     if (IdCardBLL.Update(CardItem))
     {
         Function.Message("修改成功!");
     }
 }
示例#2
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;
     }
 }
示例#3
0
 /// <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;
 }
示例#4
0
文件: IdCard.cs 项目: wuyanqing/wc001
 //窗体加载
 private void Card_Load(object sender, EventArgs e)
 {
     My_RunCode = BLL.MyLog.DL_Run.Insert(this.Text);
     C_IdCard CardItem = new C_IdCard();
     IdCardBLL.DataShow(CardItem);
     this.Cmb_CardType.SelectedByValue(CardItem.CardType);
     this.Cb_Enable.Checked = CardItem.Enable;
     this.Cmb_Serial.SelectedByValue(CardItem.Serial);
     this.Cmb_BaudRate.SelectedByValue(CardItem.BaudRate);
     this.Cmb_WeightType.SelectedByValue(CardItem.WeightType);
 }