Ejemplo n.º 1
0
        //批量保存目标配合比的方法
        private void SaveAll()
        {
            try
            {
                int id;

                List <TargetProportionDetailClass> list = GetTPDetail();

                TargetProportionClass TPClass = SetPara();

                id = Convert.ToInt32(qualityLogic.SaveTargetProportionAdd(TPClass, list).ToString());

                if (id != 0)
                {
                    txtPId.Text = id.ToString();
                    // this.DialogResult = DialogResult.OK;
                    MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //this.Close();
                }
                else
                {
                    MessageBox.Show("保存失败,请重新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
        /*
         * 方法名称:SaveTargetProportionAdd
         * 方法功能描述:同时将目标配合比主表和明细表保存到数据库中的方法 插入到两个表中
         *
         * 创建人:夏阳明
         * 创建时间:20090304
         *
         * 修改人:
         * 修改时间:
         * 修改内容:
         *
         */

        public int SaveTargetProportionAdd(TargetProportionClass TPClass, List <TargetProportionDetailClass> list)
        {
            int id;

            ArrayList sqllist = new ArrayList();

            sqllist.Add(qualityDb.GetInsertSqlps(TPClass));

            foreach (TargetProportionDetailClass TPDClass in list)
            {
                sqllist.Add(qualityDb.GetInsertSqlpsd(TPDClass));
            }
            ds = sqlHelperObj.QueryForDateSet(sqllist);

            id = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());

            return(id);
        }
Ejemplo n.º 3
0
        private TargetProportionClass SetPara()
        {
            #region
            TargetProportionClass TPClass = new TargetProportionClass();
            try
            {
                TPClass.PmId = qualityLogic.FrmMixtureRatioAddSearchPId(Convert.ToInt32(cbxPName.SelectedValue.ToString()),
                                                                        Convert.ToInt32(cbxPModel.SelectedValue.ToString()));
                TPClass.Producer  = cbxProducer.Text;
                TPClass.Remark    = txtRemark.Text;
                TPClass.InputDate = DateTime.Now;
                TPClass.InputMan  = this.userName;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }
            return(TPClass);

            #endregion
        }
Ejemplo n.º 4
0
        /*
         * 方法名称:FrmMixtureRatioAddNewTargetProportion
         * 方法功能描述:保存目标配合比概要信息记录
         *
         * 创建人:夏阳明
         * 创建时间:20090303
         *
         * 修改人:
         * 修改时间:
         * 修改内容:
         *
         */
        public bool FrmMixtureRatioAddNewTargetProportion(TargetProportionClass TPClass, int id, string userName)
        {
            status = qualityDb.FrmMixtureRatioAddNewTargetProportion(TPClass, id, userName);

            return(status);
        }