本文整理汇总了C#中APB.Mercury.DataObjects.SCPWeb.OperationResult.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# OperationResult.ToString方法的具体用法?C# OperationResult.ToString怎么用?C# OperationResult.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APB.Mercury.DataObjects.SCPWeb.OperationResult
的用法示例。
在下文中一共展示了OperationResult.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangePassword
public static string ChangePassword(decimal pSusr_Id, string pSusr_Login, string pSusr_Password_old, string pSusr_Password_new, ConnectionInfo pConnectionInfo)
{
bool lPasswordOK;
string lPassword;
string lResult = "";
OperationResult lReturn;
Transaction pTransaction;
pTransaction = new Transaction(Instance.CreateDatabase(pConnectionInfo));
// Validando a Senha Digitada.
lPassword = GetPassword(pSusr_Login, pConnectionInfo);
lPasswordOK = (lPassword == pSusr_Password_old) ? true : false;
if (!lPasswordOK)
lResult = "Senha Atual Incorreta";
// Verificando Transação
bool lLocalTransaction = (pTransaction != null);
UpdateCommand lUpdate;
lReturn = new OperationResult(SystemUserQD.TableName, SystemUserQD.TableName);
if (lPasswordOK)
{
// Iniciando processo de update...
if (lReturn.IsValid)
{
try
{
if (lLocalTransaction)
{
lReturn.Trace("ExternalUser: Transação local, instanciando banco...");
}
lUpdate = new UpdateCommand(SystemUserQD.TableName);
lReturn.Trace("ExternalUser: Adicionando campos ao objeto de update");
lUpdate.Fields.Add(SystemUserQD._SUSR_PASSWORD.Name, APB.Framework.Encryption.Crypto.Encode(pSusr_Password_new), (ItemType)SystemUserQD._SUSR_PASSWORD.DBType);
string lSql = "";
//TODO: Condição where customizada
lSql = String.Format("WHERE {0} = >>{0}", SystemUserQD._SUSR_ID.Name);
lUpdate.Condition = lSql;
lUpdate.Conditions.Add(SystemUserQD._SUSR_ID.Name, pSusr_Id);
lReturn.Trace("ExternalUser: Executando o Update");
lUpdate.Execute(pTransaction);
if (!lReturn.HasError)
{
if (lLocalTransaction)
{
if (!lReturn.HasError)
{
lReturn.Trace("ExternalUser: Update finalizado, executando commit");
pTransaction.Commit();
}
else
{
pTransaction.Rollback();
}
}
}
else
{
if (lLocalTransaction)
pTransaction.Rollback();
}
}
catch (Exception ex)
{
lReturn.OperationException = new SerializableException(ex);
if (lLocalTransaction)
pTransaction.Rollback();
}
}
}
else
{
return "Senha atual incorreta";
}
if (lReturn.IsValid)
lResult = "";
else
lResult = lReturn.ToString();
return lResult;
}