Beispiel #1
0
 public override string GetSqlWhere(Hashtable condition)
 {
     try
     {
         ConditionParam queryParam;
         string         strWhere = "";
         queryParam = ((ConditionParam)condition[QueryConditionType.是否审核]);
         if (queryParam.IsUse)
         {
             strWhere += "A.Audit_Flag=" + queryParam.Value.ToString() + " AND (A.OPTYPE='001'" + "or A.OPTYPE='025') ";
         }
         queryParam = ((ConditionParam)condition[QueryConditionType.开始时间]);
         if (queryParam.IsUse)
         {
             ConditionParam endTime = ((ConditionParam)condition[QueryConditionType.结束时间]);
             strWhere += " AND DATE(A.RegTime)>='" + ((DateTime)(queryParam.Value)).Date.ToString() +
                         "' AND DATE(A.RegTime)<='" + ((DateTime)endTime.Value).Date.ToString() + "'";
         }
         queryParam = ((ConditionParam)condition[QueryConditionType.部门ID]);
         strWhere  += oleDb.And() + "A.DEPTID" + oleDb.EuqalTo() + queryParam.Value.ToString();
         strWhere  += oleDb.And() + "A.DEL_FLAG=0";
         return(strWhere);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Beispiel #2
0
 public override string GetSqlWhere(Hashtable condition)
 {
     try
     {
         ConditionParam queryParam;
         string         strWhere = "";
         queryParam = (ConditionParam)condition[QueryConditionType.部门ID];
         strWhere  += "A.DeptID=" + queryParam.Value.ToString();
         queryParam = (ConditionParam)condition[QueryConditionType.单据号];
         if (queryParam.IsUse)
         {
             strWhere += oleDb.And() + "A.BillNum=" + queryParam.Value.ToString();
         }
         queryParam = (ConditionParam)condition[QueryConditionType.调价单号];
         if (queryParam.IsUse)
         {
             strWhere += oleDb.And() + "A.adjCode='" + queryParam.Value.ToString() + "'";
         }
         queryParam = (ConditionParam)condition[QueryConditionType.开始时间];
         if (queryParam.IsUse)
         {
             ConditionParam endTime = (ConditionParam)condition[QueryConditionType.结束时间];
             strWhere += oleDb.And() + "DATE(A.RegTime)>='" + ((DateTime)(queryParam.Value)).Date.ToString()
                         + "' AND DATE(A.RegTime)<='" + ((DateTime)(endTime.Value)).Date.ToString() + "'";
         }
         return(strWhere);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Beispiel #3
0
        public override string GetSqlWhere(Hashtable condition)
        {
            try
            {
                ConditionParam queryParam;
                string         strWhere = "";
                queryParam = ((ConditionParam)(condition[QueryConditionType.是否审核]));
                string isAudit = queryParam.Value.ToString().Trim();
                if (queryParam.IsUse)
                {
                    strWhere += "A.Audit_Flag=" + queryParam.Value.ToString();
                }
                queryParam = ((ConditionParam)condition[QueryConditionType.开始时间]);
                if (queryParam.IsUse)
                {
                    ConditionParam endTime = ((ConditionParam)condition[QueryConditionType.结束时间]);

                    if (isAudit == "0")  //update by heyan 2010.11.29 已审核的单据按审核时间查
                    {
                        strWhere += " AND DATE(A.RegTime)>='" + ((DateTime)(queryParam.Value)).Date.ToString() +
                                    "' AND DATE(A.RegTime)<='" + ((DateTime)endTime.Value).Date.ToString() + "'";
                    }
                    else
                    {
                        strWhere += " AND DATE(A.AuditTime)>='" + ((DateTime)(queryParam.Value)).Date.ToString() +
                                    "' AND DATE(A.AuditTime)<='" + ((DateTime)endTime.Value).Date.ToString() + "'";
                    }
                }
                queryParam = ((ConditionParam)condition[QueryConditionType.单据号]);
                if (queryParam.IsUse)
                {
                    strWhere += oleDb.And() + "A.BILLNUM" + oleDb.EuqalTo() + queryParam.Value.ToString();
                }
                queryParam = ((ConditionParam)condition[QueryConditionType.供应商ID]);
                if (queryParam.IsUse)
                {
                    strWhere += oleDb.And() + "A.SupportDicID" + oleDb.EuqalTo() + queryParam.Value.ToString();
                }
                queryParam = ((ConditionParam)condition[QueryConditionType.发票号]);
                if (queryParam.IsUse)
                {
                    strWhere += oleDb.And() + "A.InvoiceNum" + oleDb.EuqalTo() + "'" + queryParam.Value.ToString() + "'";
                }
                queryParam = ((ConditionParam)condition[QueryConditionType.部门ID]);
                strWhere  += oleDb.And() + "A.DEPTID" + oleDb.EuqalTo() + queryParam.Value.ToString();
                strWhere  += oleDb.And() + "A.DEL_FLAG=0";
                return(strWhere);
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Beispiel #4
0
        public override string GetSqlWhere(Hashtable condition)
        {
            ConditionParam queryParam;
            string         strWhere = "";

            queryParam = ((ConditionParam)condition[QueryConditionType.开始时间]);
            ConditionParam endTime = ((ConditionParam)condition[QueryConditionType.结束时间]);

            strWhere += "RegTime" + oleDb.Between() + "'" + ((DateTime)queryParam.Value).ToString("yyyy-MM-dd") + " 00:00:00' "
                        + oleDb.And() + " '" + ((DateTime)endTime.Value).ToString("yyyy-MM-dd") + @" 23:59:59'";
            return(strWhere);
        }
Beispiel #5
0
 public override string GetSqlWhere(Hashtable condition)
 {
     try
     {
         ConditionParam queryParam;
         string         strWhere = "";
         queryParam = ((ConditionParam)condition[QueryConditionType.开始时间]);
         ConditionParam endTime = ((ConditionParam)condition[QueryConditionType.结束时间]);
         strWhere += "A.OPTime" + oleDb.Between() + "'" + ((DateTime)queryParam.Value).ToString("yyyy-MM-dd") + " 00:00:00' " +
                     oleDb.And() + " '" + ((DateTime)endTime.Value).ToString("yyyy-MM-dd") + @" 23:59:59'";
         queryParam = ((ConditionParam)condition[QueryConditionType.部门ID]);
         strWhere  += oleDb.And() + "A.DEPTID" + oleDb.EuqalTo() + queryParam.Value.ToString();
         return(strWhere);
     }
     catch (Exception error)
     {
         throw error;
     }
 }