コード例 #1
0
    void _view_InsertCommand(object sender, EventArgs e)
    {
        try
        {
            Merchant_ApiURL c = new Merchant_ApiURL();

            c.APIType         = _view.APIType;
            c.ApiName         = _view.ApiName;
            c.ApiURL          = _view.ApiURL;
            c.ExpireOn        = _view.ExpireOn;
            c.ApiScheduleType = _view.ApiScheduleType;
            c.RunOnTime       = _view.RunOnTime;
            _model.DBOperation(Constants.Action.Insert, c);
            _view.strMessage = "Successfully Inserted!!!";

            c.ApiName = string.Empty;
            c.ApiURL  = string.Empty;

            LoadViewFromModel();

            _view.DataBind();
        }
        catch (Exception ex)
        {
            _view.strMessage = ex.Message;
        }
    }
コード例 #2
0
    void _view_DeleteCommand(object sender, EventArgs e)
    {
        try
        {
            Merchant_ApiURL c = new Merchant_ApiURL();
            _model.DBOperation(Constants.Action.Delete, c, _view.Ids);
            _view.strMessage = "Successfully Deleted!!!";
            LoadViewFromModel();

            _view.DataBind();
        }
        catch (Exception ex)
        {
            _view.strMessage = ex.Message;
        }
    }
コード例 #3
0
    public void DBOperation(Constants.Action command, Merchant_ApiURL item = null, List <long> apiUrlIds = null)
    {
        switch (command)
        {
        case Constants.Action.Insert:
            client.InsertApiURL(item);
            break;

        case Constants.Action.Delete:
            client.DeleteApiURLs(apiUrlIds);
            break;

        default:
            break;
        }
    }