Exemplo n.º 1
0
        protected override string GetFirstValue()
        {
            XQueryDatePicker dateTimePicker = m_QueryControl as XQueryDatePicker;

            return(dateTimePicker.Value.ToString("yyyy-MM-dd"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取大于等于的查询条件
        /// </summary>
        /// <param name="firstName"></param>
        /// <returns></returns>
        protected virtual string GetMoreThanOrEqualCondition(string firstValue)
        {
            if (this.IsString())
            {
                return(" and " + this.m_QueryControl.QueryFieldName + ">='" + firstValue + "'");
            }
            else
            {
                if (this.m_QueryControl is XQueryDatePicker)
                {
                    //如果是日期类型
                    XQueryDatePicker queryPicker = this.m_QueryControl as XQueryDatePicker;

                    bool isQuery = true;
                    if (queryPicker.ShowCheckBox == true)
                    {
                        if (queryPicker.Checked)
                        {
                            isQuery = true;
                        }
                        else
                        {
                            isQuery = false;
                        }
                    }
                    if (isQuery)
                    {
                        //如果是日期类型
                        return(" and convert(VARCHAR(10)," + this.m_QueryControl.QueryFieldName + ",120)>='" + firstValue + "'");
                    }
                    else
                    {
                        return(string.Empty);
                    }
                }
                else if (this.m_QueryControl is XQueryDateTimePicker)
                {
                    //如果是时间类型
                    XQueryDateTimePicker queryPicker = this.m_QueryControl as XQueryDateTimePicker;
                    bool isQuery = true;
                    if (queryPicker.ShowCheckBox == true)
                    {
                        if (queryPicker.Checked)
                        {
                            isQuery = true;
                        }
                        else
                        {
                            isQuery = false;
                        }
                    }
                    if (isQuery)
                    {
                        //如果是时间类型
                        return(" and convert(VARCHAR(19)," + this.m_QueryControl.QueryFieldName + ",120)>='" + firstValue + "'");
                    }
                    else
                    {
                        return(string.Empty);
                    }
                }
                else
                {
                    return(" and " + this.m_QueryControl.QueryFieldName + ">=" + firstValue + "");
                }
            }
        }