Ejemplo n.º 1
0
        //获得目标配合比多条明细表的信息
        private List <ProportionDetailClass> GetTPDetail()
        {
            ProportionDetailClass PDClass = null;

            List <ProportionDetailClass> list = new List <ProportionDetailClass>();

            try
            {
                foreach (DataGridViewRow dgvr in dgvDetail.Rows)
                {
                    PDClass = new ProportionDetailClass();

                    PDClass.MId             = int.Parse(dgvr.Cells["mId"].Value.ToString().Trim());
                    PDClass.ProportionValue = Convert.ToDouble(dgvr.Cells["proportionValue"].Value.ToString());
                    PDClass.Producer        = dgvr.Cells["producer"].Value.ToString();
                    PDClass.InputDate       = Convert.ToDateTime(dgvr.Cells["inputDate"].Value.ToString());
                    PDClass.InputMan        = dgvr.Cells["inputMan"].Value.ToString();
                    PDClass.Address         = dgvr.Cells["address"].Value.ToString();
                    PDClass.Name            = dgvr.Cells["name1"].Value.ToString();
                    //PDClass.PpId = int.Parse(cbxMaker.SelectedValue.ToString());
                    PDClass.PpId = int.Parse(dgvr.Cells["Ppid"].Value.ToString());

                    list.Add(PDClass);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }
            return(list);
        }
Ejemplo n.º 2
0
        /*
         * 方法名称:FrmGYMRatioAddNew
         * 方法功能描述:给新建配合比明细表的datagridview添加行
         *
         * 创建人:夏阳明
         * 创建时间:20090306
         *
         * 修改人:
         * 修改时间:
         * 修改内容:
         *
         */

        public void FrmGYMRatioAddNew(ProportionDetailClass PDClass, DataTable dt, string Kinds,
                                      string Name, string Model)
        {
            DataRow dr = dt.NewRow();

            dr["id"]              = PDClass.Id;
            dr["sort"]            = Kinds;
            dr["name"]            = Name;
            dr["model"]           = Model;
            dr["proportionValue"] = PDClass.ProportionValue;
            dr["address"]         = PDClass.Address;
            dr["name1"]           = PDClass.Name;
            dr["inputDate"]       = PDClass.InputDate;
            dr["inputMan"]        = PDClass.InputMan;
            dr["producer"]        = PDClass.Producer;
            dr["mId"]             = PDClass.MId;
            dr["Ppid"]            = PDClass.PpId;

            dt.Rows.Add(dr);
        }