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


C# Data.ifError方法代码示例

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


在下文中一共展示了Data.ifError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: writeToPendingTxns

 public int writeToPendingTxns(String connectionString, String ac1, String ac2, String csNo, String pvgb,
     String tranDesc, String initEmpid, Decimal dr, Decimal cr, String tranid, String inData, Data.Dber dberr)
 {
     Cp_Pendtxn cpPend = new Cp_Pendtxn(connectionString, ac1, ac2, pvgb, csNo, initEmpid, dr, cr, tranDesc, tranid, inData, dberr);
     if(dberr.ifError())
     {
         return -1;
     }
     return 0;
 }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:10,代码来源:Privilege.cs

示例3: processTransaction

 private int processTransaction(String connectionString, String empCusId, Data.Dber dberr)
 {
     bool success = Data.CstmD.deactivateCustomer(connectionString, empCusId, "0", dberr);
     if (dberr.ifError() || !success)
     {
         dberr = new Data.Dber();
         if (!Data.EmpmD.deactivateEmployee(connectionString, empCusId, "0", dberr))
         {
             resultP = dberr.getErrorDesc(connectionString);
             return -1;
         }
     }
     resultP = "Transaction Succeessful";
     return 0;
 }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:15,代码来源:y_027.cs

示例4: processTransaction

        private int processTransaction(String connectionString, String loginAc, String acType, 
            String dummyAc, String dummyAccess, String refno, Data.Dber dberr)
        {
            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;
            }
            cstm = Data.CstmD.Read(connectionString, loginAc, dberr);
            if (dberr.ifError())
            {
                dberr = new Data.Dber();
                empm = Data.EmpmD.Read(connectionString, loginAc, dberr);
                if (dberr.ifError())
                {
                    result = dberr.getErrorDesc(connectionString);
                    return -1;
                }
                else
                {
                    employee = true;
                }
            }
            if (employee)
            {
                pvg = new Privilege(this.tx.txnmP.tran_pvga, this.tx.txnmP.tran_pvgb, Convert.ToInt32(this.empm.emp_pvg));
            }
            else
            {
                pvg = new Privilege(this.tx.txnmP.tran_pvga, this.tx.txnmP.tran_pvgb, Convert.ToInt32(this.cstm.cs_type));
            }
            if (!pvg.verifyInitPrivilege(dberr))
            {
                 result = dberr.getErrorDesc(connectionString);
                 return -1;
            }
            if (!pvg.verifyApprovePrivilege())
            {
                String inData = this.TXID + "|" + acType + "|" + loginAc;
                    if (pvg.writeToPendingTxns(
                        connectionString,               /* connection string */
                        "0",                            /* account 1 */
                        "0",                            /* account 2 */
                        this.cstm.cs_no,                /* customer number */
                        tx.txnmP.tran_pvgb.ToString(),  /* transaction approve privilege */
                        tx.txnmP.tran_desc,             /* transaction description */
                        "0",                            /* initiating employee number */
                        0,                              /* debit amount */
                        0,                              /* credit amount */
                        tx.txnmP.tran_id,               /* transaction id (not tran code) */
                        inData,                         /* incoming transaction string in XSwitch */
                        dberr                           /* error tracking object */
                        ) != 0)
                    {
                        resultP = dberr.getErrorDesc(connectionString);
                        return -1;
                    }
                    resultP = Mnemonics.DbErrorCodes.MSG_SENT_FOR_AUTH;
                    return 0;
            }

            actm = new Cp_Actm(connectionString, dummyAc, "0", acType, 0, 0, 1, "Y", "Y", DateTime.Now.ToString(), true);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            int retCode = Data.ActmD.Create(connectionString, actm.actmP, dberr);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            if (!Data.PendtxnD.Delete(connectionString, refno))
            {
                dberr.setError(Mnemonics.DbErrorCodes.DBERR_PENDTXN_DELETE);
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            //retCode
            //Entity.Cstm cstm = Data.CstmD.Read(connectionString, acct.actmP.cs_no1, dberr);
            Entity.Cstm cstm1 = Data.CstmD.Read(connectionString, retCode.ToString(), dberr);
            if (dberr.ifError())
            {
                result = dberr.getErrorDesc(connectionString);
                return -1;
            }
            String mailResponse = "";
            if (!Security.OTPUtility.SendMail("SBS", "[email protected]",
                cstm1.cs_fname + cstm1.cs_mname + cstm1.cs_lname, cstm1.cs_email,
                "Update from SBS", "new account created for you is " + retCode.ToString()))
            {
                mailResponse = "Mail sent.";
            }
            //-------------------------------
            resultP = "Successful!" + mailResponse;
            return 0;
        }
开发者ID:AakanxuShah,项目名称:SecureBankSystem,代码行数:100,代码来源:Y_025.cs


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