Пример #1
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;
     }
 }
Пример #2
0
 /// <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;
 }
Пример #3
0
 //保存
 private void Btn_Save_Click(object sender, EventArgs e)
 {
     if (this.Tc_SysPram.SelectedIndex == 0)
     {
         C_DataFormat DataFormatItem = new C_DataFormat();
         DataFormatItem.MoneyMode = Convert.ToInt32(this.Cmb_MoneyMode.SelectedValue);
         DataFormatItem.EndNetMode = Convert.ToInt32(this.Cmb_EndNetMode.SelectedValue);
         DataFormatItem.CodeRule = Convert.ToInt32(this.Cmb_CodeRule.SelectedValue);
         DataFormatItem.CodeWay = Convert.ToInt32(this.Cmb_CodeWay.SelectedValue);
         if (DataFormatBLL.Update(DataFormatItem))
         {
             Function.Message("修改成功!");
         }
     }
     else
     {
         C_NumDigit NumDigitItem = new C_NumDigit();
         NumDigitItem.GrossDigit = Convert.ToInt32(this.Cmb_GrossDigit.SelectedValue);
         NumDigitItem.GrossRound = Convert.ToInt32(this.Cmb_GrossRound.SelectedValue);
         NumDigitItem.TareDigit = Convert.ToInt32(this.Cmb_TareDigit.SelectedValue);
         NumDigitItem.TareRound = Convert.ToInt32(this.Cmb_TareRound.SelectedValue);
         NumDigitItem.NetDigit = Convert.ToInt32(this.Cmb_NetDigit.SelectedValue);
         NumDigitItem.NetRound = Convert.ToInt32(this.Cmb_NetRound.SelectedValue);
         NumDigitItem.DeductWeightDigit = Convert.ToInt32(this.Cmb_DeductWeightDigit.SelectedValue);
         NumDigitItem.DeductWeightRound = Convert.ToInt32(this.Cmb_DeductWeightRound.SelectedValue);
         NumDigitItem.DeductRateDigit = Convert.ToInt32(this.Cmb_DeductRateDigit.SelectedValue);
         NumDigitItem.DeductRateRound = Convert.ToInt32(this.Cmb_DeductRateRound.SelectedValue);
         NumDigitItem.EndNetDigit = Convert.ToInt32(this.Cmb_EndNetDigit.SelectedValue);
         NumDigitItem.EndNetRound = Convert.ToInt32(this.Cmb_EndNetRound.SelectedValue);
         NumDigitItem.PriceDigit = Convert.ToInt32(this.Cmb_PriceDigit.SelectedValue);
         NumDigitItem.PriceRound = Convert.ToInt32(this.Cmb_PriceRound.SelectedValue);
         NumDigitItem.MoneyDigit = Convert.ToInt32(this.Cmb_MoneyDigit.SelectedValue);
         NumDigitItem.MoneyRound = Convert.ToInt32(this.Cmb_MoneyRound.SelectedValue);
         NumDigitItem.CubeDigit = Convert.ToInt32(this.Cmb_CubeDigit.SelectedValue);
         NumDigitItem.CubeRound = Convert.ToInt32(this.Cmb_CubeRound.SelectedValue);
         if (NumDigitBLL.Update(NumDigitItem))
         {
             Function.Message("修改成功!");
         }
     }
 }
Пример #4
0
        //窗口加载
        private void SysParam_Load(object sender, EventArgs e)
        {
            My_RunCode = BLL.MyLog.DL_Run.Insert(this.Text);
            C_NumDigit NumDigitItem = new C_NumDigit();
            NumDigitBLL.DataShow(NumDigitItem);
            this.Cmb_GrossDigit.SelectedByValue(NumDigitItem.GrossDigit);
            this.Cmb_GrossRound.SelectedByValue(NumDigitItem.GrossRound);
            this.Cmb_TareDigit.SelectedByValue(NumDigitItem.TareDigit);
            this.Cmb_TareRound.SelectedByValue(NumDigitItem.TareRound);
            this.Cmb_NetDigit.SelectedByValue(NumDigitItem.NetDigit);
            this.Cmb_NetRound.SelectedByValue(NumDigitItem.NetRound);
            this.Cmb_DeductWeightDigit.SelectedByValue(NumDigitItem.DeductWeightDigit);
            this.Cmb_DeductWeightRound.SelectedByValue(NumDigitItem.DeductWeightRound);
            this.Cmb_DeductRateDigit.SelectedByValue(NumDigitItem.DeductRateDigit);
            this.Cmb_DeductRateRound.SelectedByValue(NumDigitItem.DeductRateRound);
            this.Cmb_EndNetDigit.SelectedByValue(NumDigitItem.EndNetDigit);
            this.Cmb_EndNetRound.SelectedByValue(NumDigitItem.EndNetRound);
            this.Cmb_PriceDigit.SelectedByValue(NumDigitItem.PriceDigit);
            this.Cmb_PriceRound.SelectedByValue(NumDigitItem.PriceRound);
            this.Cmb_MoneyDigit.SelectedByValue(NumDigitItem.MoneyDigit);
            this.Cmb_MoneyRound.SelectedByValue(NumDigitItem.MoneyRound);
            this.Cmb_CubeDigit.SelectedByValue(NumDigitItem.CubeDigit);
            this.Cmb_CubeRound.SelectedByValue(NumDigitItem.CubeRound);

            C_DataFormat DataFormatItem = new C_DataFormat();
            DataFormatBLL.DataShow(DataFormatItem);
            this.Cmb_MoneyMode.SelectedByValue(DataFormatItem.MoneyMode);
            this.Cmb_EndNetMode.SelectedByValue(DataFormatItem.EndNetMode);
            this.Cmb_CodeRule.SelectedByValue(DataFormatItem.CodeRule);
            this.Cmb_CodeWay.SelectedByValue(DataFormatItem.CodeWay);
        }