public object DeleteObject()
        {
            Ecm.WebReferences.MasterService.Rex_Dm_Phucap objRex_Dm_Phucap = new Ecm.WebReferences.MasterService.Rex_Dm_Phucap();
            objRex_Dm_Phucap.Id_Dm_Phucap = treelist_Phucap.FocusedNode.GetValue("Id_Dm_Phucap");

            return(objMasterService.Delete_Rex_Dm_Phucap(objRex_Dm_Phucap));
        }
        public object UpdateObject()
        {
            try
            {
                Ecm.WebReferences.MasterService.Rex_Dm_Phucap objRex_Dm_Phucap = new Ecm.WebReferences.MasterService.Rex_Dm_Phucap();
                objRex_Dm_Phucap.Id_Dm_Phucap = treelist_Phucap.FocusedNode.GetValue("Id_Dm_Phucap");
                objRex_Dm_Phucap.Ma_Phucap    = txtMa_Phucap.EditValue;
                objRex_Dm_Phucap.Ten_Phucap   = txtTen_Phucap.EditValue;
                if ("" + txtHeso.EditValue != "")
                {
                    objRex_Dm_Phucap.Heso_Phucap = txtHeso.EditValue;
                }
                if ("" + txtLuong_Phucap.EditValue != "")
                {
                    objRex_Dm_Phucap.Luong_Phucap = txtLuong_Phucap.EditValue;
                }
                objRex_Dm_Phucap.Chiuthue     = checkEdit_Phucap_Chiuthue.Checked;
                objRex_Dm_Phucap.Phucap_Chung = checkEdit_Phucap_Chung.Checked;
                if ("" + treelist_Phucap.FocusedNode.GetValue("Id_Parent") != "")
                {
                    objRex_Dm_Phucap.Id_Parent = treelist_Phucap.FocusedNode.GetValue("Id_Parent");
                }

                objRex_Dm_Phucap.Id_Chucvu = treelist_Phucap.FocusedNode.GetValue("Id_Chucvu") + "";

                objMasterService.Update_Rex_Dm_Phucap(objRex_Dm_Phucap);
                return(true);
            }
            catch (Exception ex)
            {
                if (ex.Message.IndexOf("Arithmetic overflow error converting nvarchar to data type numeric") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else if (ex.Message.IndexOf("Arithmetic overflow error converting numeric to data type numeric") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else if (ex.Message.IndexOf("Error converting data type numeric to numeric") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else
                {
                    GoobizFrame.Windows.Forms.MessageDialog.Show(ex.Message, ex.ToString(), "Exception");
                }
                return(false);
            }
        }
        public object InsertObject()
        {
            try
            {
                Ecm.WebReferences.MasterService.Rex_Dm_Phucap objRex_Dm_Phucap = new Ecm.WebReferences.MasterService.Rex_Dm_Phucap();

                objRex_Dm_Phucap.Ma_Phucap    = txtMa_Phucap.EditValue;
                objRex_Dm_Phucap.Ten_Phucap   = txtTen_Phucap.EditValue;
                objRex_Dm_Phucap.Heso_Phucap  = txtHeso.EditValue;
                objRex_Dm_Phucap.Luong_Phucap = txtLuong_Phucap.EditValue;
                objRex_Dm_Phucap.Chiuthue     = checkEdit_Phucap_Chiuthue.Checked;
                objRex_Dm_Phucap.Phucap_Chung = checkEdit_Phucap_Chung.Checked;

                objMasterService.Insert_Rex_Dm_Phucap(objRex_Dm_Phucap);
                return(true);
            }
            catch (Exception ex)
            {
                if (ex.Message.IndexOf("Arithmetic overflow error converting nvarchar to data type numeric") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else if (ex.Message.IndexOf("Input string was not in a correct format") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else if (ex.Message.IndexOf("Value was either too large or too small for a Decimal") != -1)
                {
                    GoobizFrame.Windows.Forms.UserMessage.Show("INVALID_NUMVALUE", new string[] { });
                }
                else
                {
                    GoobizFrame.Windows.Forms.MessageDialog.Show(ex.Message, ex.ToString(), "Exception");
                }

                return(false);
            }
        }
        public override object PerformSelectOneObject()
        {
            Ecm.WebReferences.MasterService.Rex_Dm_Phucap rex_Dm_Phucap = new Ecm.WebReferences.MasterService.Rex_Dm_Phucap();
            try
            {
                rex_Dm_Phucap.Id_Dm_Phucap = treelist_Phucap.FocusedNode.GetValue("Id_Dm_Phucap");
                rex_Dm_Phucap.Ma_Phucap    = treelist_Phucap.FocusedNode.GetValue("Ma_Phucap");
                rex_Dm_Phucap.Ten_Phucap   = treelist_Phucap.FocusedNode.GetValue("Ten_Phucap");
                rex_Dm_Phucap.Heso_Phucap  = treelist_Phucap.FocusedNode.GetValue("Heso_Phucap");
                rex_Dm_Phucap.Luong_Phucap = treelist_Phucap.FocusedNode.GetValue("Luong_Phucap");

                Selected_Rex_Dm_Phucap = rex_Dm_Phucap;
                this.Dispose();
                this.Close();
                return(rex_Dm_Phucap);
            }
            catch (Exception ex)
            {
#if DEBUG
                MessageBox.Show(ex.Message);
#endif
                return(null);
            }
        }