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


C# Data.setError方法代码示例

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


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

示例1: processTransaction

 private int processTransaction(String connectionString, String cus_no, String pwd, Data.Dber dberr)
 {
     Cp_Txnm tx = new Cp_Txnm(connectionString, TXID, dberr);
     // Check if TXNM fetch for transaction type "010" is successful. Return if error encountered
     if (dberr.ifError())
     {
         result = dberr.getErrorDesc(connectionString);
         return -1;
     }
     if(Validation.employeeInitiatedTxn(connectionString, cus_no) == 0)
     {
         Cp_Empm cpEmpm = new Cp_Empm(connectionString, cus_no, dberr);
         if(dberr.ifError())
         {
             resultP = dberr.getErrorDesc(connectionString);
             return -1;
         }
         if(cpEmpm.empmP.emp_pvg == 5)
         {
             dberr.setError(Mnemonics.DbErrorCodes.TXERR_ADMIN_PWD_NOCHANGE);
             resultP = dberr.getErrorDesc(connectionString);
             return -1;
         }
         if(!Data.EmpmD.UpdatePassword(connectionString, cus_no, pwd, dberr))
         {
             resultP = dberr.getErrorDesc(connectionString);
             return -1;
         }
         resultP = "Password Changed successfully!";
         return 0;
     }
     Cp_Cstm cstm = new Cp_Cstm(connectionString, cus_no, dberr);
     if (cstm.cstmP != null)
         cstm.updatePassword(connectionString, cus_no, pwd, dberr);
     if (dberr.ifError())
     {
         dberr = new Data.Dber();
         if(!Data.EmpmD.UpdatePassword(connectionString, cus_no, pwd, dberr))
         {
             dberr.setError(Mnemonics.DbErrorCodes.TXERR_PWD_NOUPDATE);
             resultP = dberr.getErrorDesc(connectionString);
             return -1;
         }
     }
     //------------------------------
     //Entity.Cstm cstm = Data.CstmD.Read(connectionString, acct.actmP.cs_no1, dberr);
     String mailResponse = "";
     if (!Security.OTPUtility.SendMail("SBS", "[email protected]",
         cstm.cstmP.cs_fname + cstm.cstmP.cs_mname + cstm.cstmP.cs_lname, cstm.cstmP.cs_email,
         "Update from SBS", "Password updated via transaction: "+ tx.txnmP.tran_desc))
     {
         mailResponse = "Mail sent.";
     }
     //-------------------------------
     resultP = "Password Changed successfully!" + mailResponse;
     //resultP = "Password Updated Successfully!";
     return 0;
 }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:58,代码来源:Y_024.cs

示例2: verifyInitPrivilege

 public Boolean verifyInitPrivilege(Data.Dber dberr)
 {
     if(tx_pvga > ac_pvga)
     {
         dberr.setError(Mnemonics.DbErrorCodes.TXERR_INIT_PVG);
         return false;
     }
     
     //Entity.Pendtxn pending = new Entity.Pendtxn();
     //Data.PendtxnD.Create(connectionString, pending);
     return true; // remove later
 }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:12,代码来源:Privilege.cs

示例3: Create

        public static int Create(string connectionString, Pendtxn dataObject, Data.Dber dberr)
        {
            try
            {

                var query = string.Format(@"INSERT INTO [SBS].[dbo].[PENDTXN]
               (
                [TRAN_DATE]
                ,[AC_NO]
                , [AC_NO2]
               ,[TRAN_PVGB]
               ,[INIT_EMPID]
               ,[INIT_CSNO]
               ,[DR_AMT]
               ,[CR_AMT]
               , [TRAN_ID]
                , [TRAN_DESC]
                , [TRAN_DATA])
                    OUTPUT INSERTED.REF_NO          
                    VALUES
                    ('{0}'  ,{1}, {2}, '{3}'  , {4} , {5}  ,'{6}', '{7}', {8}, '{9}', '{10}')",
                dataObject.tran_date,
                dataObject.ac_no == "0" ? "null" : dataObject.ac_no,
                dataObject.ac_no2 == "0" ? "null" : dataObject.ac_no2,
                dataObject.tran_pvgb,
                dataObject.init_empid == "0" ? "null" : dataObject.init_empid,
                dataObject.init_csno == "0" ? "null" : dataObject.init_csno,
                dataObject.dr_amt,
                dataObject.cr_amt,
                dataObject.tran_id ,
                dataObject.tran_desc,
                dataObject.tran_data);
                return (int)DbAccess.ExecuteScalar(connectionString, CommandType.Text, query);
            }
            catch
            {
                dberr.setError(Mnemonics.DbErrorCodes.DBERR_PENDTXN_NOWRITE);
                return -1;
            }
        }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:40,代码来源:PendtxnD.cs


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