Esempio n. 1
0
        private void BtnEditPro_Click(object sender, EventArgs e)
        {
            if (mDataGrid1.DataSource == null)
            {
                return;
            }

            Model.Tb_product_info productInfo = mDataGrid1.GetCurrentEntity() as Model.Tb_product_info;
            if (productInfo == null)
            {
                return;
            }

            if (mDataGrid2.DataSource == null)
            {
                return;
            }

            Model.Tb_product_property info = mDataGrid2.GetCurrentEntity() as Model.Tb_product_property;

            FmProductPropertyInfo fm = new FmProductPropertyInfo(info);

            fm.lblProductName.Text = productInfo.Product_Name;
            fm.Tag          = productInfo.Product_Id;
            fm.SelectValue += FmProperty_SelectValue;
            fm.ShowDialog();
        }
Esempio n. 2
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (!this.blNewFlag)
     {
         Model.Tb_product_info info = modelObj as Model.Tb_product_info;
         SetAccountInfo(info);
     }
 }
Esempio n. 3
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            if (mDataGrid1.DataSource == null)
            {
                return;
            }

            Model.Tb_product_info info = mDataGrid1.GetCurrentEntity() as Model.Tb_product_info;

            FmProductInfo fm = new FmProductInfo(info);

            fm.SelectValue += Fm_SelectValue;
            fm.ShowDialog();
        }
Esempio n. 4
0
        private void MDataGrid1_CurrentRowChanged(object sender, EventArgs e)
        {
            if (mDataGrid1.DataSource == null)
            {
                return;
            }

            Model.Tb_product_info info = mDataGrid1.GetCurrentEntity() as Model.Tb_product_info;
            if (info == null)
            {
                return;
            }
            List <Model.Tb_product_property> list = productPropertyManager.FindAll(info.Product_Id);

            mDataGrid2.SetDataSource <Model.Tb_product_property>(list);
        }
Esempio n. 5
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            if (mDataGrid1.DataSource == null)
            {
                return;
            }

            Model.Tb_product_info info = mDataGrid1.GetCurrentEntity() as Model.Tb_product_info;

            string msg = string.Format("确定删除:{0}信息?", info.Product_Name);

            if (Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg))
            {
                if (productManager.Remove(info))
                {
                    LoadAllProductData();
                }
            }
        }
Esempio n. 6
0
        protected override bool BtnOkClick()
        {
            Dictionary <Control, string> dicEmptyCtrs = this.GetValidEmptyCtrs();

            if (dicEmptyCtrs.Count > 0)
            {
                foreach (var ctr in dicEmptyCtrs.Keys)
                {
                    Miles.Framework.UI.Function.MForm.SetToolTip(ctr, dicEmptyCtrs[ctr], 1000);
                    return(false);
                }
            }

            Model.Tb_product_info info = this.GetDataBind <Model.Tb_product_info>();

            if (this.blNewFlag)
            {
                //info.Act_Id = Miles.Coro.Common.Utils.GuidToInt64();
                if (!manager.Add(info))
                {
                    return(false);
                }
            }
            else
            {
                Model.Tb_product_info old = modelObj as Model.Tb_product_info;
                info.Product_Id = old.Product_Id;

                if (!manager.Update(info, old))
                {
                    return(false);
                }
            }

            this.DoSelectValueEvent(info);

            return(true);
        }
Esempio n. 7
0
 private void SetAccountInfo(Model.Tb_product_info info)
 {
     this.SetDataBind(info);
 }
Esempio n. 8
0
 public FmProductInfo(Model.Tb_product_info info)
     : base(info)
 {
     InitializeComponent();
 }