示例#1
0
        public Response Create(AlertParam param)
        {
            Response response = new Response();

            try
            {
                response.Text   = "This entity has been added :" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(Processor.Create(param));
                response.Result = true;
            }
            catch
            {
                response.Text   = "Unfortunately something went wrong. Are you sure that the entity you are trying to create doesn't already exist ?";
                response.Result = false;
            }
            return(response);
        }
示例#2
0
        public Response Update(long id, AlertParam param)
        {
            Response response = new Response();

            try
            {
                Processor.Update(id, param);
                response.Text   = "The entity has been updated.";
                response.Result = true;
            }
            catch
            {
                response.Text   = "The command was unable to execute. Are you sure the entity you want to update exists.";
                response.Result = false;
            }
            return(response);
        }
 public void ShowIngotInsufficientAlert(UIPanelType backPanel)
 {
     this.RemoveAllTip();
     this.HideLoading();
     AlertParam alertParam = new AlertParam() { Alert = LocalizationUtils.GetText("Alert.Label.IngotInsufficient"), Option = AlertOptionType.Sure_Cancel };
     alertParam.ResultEvent += (result)=>
     {
         if (result)
         {
             this.TryClosePanel(backPanel);
             this.OpenPanel(UIPanelType.MallPanel);
         }
     };
     this.OpenPanel(UIPanelType.AlertPopupPanel, new PanelParam() { Alert = alertParam });
 }
 public void ShowAlert(string alert, AlertOptionType options, Action<bool> resultEvent)
 {
     this.RemoveAllTip();
     this.HideLoading();
     AlertParam alertParam = new AlertParam() { Alert = alert,Option = options };
     alertParam.ResultEvent += resultEvent;
     this.OpenPanel(UIPanelType.AlertPopupPanel, new PanelParam() { Alert = alertParam });
 }
示例#5
0
 public void ValidateParameters(AlertParam param)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public void Update(long id, AlertParam param)
 {
     Data.Entity.Alert oldEntity = Dao.Find(id);
     Data.Entity.Alert newEntity = ParamConverter.Convert(param, oldEntity);
     Dao.Update(newEntity);
 }
示例#7
0
 public AlertResult Create(AlertParam param)
 {
     Data.Entity.Alert entity = ParamConverter.Convert(param, null);
     entity = Dao.Save(entity);
     return(ResultConverter.Convert(entity));
 }