Ejemplo n.º 1
0
        public override bool Validate()
        {
            base.mList_ValidationError.Clear();
            ClsItem Obj = (ClsItem)base.mBase;

            if (Do_Methods.Convert_String(Obj.pDr_RowProperty["Code"]) == "")
            {
                Obj.pDr_RowProperty["Code"] = Layer02_Common.GetSeriesNo("Item");
            }

            if (
                Layer02_Common.CheckSeriesDuplicate(
                    "uvw_Item"
                    , "Code"
                    , Obj.GetKeys()
                    , Do_Methods.Convert_String(Obj.pDr_RowProperty["Code"]))
                )
            {
                base.AddError(
                    eErrors.Err_Code.ToString()
                    , "Duplicate Item No. found. Please change the Item No.");;
            }

            if (Do_Methods.Convert_String(Obj.pDr_RowProperty["Name"]) != "")
            {
                base.AddError(
                    eErrors.Err_Name.ToString()
                    , "Item Name is required.");
            }

            return(base.mList_ValidationError.Count == 0);
        }
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!this.CheckIsLoaded())
            {
                this.EOCb_Browse.Execute += this.EOCb_Browse_Execute;
                this.EOCb_View.Execute += this.EOCb_View_Execute;
                this.EOCb_Selection.Execute += this.EOCb_Selection_Execute;

                base.Page_Load(sender, e);
                this.mObj = (ClsItem)this.pObj_Base;
                this.UcFileBrowser.EvAccept += this.Handle_FileBrowser;
                this.UcSelection.EvAccept += this.Handle_Selection;

                if (!this.IsPostBack)
                { this.SetupPage(); }
            }
        }