public virtual IEnumerable tasks() { var command = new Select3 <EPActivity, LeftJoin <MyEPCompanyTree, On <MyEPCompanyTree.workGroupID, Equal <EPActivity.groupID> >, LeftJoin <EPView, On <EPView.noteID, Equal <EPActivity.noteID>, And <EPView.userID, Equal <Current <AccessInfo.userID> > > > > >, OrderBy <Asc <EPActivity.endDate, Desc <EPActivity.priority, Asc <EPActivity.startDate> > > > >() as BqlCommand; var filter = Filter.Current; if (filter.OwnerID == null && filter.WorkGroupID == null) { command = command.WhereAnd( typeof(Where <EPActivity.groupID, Owned <CurrentValue <AccessInfo.userID> >, Or <Where <EPActivity.groupID, IsNull, And <EPActivity.owner, OwnedUser <CurrentValue <AccessInfo.userID> > > > > >)); } else { if (filter.OwnerID != null) { command = command.WhereOr(typeof(Where <EPActivity.owner, Equal <CurrentValue <TaskFilter.ownerID> > >)); } if (filter.WorkGroupID != null) { command = command.WhereAnd(typeof(Where <EPActivity.groupID, Equal <CurrentValue <TaskFilter.workGroupID> > >)); } if (filter.MyWorkGroup == true) { command = command.WhereAnd(typeof(Where <EPActivity.groupID, InMember <CurrentValue <TaskFilter.currentOwnerID> > >)); } if (filter.IsEscalated == true) { command = command.WhereOr(typeof(Where <EPActivity.groupID, Escalated <CurrentValue <TaskFilter.ownerID>, EPActivity.groupID, EPActivity.owner, EPActivity.startDate> >)); } if (filter.IsFollowUp == true) { command = command.WhereOr(typeof(Where <EPActivity.createdByID, Equal <CurrentValue <TaskFilter.ownerID> > >)); } } command = command.WhereAnd(typeof(Where <EPActivity.classID, Equal <CRActivityClass.task> >)); var view = new PXView(this, true, command); var startRow = PXView.StartRow; int totalRows = 0; var list = view.Select(PXView.Currents, PXView.Parameters, PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows); PXView.StartRow = 0; return(list); }
public IEnumerable <IPeriodSetup> FindFABookPeriodSetup(FABook book, bool clearQueryCache = false) { BqlCommand selectCommand; if (book.UpdateGL == true) { selectCommand = new Select3 <FinPeriodSetup, OrderBy <Asc <FinPeriodSetup.periodNbr> > >(); } else { selectCommand = new Select < FABookPeriodSetup, Where <FABookPeriodSetup.bookID, Equal <Required <FABook.bookID> > >, OrderBy <Asc <FABookPeriodSetup.periodNbr> > >(); } PXView view = new PXView(Graph, true, selectCommand); if (clearQueryCache) { view.Clear(); } return(view.SelectMulti(book.BookID).Cast <IPeriodSetup>()); }
protected void Page_Load(object sender, EventArgs e) { using (SqlConnection cn = new SqlConnection(@"Data Source=DESKTOP-GN1S5UA\SERVER;Initial Catalog=GestionCitas;Integrated Security=SSPI;")) { if (!this.IsPostBack) { { using (SqlCommand cmd = new SqlCommand("SELECT Id,Pais FROM Pais")) { cmd.CommandType = CommandType.Text; cmd.Connection = cn; cn.Open(); Select4.DataSource = cmd.ExecuteReader(); Select4.DataTextField = "Pais"; Select4.DataValueField = "Id"; Select4.DataBind(); cn.Close(); } using (SqlCommand cmd = new SqlCommand("SELECT Id,Aficcion FROM Aficcion")) { cmd.CommandType = CommandType.Text; cmd.Connection = cn; cn.Open(); Select1.DataSource = cmd.ExecuteReader(); Select1.DataTextField = "Aficcion"; Select1.DataValueField = "Id"; Select1.DataBind(); cn.Close(); } using (SqlCommand cmd = new SqlCommand("SELECT Id,Educacion FROM Educacion")) { cmd.CommandType = CommandType.Text; cmd.Connection = cn; cn.Open(); Select5.DataSource = cmd.ExecuteReader(); Select5.DataTextField = "Educacion"; Select5.DataValueField = "Id"; Select5.DataBind(); cn.Close(); } using (SqlCommand cmd = new SqlCommand("SELECT Id,Contextura FROM Contextura")) { cmd.CommandType = CommandType.Text; cmd.Connection = cn; cn.Open(); editprefixes.DataSource = cmd.ExecuteReader(); editprefixes.DataTextField = "Contextura"; editprefixes.DataValueField = "Id"; editprefixes.DataBind(); cn.Close(); } using (SqlCommand cmd = new SqlCommand("SELECT Id,Sexo FROM Sexo")) { cmd.CommandType = CommandType.Text; cmd.Connection = cn; cn.Open(); Select3.DataSource = cmd.ExecuteReader(); Select3.DataTextField = "Sexo"; Select3.DataValueField = "Id"; Select3.DataBind(); cn.Close(); } } } } }