コード例 #1
0
        private void btnSaveMethod()
        {
            if (!this.cvValidateControls.IsValid) return;
            this.cvInsert.Validate();
            if (!this.cvInsert.IsValid) return;

            ArticlesByCompanies datasheet = new ArticlesByCompanies()
            {
                Companies = new Companies()
                {
                    COMP_Id = int.Parse(this.ddlCompany.SelectedValue),
                    COMP_Name = this.ddlCompany.SelectedItem.Text
                },
                COMP_Id = int.Parse(this.ddlCompany.SelectedValue),
                COMP_ART_Name = this.txtArticleNameAsCompany.Text.Trim(),
                COMP_ART_Price = Bubis.Andika.WebSite.App_Code.Helpers.ControlsHelper.GetDecimalValueFromTextBox(this.txtArticlePrice).Value,
                COMP_ART_AMLA = Bubis.Andika.WebSite.App_Code.Helpers.ControlsHelper.GetIntValueFromTextBox(this.txtAMLA).Value,
                COMP_ART_AMLA_Encoded = this.encodeAMLA(this.txtAMLA.Text.Trim()),
                COMP_ART_ConditionOfSale = this.txtConditionOfSale.Text,
                COMP_ART_Date = Bubis.Andika.WebSite.App_Code.Helpers.ControlsHelper.GetDateTimeValueFromTextBox(this.txtArticleDate),
                COMP_ATCH_MustApprove = false
            };

            this.revAttachment.Validate();
            var haveDatasheet = this.revAttachment.IsValid && !string.IsNullOrEmpty(this.hdnFileName.Value) && !string.IsNullOrEmpty(this.hdnFileContent.Value);
            if (haveDatasheet)
            {
                datasheet.COMP_ART_AttachName = this.hdnFileName.Value;
                datasheet.COMP_ART_AttachContent = Bubis.Andika.WebSite.WebPages.FileHelper.GetFileContentFromBase64String(this.hdnFileContent.Value);
            }

            this.AddDatasheet(datasheet);
            Bubis.Andika.WebSite.App_Code.Helpers.ControlsHelper.ClearControls(this.Controls);
            this.TabMode = eTabMode.Ninguna;
        }
コード例 #2
0
 private void AddDatasheet(ArticlesByCompanies datasheet)
 {
     List<ArticlesByCompanies> dts = this.Datasheets;
     dts.Add(datasheet);
     this.Datasheets = dts;
 }