Пример #1
0
        public override IList <DDLListItem> GetList(List <WACParameter> parms)
        {
            string _swis     = (string)WACParameter.GetParameterValue(parms, "swis");
            bool   newTPOnly = (bool)WACParameter.GetParameterValue(parms, "NewTaxParcelsOnly");

            using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
            {
                //var c = wac.vw_taxParcel_DEP_alls.Where(w => w.swis == _swis).Distinct((x, y) => x.SBL == y.SBL).OrderBy(o => o.PRINT_KEY).
                //    Select(s => new DDLListItem(s.SBL, s.PRINT_KEY));
                //return c.ToList();
                var c = wac.vw_taxParcel_DEP_alls.Where(w => w.SWIS == _swis).Distinct((x, y) => x.SBL == y.SBL).OrderBy(o => o.PRINT_KEY).
                        Select(s => new DDLListItem(s.SBL, s.PRINT_KEY));
                var d = wac.taxParcels.Where(w => w.fk_list_swis == _swis).Distinct((x, y) => x.SBL == y.SBL).OrderBy(o => o.taxParcelID).
                        Select(s => new DDLListItem(s.SBL, s.taxParcelID));
                if (newTPOnly)
                {
                    var minus = c.ToList().Except(d.ToList(), new DDLListItemComparer());
                    return(minus.OrderBy(o => o.DataTextField).ToList());
                }
                else
                {
                    var union = c.ToList().Union(d.ToList(), new DDLListItemComparer()).
                                Distinct((x, y) => x.DataValueField == y.DataValueField);
                    return(union.OrderBy(o => o.DataTextField).ToList());
                }
            }
        }
        public override IList GetFilteredList(List <WACParameter> parms)
        {
            WACEnumerations.WACSectorCodes sectorCode = (WACEnumerations.WACSectorCodes)WACParameter.GetParameterValue(parms,
                                                                                                                       WACParameter.ParameterType.SectorCode);
            object pk = WACParameter.GetParameterValue(parms, WACParameter.ParameterType.PrimaryKey);
            object mk = WACParameter.GetParameterValue(parms, WACParameter.ParameterType.MasterKey);

            if (mk == null && pk == null)
            {
                return(docLoader(sectorCode));
            }
            if (mk != null && pk == null)
            {
                return(docLoader(mk, sectorCode));
            }
            if (mk == null && pk != null)
            {
                return(docLoader(pk, sectorCode));
            }
            if (mk != null && pk != null)
            {
                return(docLoader(mk, pk, sectorCode));
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
 public override IList GetFilteredList(List <WACParameter> parms)
 {
     try
     {
         IList <TaxParcel> x = GetList() as IList <TaxParcel>;
         PrimaryKeyVerify(ref parms);
         string _partialPrintKey = WACParameter.GetParameterValue(parms, "partialPrintKey") as string;
         string _participant     = WACParameter.GetParameterValue(parms, "participant") as string;
         if (!string.IsNullOrEmpty(_partialPrintKey))
         {
             var a = x.Where(w => w.taxParcelID.StartsWith(_partialPrintKey)).OrderBy(o => o.taxParcelID).Select(s => s);
             return(a.ToList <WAC_DataObjects.TaxParcel>());
         }
         else if (!string.IsNullOrEmpty(_participant))
         {
             var a = x.Where(w => !string.IsNullOrEmpty(w.ownerStr_dnd) && w.ownerStr_dnd.Contains(_participant)).OrderBy(o => o.taxParcelID).Select(s => s);
             return(a.ToList <WAC_DataObjects.TaxParcel>());
         }
         else
         {
             return(x.Where <TaxParcel>(FuncWhere <TaxParcel>(parms)).ToList());
         }
     }
     catch (Exception e) { WACAlert.Show(e.Message, 0); }
     return(null);
 }
Пример #4
0
 protected void TaxParcelPicker_Notify(object sender, UserControlResultEventArgs e)
 {
     County                = WACParameter.GetParameterValue(e.Parms, "county") as string;
     Swis                  = WACParameter.GetParameterValue(e.Parms, "swis") as string;
     TaxParcelID           = WACParameter.GetParameterValue(e.Parms, "printkey") as string;
     sReq.ServiceFor       = fvSA;
     sReq.ServiceRequested = ServiceFactory.ServiceTypes.BindDDL;
     ServiceFactory.Instance.ServiceRequest(sReq);
 }
Пример #5
0
        public void SortGridView(GridView gv, List <WACParameter> parms)
        {
            string srt           = WACParameter.GetParameterValue(parms, WACParameter.ParameterType.ListSort) as string;
            string sortDirection = ToggleSortDirection(srt);

            sortExpression = srt;
            IList sorted = ListSource.GetSortedList(DataProvider.SortedList, sortExpression, sortDirection);

            BindGridView(gv, sorted);
        }
Пример #6
0
        public void BindSingleDDL(Control c, List <WACParameter> parms)
        {
            string        ddlID = (string)WACParameter.GetParameterValue(parms, "ddlID");
            DDLDataObject ddlDO = DDLBinders[ddlID];

            if (ddlDO != null)
            {
                bindControlDDL(c, parms, null, ddlDO, ddlID);
            }
        }
Пример #7
0
        public override IList GetItem(List <WACParameter> parms, IList list)
        {
            if (list == null)
            {
                list = GetFilteredList(parms);
            }
            List <TaxParcel> ilist = list as List <TaxParcel>;

            return(ilist.Where(w => w.pk_taxParcel == WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms,
                                                                                                                WACParameter.ParameterType.SelectedKey))).ToList());
        }
Пример #8
0
        public override IList <DDLListItem> GetList(List <WACParameter> parms)
        {
            int _pkCounty = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, "pk_list_countyNY"));

            using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
            {
                var c = wac.vw_taxParcel_jurisdictions.Where(w => w.pk_list_countyNY == _pkCounty).Distinct((x, y) => x.Jurisdiction == y.Jurisdiction).
                        OrderBy(o => o.Jurisdiction).Select(s => new DDLListItem(s.SWIS, s.Jurisdiction));
                return(c.ToList());
            }
        }
Пример #9
0
 private void SetMasterKeyForContainer(ServiceRequest _request)
 {
     //WACParameter wp = WACParameter.RemoveParameterType(_request.ParmList, WACParameter.ParameterType.MasterKey);
     foreach (WACControl _control in ControlList(_request.ServiceFor))
     {
         WACViewModel vm = GetViewModelForControl(_request.ServiceFor);
         if (vm.ListSource != null)
         {
             vm.ListSource.SetMasterKeyValue(WACParameter.GetParameterValue(_request.ParmList, WACParameter.ParameterType.MasterKey));
         }
     }
 }
Пример #10
0
 public override IList GetFilteredList(List <WACParameter> parms)
 {
     using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
     {
         string _county       = WACParameter.GetParameterValue(parms, "county") as string;
         string _jurisdiction = WACParameter.GetParameterValue(parms, "jurisdiction") as string;
         try
         {
             var a = wac.taxParcels.Where(w => w.list_swi.county == _county && w.list_swi.jurisdiction == _jurisdiction).OrderBy(o => o.taxParcelID).Select(s =>
                                                                                                                                                            new WAC_DataObjects.TaxParcel(s.pk_taxParcel, s.fk_list_swis, s.taxParcelID, s.list_swi.county, s.list_swi.jurisdiction, s.retired));
             return(a.ToList <WAC_DataObjects.TaxParcel>());
         }
         catch (Exception e) { WACAlert.Show(e.Message, 0); }
     }
     return(null);
 }
Пример #11
0
 public override IList GetFilteredList(List <WACParameter> parms)
 {
     using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
     {
         string _partialPrintKey = WACParameter.GetParameterValue(parms, "partialPrintKey") as string;
         try
         {
             var a = wac.taxParcels.Where(w => w.taxParcelID.StartsWith(_partialPrintKey)).OrderBy(o => o.taxParcelID).Select(s =>
                                                                                                                              new WAC_DataObjects.TaxParcel(s.pk_taxParcel, s.fk_list_swis, s.taxParcelID, s.note, s.SBL, s.ownerStr_dnd, s.acreage, s.retired,
                                                                                                                                                            s.list_swi.county, s.list_swi.jurisdiction, s.created, s.created_by, s.modified, s.modified_by));
             return(a.ToList <WAC_DataObjects.TaxParcel>());
         }
         catch (Exception e) { WACAlert.Show(e.Message, 0); }
     }
     return(null);
 }
Пример #12
0
    protected void TaxParcelPicker_Notify(object sender, UserControlResultEventArgs e)
    {
        County      = WACParameter.GetParameterValue(e.Parms, "county") as string;
        Swis        = WACParameter.GetParameterValue(e.Parms, "swis") as string;
        TaxParcelID = WACParameter.GetParameterValue(e.Parms, "printkey") as string;
        DropDownList ddlBasin = fvFarmBusiness.FindControl("ddlBasin") as DropDownList;

        if (ddlBasin != null)
        {
            ddlBasin.Items.Clear();
        }
        sReq.ParmList.Add(new WACParameter("pk_County", County, WACParameter.ParameterType.Property));
        sReq.ParmList.Add(new WACParameter("ddlID", "ddlBasin", WACParameter.ParameterType.Property));
        sReq.ServiceFor       = fvFarmBusiness;
        sReq.ServiceRequested = ServiceFactory.ServiceTypes.BindDDL;
        ServiceFactory.Instance.ServiceRequest(sReq);
    }
Пример #13
0
 public override void CustomAction(List <WACParameter> parms)
 {
     if (DataProvider != null)
     {
         Control        filter = WACParameter.GetParameterValue(parms, "FilterControl") as Control;
         ServiceRequest sr     = new ServiceRequest(filter);
         sr.ParmList = parms;
         sr.ParmList.Add(new WACParameter("dataprovider", DataProvider, WACParameter.ParameterType.DataProvider));
         sr.ServiceRequested = ServiceFactory.ServiceTypes.FilteredGridViewList;
         ServiceFactory.Instance.ServiceRequest(sr);
         sr = null;
     }
     else
     {
         WACAlert.Show("WACPR_TaxParcelPrintKeySearchVM.CustomAction: DataProvider is null", 0);
     }
 }
Пример #14
0
        public void ChildGridStateChanged(Control c, List <WACParameter> parms)
        {
            WACGridControl.ListState state = (WACGridControl.ListState)WACParameter.GetParameterValue(parms, WACParameter.ParameterType.ListState);
            ServiceRequest           sr    = new ServiceRequest(c);

            switch (state)
            {
            case WACGridControl.ListState.ListFull:
                //sr.ServiceRequested = ServiceFactory.ServiceTypes.OpenGridView;
                //ServiceFactory.Instance.ServiceRequest(sr);
                //sr.ServiceRequested = ServiceFactory.ServiceTypes.CloseFormView;
                //ServiceFactory.Instance.ServiceRequest(sr);
                break;

            case WACGridControl.ListState.ListSingle:
                //sr.ServiceRequested = ServiceFactory.ServiceTypes.OpenGridView;
                //ServiceFactory.Instance.ServiceRequest(sr);
                //sr.ParmList = Parms;
                //sr.ServiceRequested = ServiceFactory.ServiceTypes.HandleGridViewSelection;
                //ServiceFactory.Instance.ServiceRequest(sr);
                break;

            case WACGridControl.ListState.ListEmpty:
                sr.ServiceRequested = ServiceFactory.ServiceTypes.ClearFormView;
                ServiceFactory.Instance.ServiceRequest(sr);
                //ResetTabs(sr);
                break;

            case WACGridControl.ListState.OpenView:
                break;

            case WACGridControl.ListState.SelectionMade:
                break;

            case WACGridControl.ListState.Closed:
                sr.ServiceRequested = ServiceFactory.ServiceTypes.ClearFormView;
                ServiceFactory.Instance.ServiceRequest(sr);
                break;

            default:
                break;
            }
            sr = null;
        }
Пример #15
0
        public override IList <DDLListItem> GetList(List <WACParameter> parms)
        {
            int fk_County = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, "pk_County"));

            using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
            {
                if (fk_County > 0)
                {
                    var x = wac.list_basins.Where(w => w.list_countyNYBasins.Any(a => a.fk_list_countyNY == fk_County)).OrderBy(o => o.basin).Select(s =>
                                                                                                                                                     new DDLListItem(s.pk_basin_code, s.basin));
                    return(x.ToList());
                }
                else
                {
                    var x = wac.list_basins.OrderBy(o => o.basin).Select(s =>
                                                                         new DDLListItem(s.pk_basin_code, s.basin));
                    return(x.ToList());
                }
            }
        }
Пример #16
0
 private void OpenTabControl(ServiceRequest _request)
 {
     // called from page level form
     WACControlConnector topCon = GetConnector(_request);
     int tabIndex = Convert.ToInt32(WACParameter.GetParameterValue(_request.ParmList, "activeTabindex"));
     //var x = topCon.Connections.Values.Where(w => IsTabControl(w)).Select(s => s);
     //foreach (WACTabControl tc in x)
     //{
     //    if (tabIndex == tc.MyTabIndex)
     //    {
     //        WACTabControlViewModel tcvm = GetViewModelForControl(tc) as WACTabControlViewModel;
     //        if (tcvm != null && tcvm.MyTabState == WACTabControlViewModel.TabState.Initialized)
     //        {
     //            _request.ParmList.Add(tcvm.ListSource.MasterKey);
     //            tc.OpenTabControl(tc, _request.ParmList);
     //            tcvm.MyTabState = WACTabControlViewModel.TabState.Open;
     //        }
     //    }
     //}
 }
Пример #17
0
        public override IList GetFilteredList(List <WACParameter> parms)
        {
            WACEnumerations.AssociationTypes assocType = (WACEnumerations.AssociationTypes)WACParameter.GetParameterValue(parms, WACParameter.ParameterType.AssociationType);
            switch (assocType)
            {
            case WACEnumerations.AssociationTypes.Participant:
                return(GetList(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.SelectedKey), LoadPartcipantAssociations));

            case WACEnumerations.AssociationTypes.Property:
                return(GetList(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.SelectedKey), LoadPropertyAssociations));

            case WACEnumerations.AssociationTypes.Organization:
                return(GetList(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.SelectedKey), LoadOrganizationAssociations));

            case WACEnumerations.AssociationTypes.TaxParcel:
                return(GetList(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.SelectedKey), LoadTaxParcelAssociations));

            default:
                return(null);
            }
        }
Пример #18
0
    private string getCount()
    {
        string        rowCount;
        StringBuilder sb = new StringBuilder();

        sb.Append("(");
        sReq.ServiceFor       = WACPR_TaxParcelOwnerGrid;
        sReq.ServiceRequested = ServiceFactory.ServiceTypes.ListRowCount;
        ServiceFactory.Instance.ServiceRequest(sReq);
        rowCount = WACParameter.GetParameterValue(WACPR_TaxParcelOwnerGrid.GetContents(), WACParameter.ParameterType.RowCount).ToString();
        if (!string.IsNullOrEmpty(rowCount))
        {
            sb.Append(rowCount);
        }
        else
        {
            sb.Append("?");
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #19
0
        public bool PrimaryKeyVerify(ref List <WACParameter> parms)
        {
            Object       pk = null;
            WACParameter wp = null;

            if (parms.Count() < 1)
            {
                return(false);
            }
            try
            {
                // get pk parameter based on parameter type
                wp = WACParameter.GetPrimaryKey(parms);
                if (wp == null)
                {
                    return(false);
                }
                // if pk parameter exists, make sure the pk property name is set in the parameter
                if (string.IsNullOrEmpty(wp.ParmName))
                {
                    parms.Remove(wp);
                    wp.ParmName = PrimaryKeyName();
                    parms.Add(wp);
                }
                // verify the pk parameter has a value
                pk = WACParameter.GetParameterValue(parms, PrimaryKeyName());
                if (pk == null)
                {
                    return(false);
                }
                return(true);
            }
            catch (Exception ex)
            {
                WACAlert.Show(ex.Message + " in WACDataProvider.PrimaryKeyVerify()", 0);
                return(false);
            }
        }
Пример #20
0
 public bool IsActiveFormMode(List <WACParameter> parms)
 {
     try
     {
         WACFormControl.FormState state = (WACFormControl.FormState)WACParameter.GetParameterValue(parms, WACParameter.ParameterType.FormState);
         if (state == WACFormControl.FormState.OpenView && IsActiveReadOnly)
         {
             return(true);
         }
         if (state == WACFormControl.FormState.OpenInsert && IsActiveInsert)
         {
             return(true);
         }
         if (state == WACFormControl.FormState.OpenUpdate && IsActiveUpdate)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception)
     {
         return(true);
     }
 }
        public override IList GetItem(List <WACParameter> parms, IList list)
        {
            if (list == null)
            {
                list = GetFilteredList(parms);
            }
            List <TaxParcelOwner> ilist = list as List <TaxParcelOwner>;

            return(ilist.Where(w => w.pk_taxParcelOwner == WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms,
                                                                                                                     TaxParcelOwner.PrimaryKeyName))).ToList());
        }
Пример #22
0
 public void PageGridView(GridView gv, List <WACParameter> parms)
 {
     gv.PageIndex = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.ListPage));
     BindGridView(gv);
 }
Пример #23
0
        public override void CustomAction(List <WACParameter> parms)
        {
            Control parent = WACParameter.GetParameterValue(parms, "ContainingControl") as Control;

            base.BindControlDDLs(parent, parms);
        }
Пример #24
0
 public override void OpenDefaultDataView(List <WACParameter> parms)
 {
     BindOrganization(WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.PrimaryKey)));
 }
Пример #25
0
        public FarmBusiness ValidateInsert(List <WACParameter> parms)
        {
            FarmBusiness f = new FarmBusiness();
            int          val;

            foreach (WACParameter parm in parms)
            {
                switch (parm.ParmName)
                {
                case "swis":
                    f.swis = ValidateString(parm.ParmValue, parm.ParmName, false);
                    break;

                case "printKey":
                    f.printKey = ValidateString(parm.ParmValue, parm.ParmName, false);
                    break;

                case "fk_participantOwner":
                    val = ValidateInt(parm.ParmValue, parm.ParmName, false, true);
                    if (val == 0)
                    {
                        f.fk_participantOwner = null;
                    }
                    else
                    {
                        f.fk_participantOwner = val;
                    }
                    break;

                case "fk_participantOperator":
                    val = ValidateInt(parm.ParmValue, parm.ParmName, false, true);
                    if (val == 0)
                    {
                        f.fk_participantOperator = null;
                    }
                    else
                    {
                        f.fk_participantOperator = val;
                    }
                    break;

                case "farm_name":
                    f.farm_name = ValidateString(parm.ParmValue, parm.ParmName, false);
                    break;

                case "fk_programWAC_code":
                    f.fk_programWAC_code = ValidateString(parm.ParmValue, parm.ParmName, true);
                    break;

                case "fk_farmSize_code":
                    string programWAC_code = WACParameter.GetParameterValue(parms, "fk_programWAC_code") as string;
                    if (programWAC_code.Contains("EOH"))
                    {
                        f.fk_farmSize_code = ValidateString(parm.ParmValue, parm.ParmName, false);
                    }
                    else
                    {
                        f.fk_farmSize_code = ValidateString(parm.ParmValue, parm.ParmName, true);
                    }
                    break;

                case "fk_basin_code":
                    f.fk_basin_code = ValidateString(parm.ParmValue, parm.ParmName, true);
                    break;

                case "sold_farm":
                    val = ValidateInt(parm.ParmValue, parm.ParmName, false, true);
                    if (val == 0)
                    {
                        f.sold_farm = null;
                    }
                    else
                    {
                        f.sold_farm = val;
                    }
                    break;

                case "GenerateID":
                    f.GenerateID = ValidateString(parm.ParmValue, parm.ParmName, true);
                    break;

                case "created_by":
                    f.created_by = ValidateString(parm.ParmValue, parm.ParmName, true);
                    break;

                default:
                    break;
                }
            }
            return(f);
        }
Пример #26
0
        public override IList <DDLListItem> GetList(List <WACParameter> parms)
        {
            AlphaPickerListType listType;

            try
            {
                listType = (AlphaPickerListType)WACParameter.GetParameterValue(parms, WACParameter.ParameterType.PickerListType);
                string startsWith = WACParameter.GetParameterValue(parms, "NameStartsWith") as string;
                if (string.IsNullOrEmpty(startsWith))
                {
                    switch (listType)
                    {
                    case AlphaPickerListType.Participant:
                        return(participantOnlyList());

                    case AlphaPickerListType.Organization:
                        return(organizationOnlyList());

                    case AlphaPickerListType.ParticipantOrganization:
                        return(participantAndOrganizationList());

                    case AlphaPickerListType.TaxParcelOwner:
                        return(taxParcelOwner());

                    case AlphaPickerListType.Operator:
                        return(operatorList(startsWith));

                    default:
                        return(null);
                    }
                }
                else
                {
                    switch (listType)
                    {
                    case AlphaPickerListType.Participant:
                        return(participantOnlyList(startsWith));

                    case AlphaPickerListType.Organization:
                        return(organizationOnlyList(startsWith));

                    case AlphaPickerListType.ParticipantOrganization:
                        return(participantAndOrganizationList(startsWith));

                    case AlphaPickerListType.TaxParcelOwner:
                        return(taxParcelOwner(startsWith));

                    case AlphaPickerListType.Operator:
                        return(operatorList(startsWith));

                    default:
                        return(null);
                    }
                }
            }
            catch (Exception ex)
            {
                WACAlert.Show("Invalid or Missing AlphaPickerListType In ParticipantOrganizationDP" + ex.Message, 0);
                return(null);
            }
        }
Пример #27
0
    protected void TaxParcelPicker_Notify(object sender, UserControlResultEventArgs e)
    {
        Label lblSBL = fvTaxParcel.FindControl("lblSBL") as Label;

        lblSBL.Text = WACParameter.GetParameterValue(e.Parms, "SBL") as string;
    }