当前位置: 首页>>代码示例>>C#>>正文


C# SQLHelper.MakeSQL方法代码示例

本文整理汇总了C#中SQLHelper.MakeSQL方法的典型用法代码示例。如果您正苦于以下问题:C# SQLHelper.MakeSQL方法的具体用法?C# SQLHelper.MakeSQL怎么用?C# SQLHelper.MakeSQL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLHelper的用法示例。


在下文中一共展示了SQLHelper.MakeSQL方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSIMREG_NEWFORMs

        public BESIMREG_NEWFORMs GetSIMREG_NEWFORMs(string msisdnTitle, string requestById, string requestTypeId, string deliverById, string requestFromDate, string requestToDate, string deliverFromDate, string deliverToDate, SQLHelper sqlHelper)
        {
            string sql = string.Empty;
            string whereSql = string.Empty;
            BESIMREG_NEWFORMs SIMREG_NEWFORMs = new BESIMREG_NEWFORMs();
            try
            {

                whereSql += sqlHelper.MakeSQL(sql + " MSISDNTITLE=nvl($s,MSISDNTITLE)", msisdnTitle);

                if (Convert.ToInt32(requestById) > 0)
                {
                    whereSql += sqlHelper.MakeSQL(sql + " AND REQUESTEDBYID=$n", requestById);
                }

                if (Convert.ToInt32(requestTypeId) > 0)
                {
                    whereSql += sqlHelper.MakeSQL(sql + " AND REQUESTEDTYPEID=$n", requestTypeId);
                }

                if (Convert.ToInt32(deliverById) > 0)
                {
                    whereSql += sqlHelper.MakeSQL(sql + " AND DELIVEREDBYID=$n", deliverById);
                }

                if (!String.IsNullOrEmpty(requestFromDate))
                {
                    whereSql += sqlHelper.MakeSQL(sql + " AND REQUESTEDDATE>=$s", requestFromDate);
                }

                if (!String.IsNullOrEmpty(requestToDate))
                {
                    whereSql += sqlHelper.MakeSQL(sql + "   AND REQUESTEDDATE<=$s", requestToDate);
                }

                if (!String.IsNullOrEmpty(deliverFromDate))
                {
                    whereSql += sqlHelper.MakeSQL(sql + " AND DELIVEREDBYDATE>=$s", deliverFromDate);
                }

                if (!String.IsNullOrEmpty(deliverToDate))
                {
                    whereSql += sqlHelper.MakeSQL(sql + "   AND DELIVEREDBYDATE<=$s", deliverToDate);
                }

                sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_NEWFORM WHERE $q ORDER BY ID", whereSql);

                IDataReader reader = sqlHelper.ExecuteQuery(sql);
                AddToSIMREG_NEWFORMCollection(SIMREG_NEWFORMs, reader);
                reader.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return SIMREG_NEWFORMs;
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:57,代码来源:DASIMREG_NEWFORM.cs

示例2: Delete

 public void Delete(SQLHelper sqlHelper, int ID)
 {
     string sql = string.Empty;
     try
     {
         sql = sqlHelper.MakeSQL(@"DELETE SIMREG_REQUESTEDBY WHERE REQUESTEDBYID=$n", ID);
         sqlHelper.ExecuteNonQuery(sql);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:13,代码来源:DASIMREG_REQUESTEDBY.cs

示例3: GetSIMREG_REQUESTEDBYs

        public BESIMREG_REQUESTEDBYs GetSIMREG_REQUESTEDBYs(SQLHelper sqlHelper)
        {
            string sql = string.Empty;
            BESIMREG_REQUESTEDBYs SIMREG_REQUESTEDBYs = new BESIMREG_REQUESTEDBYs();
            try
            {
                sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_REQUESTEDBY ORDER BY REQUESTEDBYID");

                IDataReader reader = sqlHelper.ExecuteQuery(sql);
                AddToSIMREG_REQUESTEDBYCollection(SIMREG_REQUESTEDBYs, reader);
                reader.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return SIMREG_REQUESTEDBYs;
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:18,代码来源:DASIMREG_REQUESTEDBY.cs

示例4: GetSIMREG_REQUESTEDBY

 public BESIMREG_REQUESTEDBY GetSIMREG_REQUESTEDBY(SQLHelper sqlHelper, int SIMREG_REQUESTEDBYId)
 {
     string sql = string.Empty;
     BESIMREG_REQUESTEDBYs SIMREG_REQUESTEDBYs = new BESIMREG_REQUESTEDBYs();
     try
     {
         sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_REQUESTEDBY WHERE REQUESTEDBYID=$n ORDER BY REQUESTEDBYID", SIMREG_REQUESTEDBYId);
         IDataReader reader = sqlHelper.ExecuteQuery(sql);
         AddToSIMREG_REQUESTEDBYCollection(SIMREG_REQUESTEDBYs, reader);
         reader.Close();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     if (SIMREG_REQUESTEDBYs.Count > 0)
         return SIMREG_REQUESTEDBYs[0];
     else return new BESIMREG_REQUESTEDBY();
 }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:19,代码来源:DASIMREG_REQUESTEDBY.cs

示例5: GetSIMREG_DELIVEREDBYbyUSERNAME

 public BESIMREG_DELIVEREDBY GetSIMREG_DELIVEREDBYbyUSERNAME(SQLHelper sqlHelper, string userName)
 {
     string sql = string.Empty;
     BESIMREG_DELIVEREDBYs SIMREG_DELIVEREDBYs = new BESIMREG_DELIVEREDBYs();
     try
     {
         sql = sqlHelper.MakeSQL(@"SELECT * FROM SIMREG_DELIVEREDBY WHERE USERNAME=$s", userName);
         IDataReader reader = sqlHelper.ExecuteQuery(sql);
         AddToSIMREG_DELIVEREDBYCollection(SIMREG_DELIVEREDBYs, reader);
         reader.Close();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     if (SIMREG_DELIVEREDBYs.Count > 0)
         return SIMREG_DELIVEREDBYs[0];
     else return new BESIMREG_DELIVEREDBY();
 }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:19,代码来源:DASIMREG_DELIVEREDBY.cs

示例6: GetTableId

        public int GetTableId(SQLHelper sqlHelper, string idName, string tableName)
        {
            int tableId = 0;
            string strSQL = string.Empty;

            try
            {
                strSQL = sqlHelper.MakeSQL("SELECT MAX($s) FROM " + tableName.ToUpper(), idName);
                IDataReader reader = sqlHelper.ExecuteQuery(strSQL);

                if (reader.Read())
                {
                    tableId = Convert.ToInt32(reader[0]);
                }

                return tableId;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:22,代码来源:DATableCode.cs

示例7: GetSIMREG_DOMAINUSER

        public BESIMREG_DOMAINUSER GetSIMREG_DOMAINUSER(SQLHelper sqlHelper, string UserName)
        {
            string sql = string.Empty;
            BESIMREG_DOMAINUSERs SIMREG_DOMAINUSERs = new BESIMREG_DOMAINUSERs();

            try
            {
                sql = sqlHelper.MakeSQL("SELECT * FROM SIMREG_DOMAINUSER WHERE username=$s", UserName);
                IDataReader reader = sqlHelper.ExecuteQuery(sql);
                AddToCollection(SIMREG_DOMAINUSERs, reader);
                reader.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            if (SIMREG_DOMAINUSERs.Count > 0)
            {
                return SIMREG_DOMAINUSERs[0];
            }
            else return new BESIMREG_DOMAINUSER();
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:22,代码来源:DASIMREG_DOMAINUSER.cs

示例8: Save

        public void Save(SQLHelper sqlHelper, BESIMREG_REQUESTEDBY entity)
        {
            string sql = string.Empty;
            try
            {
                if (entity.IsNew)
                {
                    // update tblTableCode
                    DATableCode daTableCode = new DATableCode();
                    //entity.REQUESTEDBYID = daTableCode.GetTableId(sqlHelper, "REQUESTEDBYID", "SIMREG_REQUESTEDBY");

                    sql = sqlHelper.MakeSQL(@"INSERT INTO SIMREG_REQUESTEDBY(REQUESTEDBYID, TITLE, IDATE, IUSER, EDATE, EUSER)"
                                            + " VALUES(SQ_SIMREG_REQUESTEDBYID.Nextval, $s, SYSDATE, $n, SYSDATE, $n)",
                        //entity.REQUESTEDBYID,
                                            entity.TITLE,
                                            //entity.IDATE,
                                            entity.IUSER,
                                            //entity.EDATE,
                                            entity.EUSER);
                }
                else
                {
                    sql = sqlHelper.MakeSQL(@"UPDATE SIMREG_REQUESTEDBY SET TITLE=$s, EDATE=SYSDATE, EUSER=$n WHERE REQUESTEDBYID=$n",
                                            entity.TITLE,
                                            //entity.EDATE,
                                            entity.EUSER,
                                            entity.REQUESTEDBYID);
                }

                sqlHelper.ExecuteNonQuery(sql);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:36,代码来源:DASIMREG_REQUESTEDBY.cs

示例9: TotalDataCount

        public int TotalDataCount(SQLHelper sqlHelper)
        {
            string sql = string.Empty;
            int rowCount = 0;

            try
            {
                sql = sqlHelper.MakeSQL("SELECT COUNT(ID) FROM SIMREG_NEWFORM");
                object obj = sqlHelper.ExecuteScalar(sql);

                rowCount = Convert.ToInt32(obj);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return rowCount;
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:19,代码来源:DASIMREG_NEWFORM.cs

示例10: Save

        public void Save(SQLHelper sqlHelper, BESIMREG_NEWFORM entity)
        {
            string sql = string.Empty;
            try
            {
                if (entity.IsNew)
                {
                    // update tblTableCode
                    DATableCode daTableCode = new DATableCode();
                    //entity.ID = daTableCode.GetTableId(sqlHelper, "ID", "SIMREG_NEWFORM");

                    sql = sqlHelper.MakeSQL(@"INSERT INTO SIMREG_NEWFORM(ID, MSISDNTITLE, REQUESTEDDATE, REQUESTEDBYID, REQUESTEDTYPEID, DELIVEREDBYDATE, DELIVEREDBYID, IDATE, IUSER, EDATE, EUSER)"
                                            + " VALUES(SQ_SIMREG_NEWFORMID.Nextval, $s, $d, $n, $n, $d, $n, SYSDATE, $n, SYSDATE, $n)",
                        //entity.ID,
                        //entity.MSISDNID,
                                            entity.MSISDNTITLE,
                                            entity.REQUESTEDDATE,
                                            entity.REQUESTEDBYID,
                                            entity.REQUESTEDTYPEID,
                                            entity.DELIVEREDBYDATE,
                                            entity.DELIVEREDBYID,
                        //entity.IDATE,
                                            entity.IUSER,
                        //entity.EDATE,
                                            entity.EUSER);
                }
                else
                {
                    sql = sqlHelper.MakeSQL(@"UPDATE SIMREG_NEWFORM SET MSISDNTITLE=$s, REQUESTEDDATE=$d, REQUESTEDBYID=$n, REQUESTEDTYPEID=$n, DELIVEREDBYDATE=$d, DELIVEREDBYID=$n, EDATE=SYSDATE, EUSER=$n WHERE ID=$n",
                        //entity.MSISDNID,
                                            entity.MSISDNTITLE,
                                            entity.REQUESTEDDATE,
                                            entity.REQUESTEDBYID,
                                            entity.REQUESTEDTYPEID,
                                            entity.DELIVEREDBYDATE,
                                            entity.DELIVEREDBYID,
                        //entity.EDATE,
                                            entity.EUSER,
                                            entity.ID);
                }

                sqlHelper.ExecuteNonQuery(sql);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:48,代码来源:DASIMREG_NEWFORM.cs

示例11: GetSIMREG_DOMAINUSERs

        public BESIMREG_DOMAINUSERs GetSIMREG_DOMAINUSERs(SQLHelper sqlHelper)
        {
            string sql = string.Empty;
            BESIMREG_DOMAINUSERs SIMREG_DOMAINUSERs = new BESIMREG_DOMAINUSERs();

            try
            {
                sql = sqlHelper.MakeSQL("SELECT userid, loginname, username FROM SIMREG_DOMAINUSER WHERE IsDeleted=$b", false);
                IDataReader reader = sqlHelper.ExecuteQuery(sql);
                AddToCollection(SIMREG_DOMAINUSERs, reader);
                reader.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return SIMREG_DOMAINUSERs;
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:18,代码来源:DASIMREG_DOMAINUSER.cs

示例12: Save

        public void Save(SQLHelper sqlHelper, BESIMREG_DOMAINUSER entity)
        {
            try
            {
                string sql = string.Empty;

                if (entity.IsNew)
                {
                    sql = sqlHelper.MakeSQL("INSERT INTO tbldomainuser1(userid, loginname, username, IsDeleted, IsActive, CreatedBy,"
                        + " CreatedDate, Serial) VALUES ($n, $s, $s, $b, $b, $n, $D, $n)", entity.userid, entity.loginname,
                         entity.username);

                }
                else
                {
                    sql = sqlHelper.MakeSQL("UPDATE tbldomainuser1 SET userid = $n, loginname = $s, username = $s, UpdatedDate = $D,"
                        + " UpdatedBy = $n"
                        + " WHERE userid=$n", entity.userid, entity.loginname, entity.username, entity.EDATE,
                         entity.EUSER, entity.userid);
                }

                sqlHelper.ExecuteNonQuery(sql);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
开发者ID:raselahmmedgit,项目名称:simreg-sample,代码行数:28,代码来源:DASIMREG_DOMAINUSER.cs


注:本文中的SQLHelper.MakeSQL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。