本文整理汇总了C#中BAL.ClsBAL.GetAgentById方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetAgentById方法的具体用法?C# ClsBAL.GetAgentById怎么用?C# ClsBAL.GetAgentById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.GetAgentById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnDepositSubmit_Click
protected void btnDepositSubmit_Click(object sender, EventArgs e)
{
try
{
objBal = new ClsBAL();
ListItem value = ddlAgents.Items.FindByText(txtAgents.Text.ToString());
if (value == null)
{
ddlAgents.SelectedIndex = 0;
lblMsg.InnerHtml = "The Agent Username does not exists.";
txtAgentName.Focus();
txtAgentName.Text = "";
}
else
{
if (Session["Role"].ToString() == "Admin")
{
ddlAgents.SelectedItem.Value = value.Value;
string msg = objBal.AddAgentDeposit(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString())
, Convert.ToDouble(txtAmount.Text.ToString()), txtDepositDetails.Text.Trim().ToString(), Convert.ToInt32(Session["UserID"].ToString())
, rbtnType.SelectedItem.Text.ToString(), txtTransactionNo.Text.Trim().ToString(), txtReason.Text.Trim());
BindDeposits();
DeductAgentBalance(Convert.ToInt32(ddlAgents.SelectedItem.Value), Convert.ToDouble(0.00),
Convert.ToInt32(Userid), rbtnType.SelectedItem.Text.ToString(), Convert.ToDouble(txtAmount.Text.ToString()),
Convert.ToDouble(0.00), Convert.ToInt32(0.00));
System.Data.DataSet ds = objBal.GetAgentById(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString()));
string body = "Dear " + ds.Tables[0].Rows[0]["UserName"].ToString() + ", <br/> " + "Rs. " + txtAmount.Text.ToString() + "/- amount has been credited in your account. <br/><br/> Thanks, <br/>Love Journey Team";
bool res = Mailsender.SendEmail(ds.Tables[0].Rows[0]["EmailId"].ToString(), "", "", "Deposit Details", body);
lblMsg.InnerHtml = msg;
BindDeposits(); txtAmount.Text = txtDepositDetails.Text = txtTransactionNo.Text = txtReason.Text = ""; rbtnType.SelectedIndex = -1;
}
else if (Session["Role"].ToString() == "Distributor")
{
if (Convert.ToDouble(Session["Balance"].ToString()) >= Convert.ToDouble(txtAmount.Text.ToString()))
{
ddlAgents.SelectedItem.Value = value.Value;
string msg = objBal.AddAgentDeposit(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString())
, Convert.ToDouble(txtAmount.Text.ToString()), txtDepositDetails.Text.Trim().ToString(), Convert.ToInt32(Session["UserID"].ToString())
, rbtnType.SelectedItem.Text.ToString(), txtTransactionNo.Text.Trim().ToString(), txtReason.Text.Trim());
BindDeposits();
DeductAgentBalance(Convert.ToInt32(ddlAgents.SelectedItem.Value), Convert.ToDouble(0.00),
Convert.ToInt32(Userid), rbtnType.SelectedItem.Text.ToString(), Convert.ToDouble(txtAmount.Text.ToString()),
Convert.ToDouble(0.00), Convert.ToInt32(0.00));
lblMsg.InnerHtml = msg;
if (msg == "Inserted Successfully.")
{
objBal.deductDistributorbalance(Convert.ToInt32(Session["UserID"].ToString()), Convert.ToDouble(txtAmount.Text.ToString()), "Deduct");
ClsBAL objBAL = new ClsBAL();
System.Data.DataSet dataset = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
Session["Balance"] = dataset.Tables[0].Rows[0]["Balance"].ToString();
Label balance = (Label)this.Master.FindControl("lblDbBal");
balance.Text = "Your balance is : " + " " + Session["Balance"].ToString();
}
System.Data.DataSet ds = objBal.GetAgentById(Convert.ToInt32(ddlAgents.SelectedItem.Value.ToString()));
string body = "Dear " + ds.Tables[0].Rows[0]["UserName"].ToString() + ", <br/> " + "Rs. " + txtAmount.Text.ToString() + "/- amount has been credited in your account. <br/><br/> Thanks, <br/>Love Journey Team";
bool res = Mailsender.SendEmail(ds.Tables[0].Rows[0]["EmailId"].ToString(), "", "", "Deposit Details", body);
BindDeposits(); txtAmount.Text = txtDepositDetails.Text = txtTransactionNo.Text = txtReason.Text = ""; rbtnType.SelectedIndex = -1;
}
else
{
lblMsg.InnerHtml = "Your balance should be greater than the adding amount.";
}
}
}
}
catch (Exception ex)
{
lblMsg.InnerHtml = ex.Message;
}
}
示例2: GetAgentById
DataSet GetAgentById(int id)
{
try
{
objBal = new ClsBAL();
return objBal.GetAgentById(id);
}
catch (Exception ex)
{
lblMsg.InnerHtml = ex.Message;
throw;
}
}