예제 #1
0
        protected override void PopulateControl()
        {
            base.PopulateControl();
            this.packSellingCompany.DataSource = Common.SellingCompany.FetchAll();
            this.packType.DataSource           = Packtype.FetchAll();
            this.packOutputMethod.DataSource   = OutputQueue.FetchAll();

            //Gets merge fields list
            var mergeFields  = new List <KeyValuePair <string, byte> >();
            var packTypeList = Packtype.FetchAll();

            foreach (var packTypeObject in packTypeList)
            {
                var mergeFieldListFromView = Query.Create()
                                             .Select("COLUMN_NAME")
                                             .From(QuerySources.PackMergeFields)
                                             .WhereRaw("(TABLE_NAME = '" + packTypeObject.StoredProc + "' and COLUMN_NAME not like 'PR_ID%')", null)
                                             .OrderBy("COLUMN_NAME", true)
                                             .Run();

                foreach (var field in mergeFieldListFromView)
                {
                    mergeFields.Add(new KeyValuePair <string, byte>(field.Values.First().ToString(), packTypeObject.Type));
                }
            }

            this.AllMergeFields.DataSource = mergeFields;

            if (this.Id.FieldValue == "")
            {
                this.packRetainAttachments.FieldValue = true;
                this.DataSource.ActPqKeep             = 1;
                this.packSellingCompany.FieldValue    = this.CurrentSession.User.SellingCompanyId;
            }
            else
            {
                this.packSellingCompany.FieldValue = this.DataSource.PackSellingCompanyIdId;
                Packtype objPackType = Packtype.FetchAll().Where(s => s.Type == this.DataSource.PackType).FirstOrDefault();
                if (objPackType != null)
                {
                    this.packType.FieldValue    = objPackType.Type.ToString();
                    this.packType.DisplayMember = objPackType.Desc;
                }
                this.packType.IsReadOnly = ConfigurableBoolean.True;
                //this.packDeliveryFailure.FieldValue = false;
                //this.packDeliveryDelay.FieldValue = false;
                //this.packDeliverySuccess.FieldValue = false;

                if (!string.IsNullOrEmpty(this.DataSource.DsnOptions))
                {
                    var dsnOptions = this.DataSource.DsnOptions.Split(',');
                    foreach (string val in dsnOptions)
                    {
                        getDSNOptionsVal(val);
                    }
                }
            }
        }
예제 #2
0
        protected override void OnPreRender(EventArgs eventArguments)
        {
            base.OnPreRender(eventArguments);

            var mergeFields = new List <string>();

            if (this.DataSource != null && this.DataSource.Id != null)
            {
                //Gets Merge fields depending on selected Packtype
                var packTypeObject = Packtype.FetchAll().Where(x => x.Type == this.DataSource.PackType).FirstOrDefault();
                if (packTypeObject != null)
                {
                    var mergeFieldListFromView = Query.Create()
                                                 .Select("COLUMN_NAME")
                                                 .From(QuerySources.PackMergeFields)
                                                 .WhereRaw("(TABLE_NAME = '" + packTypeObject.StoredProc + "' and COLUMN_NAME not like 'PR_ID%')", null)
                                                 .OrderBy("COLUMN_NAME", true)
                                                 .Run();

                    foreach (var field in mergeFieldListFromView)
                    {
                        mergeFields.Add(field.Values.First().ToString());
                    }
                }

                this.SubjectMerge.DataSource = mergeFields;
                this.BodyMerge.DataSource    = mergeFields;

                //Checks if Word Template is linked to Pack
                var isWordTemplateLinkedToPack = false;

                var packList = Query.Create()
                               .Select("LIT_ID")
                               .From(QuerySources.DocumentTemplates)
                               .WhereRaw("(PACKXREF_PACK_ID = '" + this.DataSource.Id + "' and TYPE = 'Word Template' and IS_COVER_PAGE=1)", null)
                               .Run();

                if (packList.Count() > 0)
                {
                    isWordTemplateLinkedToPack = true;
                }

                if (isWordTemplateLinkedToPack)
                {
                    this.Body.IsReadOnly      = ConfigurableBoolean.TrueEnforced;
                    this.BodyMerge.IsReadOnly = ConfigurableBoolean.TrueEnforced;
                }
            }
        }
예제 #3
0
        protected override void PopulateControls()
        {
            base.PopulateControls();
            this.PackDetails.DataSource = this.Data;

            this.DocumentTemplateList.PackId = this.Data.Id;
            Packtype objPackType = Packtype.FetchAll().Where(s => s.Type == this.Data.PackType).FirstOrDefault();

            if (objPackType != null)
            {
                this.DocumentTemplateList.PackType = objPackType.Type.ToString();
            }

            this.PackEmailDetail.DataSource = this.Data;
        }