protected void btnSave_Click(object sender, EventArgs e)
        {
            Common.AgentRatio agentRatio = new Common.AgentRatio();
            try
            {
                agentRatio.SmsType            = Helper.GetByte(drpSmsType.SelectedValue);
                agentRatio.Ratio              = Helper.GetDecimal(txtRatio.Text);
                agentRatio.CreateDate         = DateTime.Now;
                agentRatio.OperatorID         = Helper.GetByte(drpOperator.SelectedValue);
                agentRatio.SmsSenderAgentGuid = AgentGuid;

                if (agentRatio.HasError)
                {
                    throw new Exception(agentRatio.ErrorMessage);
                }

                if (!Facade.AgentRatio.Insert(agentRatio))
                {
                    throw new Exception(Language.GetString("ErrorRecord"));
                }
            }
            catch (Exception ex)
            {
                ShowMessageBox(ex.Message, string.Empty, "danger");
            }
        }
Ejemplo n.º 2
0
 public static bool Insert(Common.AgentRatio agentRatio)
 {
     Business.AgentRatio agentRatioController = new Business.AgentRatio();
     return(agentRatioController.Insert(agentRatio) != Guid.Empty ? true : false);
 }