Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            FrmCodingAdd frmCodingAdd = new FrmCodingAdd();

            frmCodingAdd.ShowDialog();

            CBBarCode.Text = frmCodingAdd.CodingNo;

            if (recordId != -1)
            {
                switch (style)
                {
                case WeighingStyle.InStyle:
                    InWeighingClass   info1    = new InWeighingClass();
                    InWeighingDBLayer dbLayer1 = new InWeighingDBLayer();

                    info1.Id      = recordId.ToString();
                    info1.BarCode = frmCodingAdd.CodingNo;
                    if (dbLayer1.UpdateInfo(info1))
                    {
                        ClearValue();
                        CBTruckNo.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("条码保存有问题!");
                    }
                    break;

                case WeighingStyle.OutStyle:
                    OutWeighingClass   info2    = new OutWeighingClass();
                    OutWeighingDBLayer dbLayer2 = new OutWeighingDBLayer();

                    info2.Id      = recordId.ToString();
                    info2.BarCode = frmCodingAdd.CodingNo;
                    if (dbLayer2.UpdateInfo(info2))
                    {
                        ClearValue();
                        CBTruckNo.SelectedIndex = -1;
                    }
                    else
                    {
                        MessageBox.Show("条码保存有问题!");
                    }
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #2
0
        public bool UpdateIninfo(InWeighingClass info)
        {
            InWeighingDBLayer dbLayer = new InWeighingDBLayer();
            DataTable         dt      = new DataTable();

            if (dbLayer.UpdateInfo(info))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        /*
         * 方法名称:SaveInInfo
         * 方法功能描述:保存入厂称重信息
         * 参数:  info 信息内容光
         * 返回:
         * 创建人:袁宇
         * 创建时间:2009-03-06
         *
         * 修改人:
         * 修改时间:
         * 修改内容:
         *
         */
        public bool SaveInInfo(InWeighingClass info, out long recId)
        {
            InWeighingDBLayer dbLayer = new InWeighingDBLayer();
            DataTable         dt      = new DataTable();

            dt = dbLayer.SelectinWeighInfo(info.ViId);
            if ((!dt.Equals(null)) && (dt.Rows.Count > 0))
            {
                //更新
                info.Id = dt.Rows[0]["id"].ToString();
                if (dbLayer.UpdateInfo(info))
                {
                    recId = Convert.ToInt64(info.Id);
                    return(true);
                }
                else
                {
                    recId = -1;
                    return(false);
                }
            }
            else
            {
                //新增
                if (dbLayer.InsertInfo(info))
                {
                    recId = dbLayer.GetMaxInRecId();
                    return(true);
                }
                else
                {
                    recId = -1;
                    return(false);
                }
            }
        }
Beispiel #4
0
        public bool checkupInInfo(InWeighingClass info)
        {
            InWeighingDBLayer dbLayer = new InWeighingDBLayer();

            return(dbLayer.UpdateInfo(info));
        }