예제 #1
0
        public void UpdataParams(string type, params object[] list)
        {
            int [] index = GetNameId(type);
            if (index.Length == 1)
            {
                LTableModel[index[0]].UpdateTable(type, list);
            }
            else
            {
                if (list.Length == 3)
                {
                    object[] _list1 = { list[0], list[1] };
                    object[] _list2 = { list[2] };
                    LTableModel[index[0]].UpdateTable(type, _list1);
                    LTableModel[index[1]].UpdateTable(type, _list2);
                }
                else
                {
                    LTableModel[index[0]].UpdateTable(type, list);
                }
            }
            int           id      = (int)FormName.Form_Positions;
            PositionsForm inputIO = MyControls[id] as PositionsForm;

            inputIO.LoadDataList();
        }
예제 #2
0
        public ActionResult List(int id, int posId = 0)
        {
            var vm = new PositionsForm {
                SectionId = id
            };

            vm.Positions = repo.GetBySection(id);

            if (posId != 0)
            {
                var item = repo.GetById(posId);
                vm.InjectFrom(item);
            }

            return(PartialView("_List", vm));
        }
예제 #3
0
        public ActionResult Save(PositionsForm item)
        {
            var pos = new Position();

            if (item.PosId == 0)
            {
                repo.Create(pos);
            }
            else
            {
                pos = repo.GetById(item.PosId);
            }

            UpdateModel(pos);

            repo.Save();

            return(RedirectToAction("List", new { id = pos.SectionId }));
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DispatchForm" /> class.
        /// </summary>
        /// <param name="projectId">projectId (Projekt). Sets also projectNumber, projectName. Please look up in your sales (Vertriebs-) and/or outgoing invoice settings (Abrechnungseinstellungen) to check if projectId is mandatory..</param>
        /// <param name="customerContactId">customerContactId (Lead/Interessent/Kunde). Sets also customerPersonalAccountId, customerPersonalAccountNumber, customerPersonalAccountName, customerPersonalAccountExternalNumber, customerName, customerNameExtra, customerNumber, customerContactName, customerContactCustomerNumber. Must be set if project is not mandatory. Ignored otherwise. (required).</param>
        /// <param name="name">name (Bezeichnung).</param>
        /// <param name="text">text (Beschreibung).</param>
        /// <param name="customerContactPerson">customerContactPerson (Ansprechpartner). Sets also customerContactPersonName. The contact must be an employee of the project contact (contactId)..</param>
        /// <param name="documentDate">documentDate (PZ-/Angebots-/Auftrags-/Rechnungs-/GS-/LS-Datum). If not given, it is set to the current date. Sets also documentDateMonth. (required).</param>
        /// <param name="documentNumber">documentNumber (Potenzial-/Angebots-/Auftrags-/Rechnungs-/Gutschrifts-/Lieferscheinnummer).The field is mandatory. If not provided a document number is generated..</param>
        /// <param name="ourContactPerson">ourContactPerson (Potenzial-/Angebots- Auftrags-/Rechnungs-/Gutschrifts-/Lieferscheinbearbeiter). The UID of a Scopevisio user. The user must have a user contact (Aus Benutzerkontakt) for the current organisation. Setting this field also sets ourContactPersonName..</param>
        /// <param name="deliveryType">deliveryType (Lieferart)..</param>
        /// <param name="deliveryCosts">deliveryCosts (Lieferkosten)..</param>
        /// <param name="cashOnDelivery">cashOnDelivery (Nachnamegebühr)..</param>
        /// <param name="textTitle">textTitle (Titel)..</param>
        /// <param name="textSubTitle">textSubTitle (Untertitel)..</param>
        /// <param name="textIntro">textIntro (Einleitungstext). Use \&quot;\\n\&quot; to insert new line..</param>
        /// <param name="textExtro">textExtro (Schlusstext). Use \&quot;\\n\&quot; to insert new line..</param>
        /// <param name="selectedAddress">selectedAddress (Adresse [Haupt-/Rechnungs-/Liefer-/freie Adresse]). 0 &#x3D; Hauptadresse, 1 &#x3D; Rechnungsadresse, 2 &#x3D; freie Adresse, 3 &#x3D; Lieferadresse.</param>
        /// <param name="otherAddress">otherAddress (freie Adresse). Use \&quot;\\n\&quot; to insert new line..</param>
        /// <param name="gross">gross (Preisangabe - Netto/Brutto) (default to false).</param>
        /// <param name="permissionType">0 &#x3D; Öffentlich, 1 &#x3D; Benutzerdefiniert, 2 &#x3D; Persönlich.</param>
        /// <param name="readPermissionProfiles">comma separated list of profiles for the read permissions, evaluated only if permissionType equals 1..</param>
        /// <param name="readPermissionLogins">comma separated list of user login emails for the read permissions, evaluated only if permissionType equals 1..</param>
        /// <param name="writePermissionProfiles">comma separated list of profiles for full access, evaluated only if permissionType equals 1..</param>
        /// <param name="writePermissionLogins">comma separated list of user login emails, evaluated only if permissionType equals 1..</param>
        /// <param name="customFields">Benutzerdefinierte Felder.</param>
        /// <param name="positionsForm">positionsForm.</param>
        /// <param name="orderNumber">orderNumber (Bestellnummer).</param>
        /// <param name="stateName">state (Angebotsstatus). Sets also state..</param>
        /// <param name="valutaDate">valutaDate (Umsatz-Zeitpunkt)..</param>
        /// <param name="locale">locale (Sprache).</param>
        public DispatchForm(long projectId = default(long), long customerContactId = default(long), string name = default(string), string text = default(string), long customerContactPerson = default(long), long documentDate = default(long), string documentNumber = default(string), string ourContactPerson = default(string), string deliveryType = default(string), decimal deliveryCosts = default(decimal), decimal cashOnDelivery = default(decimal), string textTitle = default(string), string textSubTitle = default(string), string textIntro = default(string), string textExtro = default(string), long selectedAddress = default(long), string otherAddress = default(string), bool gross = false, long permissionType = default(long), string readPermissionProfiles = default(string), string readPermissionLogins = default(string), string writePermissionProfiles = default(string), string writePermissionLogins = default(string), List <CustomField> customFields = default(List <CustomField>), PositionsForm positionsForm = default(PositionsForm), string orderNumber = default(string), StateNameEnum?stateName = default(StateNameEnum?), long valutaDate = default(long), string locale = default(string))
        {
            // to ensure "customerContactId" is required (not null)
            if (customerContactId == null)
            {
                throw new InvalidDataException("customerContactId is a required property for DispatchForm and cannot be null");
            }
            else
            {
                this.CustomerContactId = customerContactId;
            }

            // to ensure "documentDate" is required (not null)
            if (documentDate == null)
            {
                throw new InvalidDataException("documentDate is a required property for DispatchForm and cannot be null");
            }
            else
            {
                this.DocumentDate = documentDate;
            }

            this.ProjectId             = projectId;
            this.Name                  = name;
            this.Text                  = text;
            this.CustomerContactPerson = customerContactPerson;
            this.DocumentNumber        = documentNumber;
            this.OurContactPerson      = ourContactPerson;
            this.DeliveryType          = deliveryType;
            this.DeliveryCosts         = deliveryCosts;
            this.CashOnDelivery        = cashOnDelivery;
            this.TextTitle             = textTitle;
            this.TextSubTitle          = textSubTitle;
            this.TextIntro             = textIntro;
            this.TextExtro             = textExtro;
            this.SelectedAddress       = selectedAddress;
            this.OtherAddress          = otherAddress;
            // use default value if no "gross" provided
            if (gross == null)
            {
                this.Gross = false;
            }
            else
            {
                this.Gross = gross;
            }
            this.PermissionType          = permissionType;
            this.ReadPermissionProfiles  = readPermissionProfiles;
            this.ReadPermissionLogins    = readPermissionLogins;
            this.WritePermissionProfiles = writePermissionProfiles;
            this.WritePermissionLogins   = writePermissionLogins;
            this.CustomFields            = customFields;
            this.PositionsForm           = positionsForm;
            this.OrderNumber             = orderNumber;
            this.StateName  = stateName;
            this.ValutaDate = valutaDate;
            this.Locale     = locale;
        }