Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (grvThongSo.RowCount > 0)
            {
                grvThongSo.FocusedRowHandle = -1;
                for (int i = 0; i < grvThongSo.RowCount; i++)
                {
                    int id = TextUtils.ToInt(grvThongSo.GetRowCellValue(i, colID));
                    MaterialParamValueNSModel model = new MaterialParamValueNSModel();

                    if (id > 0)
                    {
                        model = (MaterialParamValueNSModel)MaterialParamValueNSBO.Instance.FindByPK(id);
                    }

                    model.Description       = TextUtils.ToString(grvThongSo.GetRowCellValue(i, colDes));
                    model.ValueTS           = TextUtils.ToString(grvThongSo.GetRowCellValue(i, colValue));
                    model.MaterialParamNSID = MaterialParamNSID;

                    if (model.ValueTS == "")
                    {
                        continue;
                    }

                    if (id > 0)
                    {
                        MaterialParamValueNSBO.Instance.Update(model);
                    }
                    else
                    {
                        MaterialParamValueNSBO.Instance.Insert(model);
                    }
                }

                MessageBox.Show("Lưu trữ thành công!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                loadGrid();
            }
        }
 protected MaterialParamValueNSFacade(MaterialParamValueNSModel model) : base(model)
 {
 }