Example #1
0
        protected void btnNextContractNo_Click(object sender, EventArgs e)
        {
            try {
                int iOrigContractNo = ContractNumber;

                ResetShareholder();
                ResetContract();
                ResetField();

                GetContractBrowseNext(0, iOrigContractNo, CropYear, true);

                if (iOrigContractNo == ContractNumber)
                {
                    _eventWarningMsg = "You are currently viewing the last Contract in the system for this Agriculturist.  There isn't a Next Contract.";
                }

                GetShareholder(SHID, CropYear);
                ShowShareholder();
                GetContractList(SHID, CropYear);
                Common.UILib.SelectDropDownValue(ddlContractNumber, ContractNumber.ToString());
                SetSequenceNumber(SequenceNumberMax);

                // Raise event to container
                ContractSelectorEventArgs cntArg = new ContractSelectorEventArgs();
                OnContractNumberNext(cntArg);
            }
            catch (Exception ex) {
                // Raise event to container
                ContractSelectorEventArgs cntArg = new ContractSelectorEventArgs(ex);
                OnContractNumberNext(cntArg);
            }
        }
Example #2
0
        protected void ddlContractNumber_SelectedIndexChanged(object sender, EventArgs e)
        {
            try {
                int contractNo = ContractNumber;
                if (IsChangedSHID)
                {
                    GetShareholder(SHID, CropYear);
                }

                if (contractNo > 0)
                {
                    ResetContract();
                    ResetField();

                    GetContractBrowse(0, contractNo, CropYear, false);
                    Common.UILib.SelectDropDownValue(ddlContractNumber, ContractNumber.ToString());
                    SetSequenceNumber(SequenceNumberMax);
                }
                else
                {
                    SetSequenceNumber(0, 0);
                    ResetContract();
                    ResetField();
                }

                // Raise event to container
                ContractSelectorEventArgs cntArg = new ContractSelectorEventArgs();
                OnContractNumberChange(cntArg);
            }
            catch (Exception ex) {
                // Raise event to container
                ContractSelectorEventArgs cntArg = new ContractSelectorEventArgs(ex);
                OnContractNumberChange(cntArg);
            }
        }
Example #3
0
        private void BeetTransferRequest()
        {
            try {
                CropYear = _shs.CropYear;
                int shid           = _shs.SHID;
                int contractID     = _fld.ContractID;
                int sequenceNumber = _fld.SequenceNumber;

                txtQueryAction.Text += " * BeetTransferRequest: cy: " + CropYear.ToString() + "; shid: " + shid.ToString() +
                                       "; contractID: " + contractID.ToString() + "; sequenceNumber: " + sequenceNumber.ToString();

                ResetShareholder();
                ResetContract();
                ResetField();

                GetContractBrowse(contractID, 0, CropYear, false);

                GetShareholder(shid, CropYear);
                ShowShareholder();
                GetContractList(shid, CropYear);
                Common.UILib.SelectDropDownValue(ddlContractNumber, ContractNumber.ToString());
                SetSequenceNumber(SequenceNumberMax, sequenceNumber);
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + ".InitControl", ex);
                throw (wex);
            }
        }
Example #4
0
 /// <summary>
 /// Function called to search the model
 /// for availability of the specified string.
 /// </summary>
 /// <param name="str">The search string</param>
 /// <returns>True, if the string is contained in the model, else false</returns>
 public override bool Contains(string str)
 {
     return((ContractNumber != null && ContractNumber.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (CustomerNameAndShortName != null && CustomerNameAndShortName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (DivisionName != null && DivisionName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (POReferenceNumber != null && POReferenceNumber.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (EndUser != null && EndUser.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)));
 }
Example #5
0
 public async Task <int> AddOrUpdate(ContractNumber contract)
 {
     using (DatanetCMSWebEntities context = new DatanetCMSWebEntities())
     {
         context.ContractNumbers.AddOrUpdate(contract);
         return(await context.SaveChangesAsync());
     }
 }
Example #6
0
 /// <summary>
 /// Function called to search the model for availability of the specified string.
 /// </summary>
 /// <param name="str">The search string</param>
 /// <returns>True, if the string is contained in the model, else false</returns>
 public override bool Contains(string str)
 {
     return((ContractNumber != null && ContractNumber.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (InvoiceCustomer != null && InvoiceCustomer.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (CompanyName != null && CompanyName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (DivisionName != null && DivisionName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (ActivityName != null && ActivityName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (!string.IsNullOrEmpty(Convert.ToString(InvoiceDate)) && InvoiceDate.ToString(Constants.DATE_FORMAT).Contains(str)) ||
            (!string.IsNullOrEmpty(Convert.ToString(Amount)) && Convert.ToString(Amount).StartsWith(str, StringComparison.CurrentCultureIgnoreCase)));
 }
        public static ContractNumberModel ToContractNumberModel(this ContractNumber cn)
        {
            var model = new ContractNumberModel()
            {
                Id         = cn.Id,
                CustomerId = cn.CustomerId,
                Desc       = cn.Desc,
                Name       = cn.Name
            };

            return(model);
        }
        public static ContractNumber ToContractNumberModel(this ContractNumberModel model)
        {
            var cn = new ContractNumber()
            {
                Id         = model.Id,
                CustomerId = model.CustomerId,
                Desc       = model.Desc,
                Name       = model.Name
            };

            return(cn);
        }
Example #9
0
        /// <summary>
        /// 获取在职员工以及有效合同数量
        /// </summary>
        /// <param name="customerid">客户id</param>
        /// <returns></returns>
        public ContractNumber GetContractNumber(string customerid)
        {
            DataTable      dt     = contractDal.GetContractNumber(customerid);
            ContractNumber result = new ContractNumber();

            if (dt.Rows.Count > 0)
            {
                result.totalPerson    = dt.Rows[0]["totalPerson"].ToString();
                result.contractNumber = dt.Rows[0]["contracttotal"].ToString();
            }

            return(result);
        }
Example #10
0
 //ignores ID
 public bool WeakCompare(Contract other)
 {
     if (!ContractName.Equals(other.ContractName))
     {
         return(false);
     }
     if (!ContractNumber.Equals(other.ContractNumber))
     {
         return(false);
     }
     if (!LastUsedDirectory.Equals(other.LastUsedDirectory))
     {
         return(false);
     }
     return(true);
 }
Example #11
0
        //override//

        public override string ToString()
        {
            return(ContractNumber.ToString());
        }
Example #12
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 14, Configuration.FieldSeparator),
                       Id,
                       PrimaryKeyValueCdm?.ToDelimitedString(),
                       ChargeCodeAlias != null ? string.Join(Configuration.FieldRepeatSeparator, ChargeCodeAlias.Select(x => x.ToDelimitedString())) : null,
                       ChargeDescriptionShort,
                       ChargeDescriptionLong,
                       DescriptionOverrideIndicator,
                       ExplodingCharges != null ? string.Join(Configuration.FieldRepeatSeparator, ExplodingCharges.Select(x => x.ToDelimitedString())) : null,
                       ProcedureCode != null ? string.Join(Configuration.FieldRepeatSeparator, ProcedureCode.Select(x => x.ToDelimitedString())) : null,
                       ActiveInactiveFlag,
                       InventoryNumber != null ? string.Join(Configuration.FieldRepeatSeparator, InventoryNumber.Select(x => x.ToDelimitedString())) : null,
                       ResourceLoad.HasValue ? ResourceLoad.Value.ToString(Consts.NumericFormat, culture) : null,
                       ContractNumber != null ? string.Join(Configuration.FieldRepeatSeparator, ContractNumber.Select(x => x.ToDelimitedString())) : null,
                       ContractOrganization != null ? string.Join(Configuration.FieldRepeatSeparator, ContractOrganization.Select(x => x.ToDelimitedString())) : null,
                       RoomFeeIndicator
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Example #13
0
 public string GetReference()
 {
     return((Type == ContractType.Purchase ? "P" : "S")
            + ContractNumber.ToString("00000", CultureInfo.InvariantCulture) + ".000");
 }